check/gst/gstvalue.c (test_string): Add test for bug #165650.

Original commit message from CVS:
2005-11-19  Andy Wingo  <wingo@pobox.com>

* check/gst/gstvalue.c (test_string): Add test for bug #165650.

* gst/gstvalue.c (gst_string_wrap): Trying to serialize a NULL
string should produce an error, given the lack of a way to
represent NULL strings. Fixes #165650.
This commit is contained in:
Andy Wingo 2005-11-19 17:08:23 +00:00
parent 0ae103aff3
commit 77d95482f6
4 changed files with 13 additions and 1 deletions

View file

@ -1,5 +1,11 @@
2005-11-19 Andy Wingo <wingo@pobox.com>
* check/gst/gstvalue.c (test_string): Add test for bug #165650.
* gst/gstvalue.c (gst_string_wrap): Trying to serialize a NULL
string should produce an error, given the lack of a way to
represent NULL strings. Fixes #165650.
* gst/gstvalue.h:
* gst/gstvalue.c (gst_value_array_append_value)
(gst_value_array_prepend_value, gst_value_array_get_size)

View file

@ -256,6 +256,9 @@ GST_START_TEST (test_string)
"\nserialized : %s\ndeserialized: %s", try[i],
g_value_get_string (&v));
}
/* NULL strings should not be serializable */
g_value_set_string (&v, NULL);
fail_unless (gst_value_serialize (&v) == NULL);
g_value_unset (&v);
}

View file

@ -1381,7 +1381,7 @@ gst_string_wrap (const char *s)
len = 0;
t = s;
if (!s)
return g_strdup ("");
return NULL;
while (*t) {
if (GST_ASCII_IS_STRING (*t)) {
len++;

View file

@ -256,6 +256,9 @@ GST_START_TEST (test_string)
"\nserialized : %s\ndeserialized: %s", try[i],
g_value_get_string (&v));
}
/* NULL strings should not be serializable */
g_value_set_string (&v, NULL);
fail_unless (gst_value_serialize (&v) == NULL);
g_value_unset (&v);
}