mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 15:50:07 +01:00
route-manager/test: fix usage of g_assert_expect_message()
Tests that use g_assert_expect_message() must initialize with nmtst_init_assert_logging(). Otherwise, the caller can change the logging level via NMTST_DEBUG=log-level=DEBUG,log-domains=DEFAULT which breaks the assertions. nmtst_init_assert_logging() allows the caller to turn of checking of assertions via NMTST_DEBUG=log-level=DEBUG,log-domains=DEFAULT,no-expect-message Also, don't use g_message() in platform tests otherwise the test fail because nmtst now sets g_log_set_always_fatal().
This commit is contained in:
parent
cdd3e1c302
commit
5fd3827e49
2 changed files with 3 additions and 3 deletions
|
|
@ -263,10 +263,10 @@ main (int argc, char **argv)
|
||||||
nmtst_reexec_sudo ();
|
nmtst_reexec_sudo ();
|
||||||
|
|
||||||
#ifdef REQUIRE_ROOT_TESTS
|
#ifdef REQUIRE_ROOT_TESTS
|
||||||
g_message ("Fail test: requires root privileges (%s)", program);
|
g_print ("Fail test: requires root privileges (%s)\n", program);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
#else
|
#else
|
||||||
g_message ("Skipping test: requires root privileges (%s)", program);
|
g_print ("Skipping test: requires root privileges (%s)\n", program);
|
||||||
return 77;
|
return 77;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -676,7 +676,7 @@ fixture_teardown (test_fixture *fixture, gconstpointer user_data)
|
||||||
void
|
void
|
||||||
init_tests (int *argc, char ***argv)
|
init_tests (int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
nmtst_init_with_logging (argc, argv, NULL, "ALL");
|
nmtst_init_assert_logging (argc, argv, "WARN", "ALL");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue