testrunner: fail if `TODO_ASSERT_*` succeeds (#4911)

* testrunner: fail if TODO succeeds

* testnullpointer.cpp: removed TODO from assert in `nullpointerStdStream`
This commit is contained in:
Oliver Stöneberg 2023-03-26 15:13:07 +02:00 committed by GitHub
parent 7231d1cece
commit f002429a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -380,7 +380,7 @@ std::size_t TestFixture::runTests(const options& args)
std::cerr << std::endl << std::endl; std::cerr << std::endl << std::endl;
} }
std::cerr.flush(); std::cerr.flush();
return fails_counter; return fails_counter + succeeded_todos_counter;
} }
void TestFixture::reportOut(const std::string & outmsg, Color /*c*/) void TestFixture::reportOut(const std::string & outmsg, Color /*c*/)

View File

@ -3762,13 +3762,11 @@ private:
" std::cout << abc << p;\n" " std::cout << abc << p;\n"
" }\n" " }\n"
"}", false); "}", false);
TODO_ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n" ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n"
"[test.cpp:2] -> [test.cpp:4]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n" "[test.cpp:2] -> [test.cpp:4]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n"
"[test.cpp:2] -> [test.cpp:5]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n" "[test.cpp:2] -> [test.cpp:5]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n"
"[test.cpp:2] -> [test.cpp:6]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n", "[test.cpp:2] -> [test.cpp:6]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n",
"[test.cpp:2] -> [test.cpp:3]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n" errout.str());
"[test.cpp:2] -> [test.cpp:4]: (warning) Either the condition 'p==0' is redundant or there is possible null pointer dereference: p.\n",
errout.str());
check("void f() {\n" check("void f() {\n"
" void* p1 = 0;\n" " void* p1 = 0;\n"