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.
This commit is contained in:
Tim-Philipp Müller 2008-05-18 11:52:39 +00:00
parent 9ac2434c1a
commit b1ea5f952f
2 changed files with 44 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-05-18 Tim-Philipp Müller <tim.muller at collabora co uk>
* 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 <tim.muller at collabora co uk>
* gst/gstevent.c:

View file

@ -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;
}