GstStructure *structure1 = GST_STRUCTURE (g_value_get_boxed (value1));
GstStructure *structure2 = GST_STRUCTURE (g_value_get_boxed (value2));
+ if (structure1 == structure2)
+ return GST_VALUE_EQUAL;
+
+ if (!structure1 || !structure2)
+ return GST_VALUE_UNORDERED;
+
if (gst_structure_is_equal (structure1, structure2))
return GST_VALUE_EQUAL;
fail_unless (gst_value_compare (&value1, &value1) == GST_VALUE_EQUAL);
g_value_unset (&value1);
g_value_unset (&value2);
+
+ /* Check that we can compare structure */
+ {
+ GstStructure *s = gst_structure_new_empty ("test");
+
+ g_value_init (&value1, GST_TYPE_STRUCTURE);
+ g_value_init (&value2, GST_TYPE_STRUCTURE);
+ fail_unless (gst_value_compare (&value1, &value2) == GST_VALUE_EQUAL);
+
+ gst_value_set_structure (&value1, s);
+ fail_unless (gst_value_compare (&value1, &value2) == GST_VALUE_UNORDERED);
+ gst_value_set_structure (&value2, s);
+ fail_unless (gst_value_compare (&value1, &value2) == GST_VALUE_EQUAL);
+ g_value_unset (&value1);
+ g_value_unset (&value2);
+ gst_structure_free (s);
+ }
}
GST_END_TEST;