mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
test: Add test for serializing/deserializing NULL strings
This commit is contained in:
parent
47047992fc
commit
7699b8a1bc
1 changed files with 18 additions and 0 deletions
|
@ -254,6 +254,24 @@ GST_START_TEST (test_to_from_string)
|
|||
|
||||
gst_structure_free (st1);
|
||||
gst_structure_free (st2);
|
||||
|
||||
/* Test NULL strings */
|
||||
st1 = gst_structure_new ("test", "mynullstr", G_TYPE_STRING, NULL, NULL);
|
||||
fail_unless (st1 != NULL);
|
||||
str = gst_structure_to_string (st1);
|
||||
fail_unless (strcmp (str, "test, mynullstr=(string)NULL;") == 0,
|
||||
"Failed to serialize to right string: %s", str);
|
||||
|
||||
st2 = gst_structure_from_string (str, NULL);
|
||||
fail_unless (st2 != NULL);
|
||||
g_free (str);
|
||||
|
||||
fail_unless (gst_structure_is_equal (st1, st2),
|
||||
"Structures did not match:\n\tStructure 1: %" GST_PTR_FORMAT
|
||||
"\n\tStructure 2: %" GST_PTR_FORMAT "\n", st1, st2);
|
||||
|
||||
gst_structure_free (st1);
|
||||
gst_structure_free (st2);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
|
Loading…
Reference in a new issue