tests: add caps features unit tests
authorMatthieu Bouron <matthieu.bouron@collabora.com>
Wed, 29 Jan 2014 14:39:19 +0000 (14:39 +0000)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 4 Feb 2014 17:47:23 +0000 (18:47 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=723236

tests/check/gst/gstcaps.c

index 4d26462..9214097 100644 (file)
@@ -1114,6 +1114,21 @@ GST_START_TEST (test_features)
   gst_caps_unref (c3);
   gst_caps_unref (c2);
   gst_caps_unref (c1);
+
+  c1 = gst_caps_from_string ("video/x-raw");
+  c2 = gst_caps_from_string ("video/x-raw");
+
+  f1 = gst_caps_get_features (c1, 0);
+  gst_caps_features_add (f1, "memory:VASurface");
+
+  fail_unless (gst_caps_features_is_equal (f1, gst_caps_get_features (c1, 0)));
+
+  f2 = gst_caps_get_features (c2, 0);
+  fail_unless (gst_caps_features_is_equal
+      (GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY, f2));
+
+  gst_caps_unref (c2);
+  gst_caps_unref (c1);
 }
 
 GST_END_TEST;