[Bug 794355] gst_structure_to_string: display actual value of pointers

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Jun 11 08:20:35 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=794355

--- Comment #7 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Comment on attachment 372630
  --> https://bugzilla.gnome.org/attachment.cgi?id=372630
gst_structure_to_string: display actual value of pointers

I think this is good to go, but I'm not sure about the unit test:

>--- a/tests/check/gst/gststructure.c
>+++ b/tests/check/gst/gststructure.c
>@@ -274,6 +274,18 @@ GST_START_TEST (test_to_from_string)
> 
>   gst_structure_free (st1);
>   gst_structure_free (st2);
>+
>+  /* pointers are serialized but not deserialized */
>+  st1 = gst_structure_new ("test", "ptr", G_TYPE_POINTER, 0xdeadbeef, NULL);
>+  str = gst_structure_to_string (st1);
>+  fail_unless (strcmp (str, "test, ptr=(gpointer)0xdeadbeef;") == 0,
>+      "Failed to serialize to right string: %s", str);

I'm not sure if we can assume that g_string_append_printf() will yield the
exact same string on every system. Unless we know it will always end up in an
internal glib printf implementation and never a system printf. e.g. it could be
0xDEADBEEF on some systems, or maybe an extra prefix or so. I don't know if the
C standard specifies exactly how this must be printed - did you check?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list