@@ -396,7 +396,6 @@ class TestSuppressions : public TestFixture {
396396 }
397397#endif // HAS_THREADING_MODEL_FORK
398398
399- // TODO: check all results
400399 void runChecks (unsigned int (TestSuppressions::*check)(const char [], const std::string &)) {
401400 // check to make sure the appropriate errors are present
402401 ASSERT_EQUALS (1 , (this ->*check)(" void f() {\n "
@@ -720,6 +719,40 @@ class TestSuppressions : public TestFixture {
720719 " [test.cpp:6:0]: (error) unknown suppression type 'cppcheck-suppress-end-unknown' [invalidSuppression]\n "
721720 " [test.cpp:4:0]: (error) Suppress Begin: No matching end [invalidSuppression]\n " , errout_str ());
722721
722+ ASSERT_EQUALS (1 , (this ->*check)(" // cppcheck-suppress-file\n "
723+ " // cppcheck-suppress\n "
724+ " // cppcheck-suppress \n "
725+ " // cppcheck-suppress\t\n "
726+ " // cppcheck-suppress []\n " // TODO
727+ " // cppcheck-suppress-macro\n "
728+ " // cppcheck-suppress-begin\n "
729+ " // cppcheck-suppress-begin id0\n "
730+ " void f() {}\n "
731+ " // cppcheck-suppress-end\n " ,
732+ " " ));
733+ ASSERT_EQUALS (" [test.cpp:1:0]: (error) suppression without error ID [invalidSuppression]\n "
734+ " [test.cpp:2:0]: (error) suppression without error ID [invalidSuppression]\n "
735+ " [test.cpp:3:0]: (error) suppression without error ID [invalidSuppression]\n "
736+ " [test.cpp:4:0]: (error) suppression without error ID [invalidSuppression]\n "
737+ " [test.cpp:6:0]: (error) suppression without error ID [invalidSuppression]\n "
738+ " [test.cpp:7:0]: (error) suppression without error ID [invalidSuppression]\n "
739+ " [test.cpp:10:0]: (error) suppression without error ID [invalidSuppression]\n "
740+ " [test.cpp:8:0]: (error) Suppress Begin: No matching end [invalidSuppression]\n " , errout_str ());
741+
742+ ASSERT_EQUALS (1 , (this ->*check)(" // cppcheck-suppress:\n "
743+ " // cppcheck-suppress-unknown\n "
744+ " // cppcheck-suppress-begin-unknown\n "
745+ " // cppcheck-suppress-begin\n "
746+ " void f() {}\n "
747+ " // cppcheck-suppress-end-unknown\n " ,
748+ " " ));
749+ // TODO: actually these are all invalid types
750+ ASSERT_EQUALS (" [test.cpp:1:0]: (error) suppression without error ID [invalidSuppression]\n "
751+ " [test.cpp:2:0]: (error) suppression without error ID [invalidSuppression]\n "
752+ " [test.cpp:3:0]: (error) suppression without error ID [invalidSuppression]\n "
753+ " [test.cpp:4:0]: (error) suppression without error ID [invalidSuppression]\n "
754+ " [test.cpp:6:0]: (error) suppression without error ID [invalidSuppression]\n " , errout_str ());
755+
723756 ASSERT_EQUALS (1 , (this ->*check)(" void f() {\n "
724757 " int a;\n "
725758 " // cppcheck-suppress-begin uninitvar\n "
@@ -915,13 +948,14 @@ class TestSuppressions : public TestFixture {
915948 " uninitvar" ));
916949 ASSERT_EQUALS (" " , errout_str ());
917950
918- // cppcheck-suppress-macro
951+ // TODO: check result
919952 (this ->*check)(" // cppcheck-suppress-macro zerodiv\n "
920953 " #define DIV(A,B) A/B\n "
921954 " a = DIV(10,0);\n " ,
922955 " " );
923956 ASSERT_EQUALS (" " , errout_str ());
924957
958+ // TODO: check result
925959 (this ->*check)(" // cppcheck-suppress-macro abc\n "
926960 " #define DIV(A,B) A/B\n "
927961 " a = DIV(10,1);\n " ,
0 commit comments