summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 96aa08f)
raw | patch | inline | side by side (parent: 96aa08f)
author | Andy Wingo <wingo@pobox.com> | |
Mon, 3 Mar 2008 10:07:21 +0000 (10:07 +0000) | ||
committer | Andy Wingo <wingo@pobox.com> | |
Mon, 3 Mar 2008 10:07:21 +0000 (10:07 +0000) |
Original commit message from CVS:
2008-03-03 Andy Wingo <wingo@pobox.com>
* tests/check/gst/gststructure.c (GST_START_TEST): Add a check for
the new warning.
* gst/gststructure.c (gst_structure_from_string): Warn if
structure_from_string didn't consume the whole string, but the
caller did not provide an end pointer.
2008-03-03 Andy Wingo <wingo@pobox.com>
* tests/check/gst/gststructure.c (GST_START_TEST): Add a check for
the new warning.
* gst/gststructure.c (gst_structure_from_string): Warn if
structure_from_string didn't consume the whole string, but the
caller did not provide an end pointer.
ChangeLog | patch | blob | history | |
common | patch | blob | history | |
gst/gststructure.c | patch | blob | history | |
tests/check/gst/gststructure.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 8cdd684d488c8f0b79a5a4ce29cfa53f7b0b9ee3..c4856188ba35a6ecc6d7aa9517567e39d7328ae2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2008-03-03 Andy Wingo <wingo@pobox.com>
+
+ * tests/check/gst/gststructure.c (GST_START_TEST): Add a check for
+ the new warning.
+
+ * gst/gststructure.c (gst_structure_from_string): Warn if
+ structure_from_string didn't consume the whole string, but the
+ caller did not provide an end pointer.
+
2008-03-01 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Fabrizio Gennari <fabrizio.ge at tiscali it>
index 4fa1159996900100f3a1cd3b43d7f0f027310cdb..8ede243026af26e496d775b46ded7988ce883080 160000 (submodule)
--- a/common
+++ b/common
-Subproject commit 4fa1159996900100f3a1cd3b43d7f0f027310cdb
+Subproject commit 8ede243026af26e496d775b46ded7988ce883080
diff --git a/gst/gststructure.c b/gst/gststructure.c
index c72358508a265dbab477ff40a9bfb2b59d6f3ce8..18c816e5c9d6a3ac202bd3ab0caf7a799eca1efb 100644 (file)
--- a/gst/gststructure.c
+++ b/gst/gststructure.c
if (end)
*end = (char *) string + (r - copy);
+ else if (*r)
+ g_warning ("gst_structure_from_string did not consume whole string,"
+ " but caller did not provide end pointer (\"%s\")", string);
g_free (copy);
return structure;
index c4b3ed7570134baca19a8eaff05507fea62ab31c..6658ccb767a6ac6ac21129aae18a8160bb979428 100644 (file)
s = "***foo***, abc=(boolean)false";
structure = gst_structure_from_string (s, NULL);
fail_unless (structure == NULL);
+
+ /* assert that we get a warning if the structure wasn't entirely consumed, but
+ * we didn't provide an end pointer */
+ s = "foo/bar; other random data";
+ ASSERT_WARNING (structure = gst_structure_from_string (s, NULL));
+ fail_if (structure == NULL, "Could not get structure from string %s", s);
+ gst_structure_free (structure);
}
GST_END_TEST;