@@ -239,15 +239,15 @@ class TestCppcheck : public TestFixture {
239239 }
240240
241241 void checkWithFile () const {
242- checkWithFileInternal (" file.cpp " , false );
242+ checkWithFileInternal (" file.c " , false );
243243 }
244244
245245 void checkWithFileWithTools () const {
246- checkWithFileInternal (" file_tools.cpp " , true );
246+ checkWithFileInternal (" file_tools.c " , true );
247247 }
248248
249249 void checkWithFileWithToolsNoCommand () const {
250- checkWithFileInternal (" file_tools_nocmd.cpp " , true , true );
250+ checkWithFileInternal (" file_tools_nocmd.c " , true , true );
251251 }
252252
253253 void checkWithFSInternal (const std::string& fname, bool tools, bool nocmd = false ) const
@@ -323,26 +323,26 @@ class TestCppcheck : public TestFixture {
323323 }
324324
325325 void checkWithFS () const {
326- checkWithFSInternal (" fs.cpp " , false );
326+ checkWithFSInternal (" fs.c " , false );
327327 }
328328
329329 void checkWithFSWithTools () const {
330- checkWithFSInternal (" fs_tools.cpp " , true );
330+ checkWithFSInternal (" fs_tools.c " , true );
331331 }
332332
333333 void checkWithFSWithToolsNoCommand () const {
334- checkWithFSInternal (" fs_tools_nocmd.cpp " , true , true );
334+ checkWithFSInternal (" fs_tools_nocmd.c " , true , true );
335335 }
336336
337337 void suppress_error_library () const
338338 {
339- ScopedFile file (" suppr_err_lib.cpp " ,
339+ ScopedFile file (" suppr_err_lib.c " ,
340340 " void f()\n "
341341 " {\n "
342342 " (void)(*((int*)0));\n "
343343 " }" );
344344
345- const char xmldata[] = R"( <def format="2"><markup ext=".cpp " reporterrors="false"/></def>)" ;
345+ const char xmldata[] = R"( <def format="2"><markup ext=".c " reporterrors="false"/></def>)" ;
346346 const Settings s = settingsBuilder ().libraryxml (xmldata).build ();
347347 Suppressions supprs;
348348 ErrorLogger2 errorLogger;
@@ -363,9 +363,9 @@ class TestCppcheck : public TestFixture {
363363 " {\n "
364364 " (void)(*((int*)0));\n "
365365 " }" );
366- ScopedFile test_file_a (" a.cpp " ,
366+ ScopedFile test_file_a (" a.c " ,
367367 " #include \" inc.h\" " );
368- ScopedFile test_file_b (" b.cpp " ,
368+ ScopedFile test_file_b (" b.c " ,
369369 " #include \" inc.h\" " );
370370
371371 // this is the "simple" format
@@ -382,16 +382,16 @@ class TestCppcheck : public TestFixture {
382382 // the internal errorlist is cleared after each check() call
383383 ASSERT_EQUALS (2 , errorLogger.errmsgs .size ());
384384 auto it = errorLogger.errmsgs .cbegin ();
385- ASSERT_EQUALS (" a.cpp " , it->file0 );
385+ ASSERT_EQUALS (" a.c " , it->file0 );
386386 ASSERT_EQUALS (" nullPointer" , it->id );
387387 ++it;
388- ASSERT_EQUALS (" b.cpp " , it->file0 );
388+ ASSERT_EQUALS (" b.c " , it->file0 );
389389 ASSERT_EQUALS (" nullPointer" , it->id );
390390 }
391391
392392 void unique_errors_2 () const
393393 {
394- ScopedFile test_file (" c.cpp " ,
394+ ScopedFile test_file (" c.c " ,
395395 " void f()\n "
396396 " {\n "
397397 " const long m[9] = {};\n "
@@ -413,7 +413,7 @@ class TestCppcheck : public TestFixture {
413413 // the internal errorlist is cleared after each check() call
414414 ASSERT_EQUALS (2 , errorLogger.errmsgs .size ());
415415 auto it = errorLogger.errmsgs .cbegin ();
416- ASSERT_EQUALS (" c.cpp " , it->file0 );
416+ ASSERT_EQUALS (" c.c " , it->file0 );
417417 ASSERT_EQUALS (1 , it->callStack .size ());
418418 {
419419 auto stack = it->callStack .cbegin ();
@@ -422,7 +422,7 @@ class TestCppcheck : public TestFixture {
422422 }
423423 ASSERT_EQUALS (" arrayIndexOutOfBounds" , it->id );
424424 ++it;
425- ASSERT_EQUALS (" c.cpp " , it->file0 );
425+ ASSERT_EQUALS (" c.c " , it->file0 );
426426 ASSERT_EQUALS (1 , it->callStack .size ());
427427 {
428428 auto stack = it->callStack .cbegin ();
@@ -476,10 +476,10 @@ class TestCppcheck : public TestFixture {
476476 Suppressions supprs;
477477 ErrorLogger2 errorLogger;
478478 CppCheck cppcheck (s, supprs, errorLogger, false , {});
479- std::vector<std::string> files{" /some/path/test.cpp " };
479+ std::vector<std::string> files{" /some/path/test.c " };
480480 simplecpp::TokenList tokens1 (files);
481481 const std::string expected = " <rawtokens>\n "
482- " <file index=\" 0\" name=\" test.cpp \" />\n "
482+ " <file index=\" 0\" name=\" test.c \" />\n "
483483 " </rawtokens>\n " ;
484484 ASSERT_EQUALS (expected, cppcheck.getDumpFileContentsRawTokens (files, tokens1));
485485
@@ -491,7 +491,7 @@ class TestCppcheck : public TestFixture {
491491 simplecpp::OutputList outputList;
492492 const simplecpp::TokenList tokens2 (fin, files, " " , &outputList);
493493 const std::string expected2 = " <rawtokens>\n "
494- " <file index=\" 0\" name=\" test.cpp \" />\n "
494+ " <file index=\" 0\" name=\" test.c \" />\n "
495495 " <file index=\" 1\" name=\"\" />\n "
496496 " <tok fileIndex=\" 1\" linenr=\" 1\" column=\" 1\" str=\" //x y\" />\n "
497497 " <tok fileIndex=\" 1\" linenr=\" 3\" column=\" 1\" str=\" ;\" />\n "
@@ -508,7 +508,7 @@ class TestCppcheck : public TestFixture {
508508 Settings s;
509509 s.libraries .emplace_back (" std.cfg" );
510510 CppCheck cppcheck (s, supprs, errorLogger, false , {});
511- // std::vector<std::string> files{ "/some/path/test.cpp " };
511+ // std::vector<std::string> files{ "/some/path/test.c " };
512512 const std::string expected = " <library lib=\" std.cfg\" />\n " ;
513513 ASSERT_EQUALS (expected, cppcheck.getLibraryDumpData ());
514514 }
0 commit comments