update tests: avoid helgrind warning

Log to the black_hole or helgrind gets unhappy
This commit is contained in:
Dirk-Jan C. Binnema 2022-05-06 22:14:02 +03:00
parent ec500d3ed4
commit f83d1b3ed0
3 changed files with 19 additions and 2 deletions

View File

@ -48,7 +48,7 @@ assert_contacts_equal(const Contacts& contacts,
size_t n{};
for (auto&& contact: contacts) {
if (g_test_verbose())
g_print ("{ \"%s\", \"%s\"},\n", contact.name.c_str(), contact.email.c_str());
g_message("{ \"%s\", \"%s\"},\n", contact.name.c_str(), contact.email.c_str());
// assert_equal(contact.name, expected.at(n).first);
// assert_equal(contact.email, expected.at(n).second);
++n;

View File

@ -319,7 +319,6 @@ main(int argc, char* argv[])
{
g_test_init(&argc, &argv, NULL);
/* mu_runtime_init/uninit */
g_test_add_func("/store/ctor-dtor", test_store_ctor_dtor);
g_test_add_func("/store/add-count-remove", test_store_add_count_remove);
g_test_add_func("/store/message/mailing-list",
@ -329,5 +328,13 @@ main(int argc, char* argv[])
g_test_add_func("/store/index/move",
test_index_move);
if (!g_test_verbose())
g_log_set_handler(
NULL,
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
G_LOG_FLAG_RECURSION),
(GLogFunc)black_hole,
NULL);
return g_test_run();
}

View File

@ -84,6 +84,16 @@ try {
g_test_add_func("/query", test_query);
if (!g_test_verbose())
g_log_set_handler(
NULL,
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
G_LOG_FLAG_RECURSION),
(GLogFunc)black_hole,
NULL);
return g_test_run();
} catch (const std::runtime_error& re) {