From 993eae63abd9f1c021abcb7bfacf3de036eb423f Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 18 Jan 2024 13:02:57 +0000 Subject: [PATCH] tests: Use g_assert_*() rather than g_assert() in gthash tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It won’t get compiled out with `G_DISABLE_ASSERT`. Signed-off-by: Philip Withnall --- girepository/tests/gthash.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/girepository/tests/gthash.c b/girepository/tests/gthash.c index 6c674c1da..8d927927d 100644 --- a/girepository/tests/gthash.c +++ b/girepository/tests/gthash.c @@ -39,8 +39,7 @@ test_build_retrieve (void) gi_typelib_hash_builder_add_string (builder, "VolumeMonitor", 9); gi_typelib_hash_builder_add_string (builder, "FileMonitorFlags", 31); - if (!gi_typelib_hash_builder_prepare (builder)) - g_assert_not_reached (); + g_assert_true (gi_typelib_hash_builder_prepare (builder)); bufsize = gi_typelib_hash_builder_get_buffer_size (builder); @@ -50,10 +49,10 @@ test_build_retrieve (void) gi_typelib_hash_builder_destroy (builder); - g_assert (gi_typelib_hash_search (buf, "Action", 4) == 0); - g_assert (gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); - g_assert (gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); - g_assert (gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); + g_assert_cmpuint (gi_typelib_hash_search (buf, "Action", 4), ==, 0); + g_assert_cmpuint (gi_typelib_hash_search (buf, "ZLibDecompressor", 4), ==, 42); + g_assert_cmpuint (gi_typelib_hash_search (buf, "VolumeMonitor", 4), ==, 9); + g_assert_cmpuint (gi_typelib_hash_search (buf, "FileMonitorFlags", 4), ==, 31); g_free (buf); }