Update of /cvsroot/cpptool/rfta/src/rftaparser
In directory sc8-pr-cvs1:/tmp/cvs-serv23397/src/rftaparser
Modified Files:
UnparsedDeclarationMutatorTest.cpp
UnparsedDeclarationMutatorTest.h
Log Message:
* added support for class forward declaration 'class X;'
* fixed class body range (was before } unlike namespace, which caused a bug since the mutator do --end).
Index: UnparsedDeclarationMutatorTest.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** UnparsedDeclarationMutatorTest.cpp 29 Apr 2003 09:57:01 -0000 1.6
--- UnparsedDeclarationMutatorTest.cpp 1 May 2003 21:12:15 -0000 1.7
***************
*** 214,218 ****
source.addKeyed(SPECIFIER,"const") << " ";
source.setKeyStart(SPECIFIER) << "class x {";
! source.addKeyed("CLASS-BODY" , " public: int x() { } " ) << "}" ;
source.setKeyEnd(SPECIFIER) << " ";
source.addKeyed(DECLARATOR, "y" ) << ";";
--- 214,218 ----
source.addKeyed(SPECIFIER,"const") << " ";
source.setKeyStart(SPECIFIER) << "class x {";
! source.addKeyed("CLASS-BODY" , " public: int x() { } }" );
source.setKeyEnd(SPECIFIER) << " ";
source.addKeyed(DECLARATOR, "y" ) << ";";
***************
*** 730,733 ****
--- 730,745 ----
RFTA_ASSERT_NODE_TYPE( node->getChildAt(0), ASTNodeTypes::unparsedDeclarator);
}
+
+
+ void
+ UnparsedDeclarationMutatorTest::testClassForwardDeclaration()
+ {
+ const std::string source( "class X;" );
+ SourceASTNodePtr sourceNode = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source );
+
+ ASTNodePtr classNode = sourceNode->getChildAt(0);
+ RFTA_ASSERT_NODE_TYPE( classNode, ASTNodeTypes::declaration );
+ }
+
} // namespace Refactoring
Index: UnparsedDeclarationMutatorTest.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** UnparsedDeclarationMutatorTest.h 29 Apr 2003 09:57:01 -0000 1.3
--- UnparsedDeclarationMutatorTest.h 1 May 2003 21:12:16 -0000 1.4
***************
*** 23,26 ****
--- 23,27 ----
CPPUNIT_TEST( testClassDeclaration );
CPPUNIT_TEST( testClassDeclarationWithInheritance );
+ CPPUNIT_TEST( testClassForwardDeclaration );
CPPUNIT_TEST( testEnumDeclaration );
CPPUNIT_TEST( testPointerDecl );
***************
*** 64,67 ****
--- 65,69 ----
void testClassDeclaration();
void testClassDeclarationWithInheritance();
+ void testClassForwardDeclaration();
void testEnumDeclaration();
void testPointerDecl();
|