tests: enhance the gstcaps test_features to also test gst_caps_set_features()
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Thu, 26 Jun 2014 08:58:04 +0000 (11:58 +0300)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Thu, 26 Jun 2014 08:58:04 +0000 (11:58 +0300)
Compliments my previous patch for gst_caps_set_features, which would
previously assert and leak the old GstCapsFeatures if the caps already
had a GstCapsFeatures and you were trying to replace it with a new one.

tests/check/gst/gstcaps.c

index b1a1352..e529406 100644 (file)
@@ -1129,6 +1129,13 @@ GST_START_TEST (test_features)
 
   gst_caps_unref (c2);
   gst_caps_unref (c1);
+
+  c1 = gst_caps_from_string ("video/x-raw");
+  f1 = gst_caps_get_features (c1, 0);
+  f2 = gst_caps_features_new ("memory:dmabuf", NULL);
+  gst_caps_set_features (c1, 0, f2);
+
+  gst_caps_unref (c1);
 }
 
 GST_END_TEST;