mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 02:36:19 +01:00
tests: Test that g_bytes_unref(NULL) is a no-op
It’s documented as such, and this marginally increases the code coverage on `gbytes.c`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
082c2117bb
commit
fc7b316bc7
@ -450,6 +450,13 @@ test_get_region (void)
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
||||
static void
|
||||
test_unref_null (void)
|
||||
{
|
||||
g_test_summary ("Test that calling g_bytes_unref() on NULL is a no-op");
|
||||
g_bytes_unref (NULL);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -474,6 +481,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/bytes/to-array/non-malloc", test_to_array_non_malloc);
|
||||
g_test_add_func ("/bytes/null", test_null);
|
||||
g_test_add_func ("/bytes/get-region", test_get_region);
|
||||
g_test_add_func ("/bytes/unref-null", test_unref_null);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user