From 5f54f34216ca81559219c129340a20189c9c2684 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 22 Nov 2005 13:14:51 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ check/gst/gststructure.c | 7 +++++++ gst/gststructure.c | 2 +- tests/check/gst/gststructure.c | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5cfdfc1..00a115a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-11-22 Jan Schmidt + + * 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 * gst/gsttagsetter.c (gst_tag_setter_get_tag_merge_mode) diff --git a/check/gst/gststructure.c b/check/gst/gststructure.c index 60342be..e775de2 100644 --- a/check/gst/gststructure.c +++ b/check/gst/gststructure.c @@ -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; diff --git a/gst/gststructure.c b/gst/gststructure.c index f09d817..84a8f97 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -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) diff --git a/tests/check/gst/gststructure.c b/tests/check/gst/gststructure.c index 60342be..e775de2 100644 --- a/tests/check/gst/gststructure.c +++ b/tests/check/gst/gststructure.c @@ -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; -- 2.7.4