@@ -1233,21 +1233,43 @@ class TestPreprocessor : public TestFixture
12331233
12341234 void if_cond7 ()
12351235 {
1236- const char filedata[] = " #define A 1\n "
1237- " #if A==1\n "
1238- " a1;\n "
1239- " #endif\n " ;
1236+ {
1237+ const char filedata[] = " #define A 1\n "
1238+ " #if A==1\n "
1239+ " a1;\n "
1240+ " #endif\n " ;
12401241
1241- // Preprocess => actual result..
1242- std::istringstream istr (filedata);
1243- std::map<std::string, std::string> actual;
1244- Settings settings;
1245- Preprocessor preprocessor (&settings, this );
1246- preprocessor.preprocess (istr, actual, " file.c" );
1242+ // Preprocess => actual result..
1243+ std::istringstream istr (filedata);
1244+ std::map<std::string, std::string> actual;
1245+ Settings settings;
1246+ Preprocessor preprocessor (&settings, this );
1247+ preprocessor.preprocess (istr, actual, " file.c" );
12471248
1248- // Compare results..
1249- ASSERT_EQUALS (1 , (int )actual.size ());
1250- ASSERT_EQUALS (" \n\n a1;\n\n " , actual[" " ]);
1249+ // Compare results..
1250+ ASSERT_EQUALS (1 , (int )actual.size ());
1251+ ASSERT_EQUALS (" \n\n a1;\n\n " , actual[" " ]);
1252+ }
1253+
1254+ {
1255+ const char filedata[] = " #define A 0\n "
1256+ " #if A\n "
1257+ " foo();\n "
1258+ " #endif\n " ;
1259+
1260+ // Preprocess => actual result..
1261+ std::istringstream istr (filedata);
1262+ std::map<std::string, std::string> actual;
1263+ Settings settings;
1264+ Preprocessor preprocessor (&settings, this );
1265+ preprocessor.preprocess (istr, actual, " file.c" );
1266+
1267+ // Compare results..
1268+ TODO_ASSERT_EQUALS (2 ,
1269+ 1 , static_cast <unsigned int >(actual.size ()));
1270+ TODO_ASSERT_EQUALS (" \n\n\n\n " ,
1271+ " \n\n foo();\n\n " , actual[" " ]);
1272+ }
12511273 }
12521274
12531275
0 commit comments