Update of /cvsroot/cpptool/rfta/src/rfta
In directory sc8-pr-cvs1:/tmp/cvs-serv4672/src/rfta
Modified Files:
IdentifierResolverTest.cpp IdentifierResolverTest.h
Log Message:
* added unit test to demonstrate bug (commented out, need to be fixed)
Index: IdentifierResolverTest.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rfta/IdentifierResolverTest.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** IdentifierResolverTest.cpp 20 Dec 2002 19:38:03 -0000 1.4
--- IdentifierResolverTest.cpp 31 Jan 2003 21:37:54 -0000 1.5
***************
*** 241,243 ****
--- 241,277 ----
+ void
+ IdentifierResolverTest::testBug1()
+ {
+ /* // The last occurrence bigBuffer is not recognized as a local variable (found using the add-in).
+ {
+ std::vector<int> bigBuffer;
+
+ {
+ KTEST_ASSERT_EQUAL( index, bigBuffer[index] );
+ }
+
+ }
+ */
+
+
+ builder_->addKeyingMid( "std::vector<int> ", "bigBuffer", ";", "bigBuffer.0" );
+ builder_->add( "{" );
+ builder_->addKeyingMid( " KTEST_ASSERT_EQUAL( ", "index", ", ", "index.1" );
+ builder_->addKeyingMid( "", "bigBuffer", "[index] );", "bigBuffer.1" );
+ builder_->add( "}" );
+
+ parse();
+ strategy_->setRecordMode();
+ strategy_->declareLocalVariable( getVariableNode( "bigBuffer.0" ) );
+
+ strategy_->enterNewLocalVariableScope();
+ strategy_->resolveUnqualifiedIdentifier( getIdentifierNode( "index.1" ) );
+ strategy_->resolveUnqualifiedIdentifier( getIdentifierNode( "bigBuffer.1" ) );
+ strategy_->exitLocalVariableScope();
+
+ checkResolution();
+ }
+
+
} // namespace Refactoring
Index: IdentifierResolverTest.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rfta/IdentifierResolverTest.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IdentifierResolverTest.h 19 Dec 2002 20:17:33 -0000 1.3
--- IdentifierResolverTest.h 31 Jan 2003 21:37:54 -0000 1.4
***************
*** 27,30 ****
--- 27,31 ----
CPPUNIT_TEST( testForScope );
CPPUNIT_TEST( testSwitchScope );
+ // CPPUNIT_TEST( testBug1 );
CPPUNIT_TEST_SUITE_END();
***************
*** 45,48 ****
--- 46,51 ----
void testForScope();
void testSwitchScope();
+
+ void testBug1();
private:
|