mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-27 12:42:10 +01:00
tests/strfuncs: Add test for g_strdup() with empty string
This commit is contained in:
parent
9cd90d97ae
commit
ed42f57704
@ -505,6 +505,11 @@ test_strdup (void)
|
|||||||
g_assert_nonnull (str);
|
g_assert_nonnull (str);
|
||||||
g_assert_cmpstr (str, ==, GLIB_TEST_STRING);
|
g_assert_cmpstr (str, ==, GLIB_TEST_STRING);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
|
|
||||||
|
str = g_strdup ("");
|
||||||
|
g_assert_cmpint (str[0], ==, '\0');
|
||||||
|
g_assert_cmpstr (str, ==, "");
|
||||||
|
g_clear_pointer (&str, g_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Testing g_strndup() function with various positive and negative cases */
|
/* Testing g_strndup() function with various positive and negative cases */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user