From c5e196f0c01118f854f6db7cf272022cc5556244 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 9 Sep 2024 17:38:55 +0100 Subject: [PATCH] tests: Add more G_RESOURCE_ERROR_NOT_FOUND unit tests Add coverage for handling of this situation for more API entry points. Signed-off-by: Philip Withnall Helps: #3465 --- gio/tests/resources.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gio/tests/resources.c b/gio/tests/resources.c index 21d5d6a20..c2fcfee0f 100644 --- a/gio/tests/resources.c +++ b/gio/tests/resources.c @@ -602,6 +602,20 @@ test_resource_registered (void) g_assert_false (found); g_assert_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND); g_clear_error (&error); + + data = g_resources_lookup_data ("/test1.txt", + G_RESOURCE_LOOKUP_FLAGS_NONE, + &error); + g_assert_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND); + g_assert_null (data); + g_clear_error (&error); + + in = g_resources_open_stream ("/test1.txt", + G_RESOURCE_LOOKUP_FLAGS_NONE, + &error); + g_assert_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND); + g_assert_null (in); + g_clear_error (&error); } static void