@@ -60,6 +60,18 @@ class TestPreprocessor : public TestFixture {
6060 return tokens2.stringify ();
6161 }
6262
63+ static std::vector<RemarkComment> getRemarkComments (const char code[], ErrorLogger& errorLogger)
64+ {
65+ std::vector<std::string> files{" test.cpp" };
66+ std::istringstream istr (code);
67+ const simplecpp::TokenList tokens1 (istr, files, files[0 ]);
68+
69+ const Settings settings;
70+
71+ const Preprocessor preprocessor (settings, errorLogger);
72+ return preprocessor.getRemarkComments (tokens1);
73+ }
74+
6375 const Settings settings0 = settingsBuilder().severity(Severity::information).build();
6476
6577 void run () override {
@@ -1917,15 +1929,15 @@ class TestPreprocessor : public TestFixture {
19171929 void remarkComment1 () {
19181930 const char code[] = " // REMARK: assignment with 1\n "
19191931 " x=1;\n " ;
1920- const auto remarkComments = PreprocessorHelper:: getRemarkComments (code, *this );
1932+ const auto remarkComments = getRemarkComments (code, *this );
19211933 ASSERT_EQUALS (1 , remarkComments.size ());
19221934 ASSERT_EQUALS (2 , remarkComments[0 ].lineNumber );
19231935 ASSERT_EQUALS (" assignment with 1" , remarkComments[0 ].str );
19241936 }
19251937
19261938 void remarkComment2 () {
19271939 const char code[] = " x=1; ///REMARK assignment with 1\n " ;
1928- const auto remarkComments = PreprocessorHelper:: getRemarkComments (code, *this );
1940+ const auto remarkComments = getRemarkComments (code, *this );
19291941 ASSERT_EQUALS (1 , remarkComments.size ());
19301942 ASSERT_EQUALS (1 , remarkComments[0 ].lineNumber );
19311943 ASSERT_EQUALS (" assignment with 1" , remarkComments[0 ].str );
@@ -1934,7 +1946,7 @@ class TestPreprocessor : public TestFixture {
19341946 void remarkComment3 () {
19351947 const char code[] = " /** REMARK: assignment with 1 */\n "
19361948 " x=1;\n " ;
1937- const auto remarkComments = PreprocessorHelper:: getRemarkComments (code, *this );
1949+ const auto remarkComments = getRemarkComments (code, *this );
19381950 ASSERT_EQUALS (1 , remarkComments.size ());
19391951 ASSERT_EQUALS (2 , remarkComments[0 ].lineNumber );
19401952 ASSERT_EQUALS (" assignment with 1 " , remarkComments[0 ].str );
0 commit comments