From dac56824a64bcb300bc86175dee7d13e67bed09c Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 19 Oct 2019 19:14:05 +0200 Subject: gitypelibtest: make tests fail if the library can't be found Check that g_object_info_get_ref_function_pointer() actually returns something, which it doesn't if the shared lib isn't found. In case a shared lib isn't found g-i will emit a warning, so also make sure we fail on warnings to avoid similar problems in the future. --- tests/repository/gitypelibtest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/repository/gitypelibtest.c b/tests/repository/gitypelibtest.c index 6620f1ea..c0398d97 100644 --- a/tests/repository/gitypelibtest.c +++ b/tests/repository/gitypelibtest.c @@ -163,7 +163,7 @@ test_fundamental_get_ref_function_pointer (GIRepository * repo) g_assert (g_irepository_require (repo, "Regress", NULL, 0, NULL)); info = g_irepository_find_by_name (repo, "Regress", "TestFundamentalObject"); - g_object_info_get_ref_function_pointer (info); + g_assert_nonnull (g_object_info_get_ref_function_pointer (info)); g_base_info_unref (info); } @@ -308,6 +308,8 @@ main (int argc, char **argv) { GIRepository *repo; + g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); + repo = g_irepository_get_default (); /* do tests */ -- cgit v1.2.1