Oops, broke automatic string type parsing.

Original commit message from CVS:
* check/gst/gststructure.c: (GST_START_TEST):
* gst/gststructure.c: (gst_structure_parse_value):
Oops, broke automatic string type parsing.
Add a test to catch it in future.
This commit is contained in:
Jan Schmidt 2005-11-22 13:14:51 +00:00
parent ba9fadac70
commit 5f54f34216
4 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2005-11-22 Jan Schmidt <thaytan@mad.scientist.com>
* check/gst/gststructure.c: (GST_START_TEST):
* gst/gststructure.c: (gst_structure_parse_value):
Oops, broke automatic string type parsing.
Add a test to catch it in future.
2005-11-22 Andy Wingo <wingo@pobox.com>
* gst/gsttagsetter.c (gst_tag_setter_get_tag_merge_mode)

View file

@ -99,6 +99,13 @@ GST_START_TEST (test_from_string)
fail_unless ((val = gst_structure_get_value (structure, "value")) != NULL);
fail_unless (GST_VALUE_HOLDS_FRACTION (val));
gst_structure_free (structure);
s = "test-string,value=bar";
structure = gst_structure_from_string (s, NULL);
fail_if (structure == NULL, "Could not get structure from string %s", s);
fail_unless ((val = gst_structure_get_value (structure, "value")) != NULL);
fail_unless (G_VALUE_HOLDS_STRING (val));
gst_structure_free (structure);
}
GST_END_TEST;

View file

@ -1637,7 +1637,7 @@ gst_structure_parse_value (gchar * str,
{ G_TYPE_INT, G_TYPE_DOUBLE, GST_TYPE_FRACTION, G_TYPE_STRING };
int i;
for (i = 0; i < 3; i++) {
for (i = 0; i < 4; i++) {
g_value_init (value, try_types[i]);
ret = gst_value_deserialize (value, value_s);
if (ret)

View file

@ -99,6 +99,13 @@ GST_START_TEST (test_from_string)
fail_unless ((val = gst_structure_get_value (structure, "value")) != NULL);
fail_unless (GST_VALUE_HOLDS_FRACTION (val));
gst_structure_free (structure);
s = "test-string,value=bar";
structure = gst_structure_from_string (s, NULL);
fail_if (structure == NULL, "Could not get structure from string %s", s);
fail_unless ((val = gst_structure_get_value (structure, "value")) != NULL);
fail_unless (G_VALUE_HOLDS_STRING (val));
gst_structure_free (structure);
}
GST_END_TEST;