From b1ea5f952fbb441b0df5c6eca2cdaf9572276391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 18 May 2008 11:52:39 +0000 Subject: [PATCH] tests/check/gst/gstcaps.c: Add David's and Benjamin's tests for array subtraction to the unit test suite, which sugge... Original commit message from CVS: * tests/check/gst/gstcaps.c: (test_intersect2), (gst_caps_suite): Add David's and Benjamin's tests for array subtraction to the unit test suite, which suggests that #147931 is fixed these days. --- ChangeLog | 6 ++++++ tests/check/gst/gstcaps.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/ChangeLog b/ChangeLog index ce9025fa48..3dc67deb1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-18 Tim-Philipp Müller + + * tests/check/gst/gstcaps.c: (test_intersect2), (gst_caps_suite): + Add David's and Benjamin's tests for array subtraction to the + unit test suite, which suggests that #147931 is fixed these days. + 2008-05-18 Tim-Philipp Müller * gst/gstevent.c: diff --git a/tests/check/gst/gstcaps.c b/tests/check/gst/gstcaps.c index dddc10865b..1ae25687e9 100644 --- a/tests/check/gst/gstcaps.c +++ b/tests/check/gst/gstcaps.c @@ -580,6 +580,43 @@ GST_START_TEST (test_intersect) GST_END_TEST; +GST_START_TEST (test_intersect2) +{ + GstCaps *caps1, *caps2, *icaps; + + /* tests array subtraction */ + caps1 = gst_caps_from_string ("audio/x-raw-float, " + "channel-positions=(int)< " + "{ 1, 2, 3, 4, 5, 6 }, " + "{ 1, 2, 3, 4, 5, 6 }, " + "{ 1, 2, 3, 4, 5, 6 }, " + "{ 1, 2, 3, 4, 5, 6 }, " + "{ 1, 2, 3, 4, 5, 6 }, " "{ 1, 2, 3, 4, 5, 6 }>"); + caps2 = gst_caps_from_string ("audio/x-raw-float, " + "channel-positions=(int)< 1, 2, 3, 4, 5, 6 >"); + icaps = gst_caps_intersect (caps1, caps2); + GST_LOG ("intersected caps: %" GST_PTR_FORMAT, icaps); + fail_if (gst_caps_is_empty (icaps)); + fail_unless (gst_caps_is_equal (icaps, caps2)); + gst_caps_unref (caps1); + gst_caps_unref (caps2); + gst_caps_unref (icaps); + + /* ===== */ + + caps1 = gst_caps_from_string ("some/type, foo=(int)< { 1, 2 }, { 3, 4} >"); + caps2 = gst_caps_from_string ("some/type, foo=(int)< 1, 3 >"); + icaps = gst_caps_intersect (caps1, caps2); + GST_LOG ("intersected caps: %" GST_PTR_FORMAT, icaps); + fail_if (gst_caps_is_empty (icaps)); + fail_unless (gst_caps_is_equal (icaps, caps2)); + gst_caps_unref (caps1); + gst_caps_unref (caps2); + gst_caps_unref (icaps); +} + +GST_END_TEST; + static Suite * gst_caps_suite (void) { @@ -598,6 +635,7 @@ gst_caps_suite (void) tcase_add_test (tc_chain, test_merge_same); tcase_add_test (tc_chain, test_merge_subset); tcase_add_test (tc_chain, test_intersect); + tcase_add_test (tc_chain, test_intersect2); return s; }