@@ -245,10 +245,6 @@ class TestPreprocessor : public TestFixture {
245245
246246 TEST_CASE (wrongPathOnErrorDirective);
247247
248- TEST_CASE (testDirectiveIncludeTypes);
249- TEST_CASE (testDirectiveIncludeLocations);
250- TEST_CASE (testDirectiveIncludeComments);
251-
252248 TEST_CASE (testMissingInclude);
253249 TEST_CASE (testMissingInclude2);
254250 TEST_CASE (testMissingInclude3);
@@ -275,7 +271,7 @@ class TestPreprocessor : public TestFixture {
275271 tokens.removeComments ();
276272 preprocessor0.simplifyPragmaAsm (&tokens);
277273 preprocessor0.removeComments ();
278- preprocessor0.setDirectives (tokens);
274+ std::list<Directive> directives = preprocessor0.createDirectives (tokens); // TODO
279275
280276 preprocessor0.reportOutput (outputList, true );
281277
@@ -2313,88 +2309,6 @@ class TestPreprocessor : public TestFixture {
23132309 ASSERT_EQUALS (" [test.c:1]: (error) #error hello world!\n " , errout_str ());
23142310 }
23152311
2316- void testDirectiveIncludeTypes () {
2317- const char filedata[] = " #define macro some definition\n "
2318- " #undef macro\n "
2319- " #ifdef macro\n "
2320- " #elif some (complex) condition\n "
2321- " #else\n "
2322- " #endif\n "
2323- " #if some other condition\n "
2324- " #pragma some proprietary content\n "
2325- " #\n " /* may appear in old C code */
2326- " #ident some text\n " /* may appear in old C code */
2327- " #unknownmacro some unpredictable text\n "
2328- " #warning some warning message\n "
2329- " #error some error message\n " ;
2330- const char dumpdata[] = " <directivelist>\n "
2331-
2332- " <directive file=\" test.c\" linenr=\" 1\" str=\" #define macro some definition\" />\n "
2333- " <directive file=\" test.c\" linenr=\" 2\" str=\" #undef macro\" />\n "
2334- " <directive file=\" test.c\" linenr=\" 3\" str=\" #ifdef macro\" />\n "
2335- " <directive file=\" test.c\" linenr=\" 4\" str=\" #elif some (complex) condition\" />\n "
2336- " <directive file=\" test.c\" linenr=\" 5\" str=\" #else\" />\n "
2337- " <directive file=\" test.c\" linenr=\" 6\" str=\" #endif\" />\n "
2338- " <directive file=\" test.c\" linenr=\" 7\" str=\" #if some other condition\" />\n "
2339- " <directive file=\" test.c\" linenr=\" 8\" str=\" #pragma some proprietary content\" />\n "
2340- " <directive file=\" test.c\" linenr=\" 9\" str=\" #\" />\n "
2341- " <directive file=\" test.c\" linenr=\" 10\" str=\" #ident some text\" />\n "
2342- " <directive file=\" test.c\" linenr=\" 11\" str=\" #unknownmacro some unpredictable text\" />\n "
2343- " <directive file=\" test.c\" linenr=\" 12\" str=\" #warning some warning message\" />\n "
2344- " <directive file=\" test.c\" linenr=\" 13\" str=\" #error some error message\" />\n "
2345- " </directivelist>\n " ;
2346-
2347- std::ostringstream ostr;
2348- Preprocessor preprocessor (settings0, this );
2349- PreprocessorHelper::getcode (preprocessor, filedata, " " , " test.c" );
2350- preprocessor.dump (ostr);
2351- ASSERT_EQUALS (dumpdata, ostr.str ());
2352- }
2353-
2354- void testDirectiveIncludeLocations () {
2355- const char filedata[] = " #define macro1 val\n "
2356- " #file \" inc1.h\"\n "
2357- " #define macro2 val\n "
2358- " #file \" inc2.h\"\n "
2359- " #define macro3 val\n "
2360- " #endfile\n "
2361- " #define macro4 val\n "
2362- " #endfile\n "
2363- " #define macro5 val\n " ;
2364- const char dumpdata[] = " <directivelist>\n "
2365- " <directive file=\" test.c\" linenr=\" 1\" str=\" #define macro1 val\" />\n "
2366- " <directive file=\" test.c\" linenr=\" 2\" str=\" #include "inc1.h"\" />\n "
2367- " <directive file=\" inc1.h\" linenr=\" 1\" str=\" #define macro2 val\" />\n "
2368- " <directive file=\" inc1.h\" linenr=\" 2\" str=\" #include "inc2.h"\" />\n "
2369- " <directive file=\" inc2.h\" linenr=\" 1\" str=\" #define macro3 val\" />\n "
2370- " <directive file=\" inc1.h\" linenr=\" 3\" str=\" #define macro4 val\" />\n "
2371- " <directive file=\" test.c\" linenr=\" 3\" str=\" #define macro5 val\" />\n "
2372- " </directivelist>\n " ;
2373-
2374- std::ostringstream ostr;
2375- Preprocessor preprocessor (settings0, this );
2376- PreprocessorHelper::getcode (preprocessor, filedata, " " , " test.c" );
2377- preprocessor.dump (ostr);
2378- ASSERT_EQUALS (dumpdata, ostr.str ());
2379- }
2380-
2381- void testDirectiveIncludeComments () {
2382- const char filedata[] = " #ifdef macro2 /* this will be removed */\n "
2383- " #else /* this will be removed too */\n "
2384- " #endif /* this will also be removed */\n " ;
2385- const char dumpdata[] = " <directivelist>\n "
2386- " <directive file=\" test.c\" linenr=\" 1\" str=\" #ifdef macro2\" />\n "
2387- " <directive file=\" test.c\" linenr=\" 2\" str=\" #else\" />\n "
2388- " <directive file=\" test.c\" linenr=\" 3\" str=\" #endif\" />\n "
2389- " </directivelist>\n " ;
2390-
2391- std::ostringstream ostr;
2392- Preprocessor preprocessor (settings0, this );
2393- PreprocessorHelper::getcode (preprocessor, filedata, " " , " test.c" );
2394- preprocessor.dump (ostr);
2395- ASSERT_EQUALS (dumpdata, ostr.str ());
2396- }
2397-
23982312 // test for existing local include
23992313 void testMissingInclude () {
24002314 /* const*/ Settings settings;
0 commit comments