mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-23 01:18:53 +02:00
tests/strfuncs: Add test for g_strdup() with empty string
This commit is contained in:
@@ -505,6 +505,11 @@ test_strdup (void)
|
||||
g_assert_nonnull (str);
|
||||
g_assert_cmpstr (str, ==, GLIB_TEST_STRING);
|
||||
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 */
|
||||
|
Reference in New Issue
Block a user