mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
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:
parent
0ae103aff3
commit
77d95482f6
4 changed files with 13 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue