From 39b69d27da2649740709433b24b8f41b52b20e53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 22 Jun 2014 12:52:01 +0100 Subject: [PATCH] tests: add unit test for gst_caps_is_any() and _is_empty() https://bugzilla.gnome.org//show_bug.cgi?id=731704 --- tests/check/gst/gstcaps.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/check/gst/gstcaps.c b/tests/check/gst/gstcaps.c index 9214097..b1a1352 100644 --- a/tests/check/gst/gstcaps.c +++ b/tests/check/gst/gstcaps.c @@ -1133,6 +1133,26 @@ GST_START_TEST (test_features) GST_END_TEST; +GST_START_TEST (test_special_caps) +{ + GstCaps *caps; + + caps = gst_caps_new_any (); + fail_unless (gst_caps_is_any (caps)); + fail_unless (gst_caps_is_any (caps) == TRUE); + fail_if (gst_caps_is_empty (caps)); + fail_unless (gst_caps_is_empty (caps) == FALSE); + gst_caps_unref (caps); + + caps = gst_caps_new_empty (); + fail_if (gst_caps_is_any (caps)); + fail_unless (gst_caps_is_any (caps) == FALSE); + fail_unless (gst_caps_is_empty (caps)); + fail_unless (gst_caps_is_empty (caps) == TRUE); + gst_caps_unref (caps); +} + +GST_END_TEST; static Suite * gst_caps_suite (void) { @@ -1161,6 +1181,7 @@ gst_caps_suite (void) tcase_add_test (tc_chain, test_normalize); tcase_add_test (tc_chain, test_broken); tcase_add_test (tc_chain, test_features); + tcase_add_test (tc_chain, test_special_caps); return s; } -- 2.7.4