mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 20:22:11 +01:00
gstrfuncs: Add test for g_strjoinv() behaviour
https://bugzilla.gnome.org/show_bug.cgi?id=764092
This commit is contained in:
parent
283c565af6
commit
21ad4c800c
@ -1114,6 +1114,8 @@ test_bounds (void)
|
|||||||
char *tmp, *tmp2;
|
char *tmp, *tmp2;
|
||||||
char **array;
|
char **array;
|
||||||
char *string;
|
char *string;
|
||||||
|
const char * const strjoinv_0[] = { NULL };
|
||||||
|
const char * const strjoinv_1[] = { "foo", NULL };
|
||||||
|
|
||||||
/* if we allocate the file between two others and then free those
|
/* if we allocate the file between two others and then free those
|
||||||
* other two, then hopefully we end up with unmapped memory on either
|
* other two, then hopefully we end up with unmapped memory on either
|
||||||
@ -1265,6 +1267,14 @@ test_bounds (void)
|
|||||||
g_assert_cmpmem (tmp, strlen (tmp), string, 4095);
|
g_assert_cmpmem (tmp, strlen (tmp), string, 4095);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
|
||||||
|
tmp = g_strjoinv ("/", (char **) strjoinv_0);
|
||||||
|
g_assert_cmpstr (tmp, ==, "");
|
||||||
|
g_free (tmp);
|
||||||
|
|
||||||
|
tmp = g_strjoinv ("/", (char **) strjoinv_1);
|
||||||
|
g_assert_cmpstr (tmp, ==, "foo");
|
||||||
|
g_free (tmp);
|
||||||
|
|
||||||
tmp = g_strconcat (string, string, string, NULL);
|
tmp = g_strconcat (string, string, string, NULL);
|
||||||
g_assert_cmpint (strlen (tmp), ==, 4095 * 3);
|
g_assert_cmpint (strlen (tmp), ==, 4095 * 3);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user