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 <pwithnall@gnome.org>

Helps: #3465
This commit is contained in:
Philip Withnall 2024-09-09 17:38:55 +01:00
parent 7ed386a10b
commit c5e196f0c0
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -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