@@ -517,12 +517,15 @@ static void combineOperators_ellipsis()
517517
518518static void comment ()
519519{
520+ simplecpp::DUI dui;
521+ dui.removeComments = true ;
522+
520523 ASSERT_EQUALS (" // abc" , readfile (" // abc" ));
521- ASSERT_EQUALS (" " , preprocess (" // abc" ));
524+ ASSERT_EQUALS (" " , preprocess (" // abc" , dui ));
522525 ASSERT_EQUALS (" /*\n\n */abc" , readfile (" /*\n\n */abc" ));
523- ASSERT_EQUALS (" \n\n abc" , preprocess (" /*\n\n */abc" ));
526+ ASSERT_EQUALS (" \n\n abc" , preprocess (" /*\n\n */abc" , dui ));
524527 ASSERT_EQUALS (" * p = a / * b / * c ;" , readfile (" *p=a/ *b/ *c;" ));
525- ASSERT_EQUALS (" * p = a / * b / * c ;" , preprocess (" *p=a/ *b/ *c;" ));
528+ ASSERT_EQUALS (" * p = a / * b / * c ;" , preprocess (" *p=a/ *b/ *c;" , dui ));
526529}
527530
528531static void comment_multiline ()
@@ -2568,13 +2571,16 @@ static void location11()
25682571
25692572static void location12 ()
25702573{
2574+ simplecpp::DUI dui;
2575+ dui.removeComments = true ;
2576+
25712577 const char code[] =
25722578 " /**//**/#/**//**/line/**//**/3/**//**/\" file.c\" /**/\n "
25732579 " __LINE__ __FILE__\n " ;
25742580 ASSERT_EQUALS (" \n "
25752581 " #line 3 \" file.c\"\n "
25762582 " 3 \" file.c\" " ,
2577- preprocess (code));
2583+ preprocess (code, dui ));
25782584}
25792585
25802586static void missingHeader1 ()
@@ -3012,6 +3018,7 @@ static void include9()
30123018 simplecpp::TokenList out (files);
30133019 simplecpp::DUI dui;
30143020 dui.includePaths .emplace_back (" ." );
3021+ dui.removeComments = true ;
30153022 simplecpp::preprocess (out, rawtokens_c, files, cache, dui);
30163023
30173024 ASSERT_EQUALS (" \n #line 2 \" 1.h\"\n x = 1 ;" , out.stringify ());
0 commit comments