summaryrefslogtreecommitdiff
path: root/tests/check/gst/gstcaps.c
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2011-03-07 23:13:56 +0200
committerStefan Kost <ensonic@users.sf.net>2011-03-08 23:01:15 +0200
commite66ae6681a534a2a4dde7b860bdac3b76bb8f6ca (patch)
tree6c1592e599a27cb5b914afe6dff6d68bc10b83a2 /tests/check/gst/gstcaps.c
parent7c98ae2b98c75d2eb27829e75a65aa8913e6777d (diff)
tests: add a unit test for gst_caps_new_simple
Add a test for the crash in bug #642271.
Diffstat (limited to 'tests/check/gst/gstcaps.c')
-rw-r--r--tests/check/gst/gstcaps.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/check/gst/gstcaps.c b/tests/check/gst/gstcaps.c
index 6fb35e1ea..d1bbe4bed 100644
--- a/tests/check/gst/gstcaps.c
+++ b/tests/check/gst/gstcaps.c
@@ -795,6 +795,26 @@ GST_START_TEST (test_normalize)
GST_END_TEST;
+GST_START_TEST (test_broken)
+{
+ GstCaps *c1;
+
+ /* NULL is not valid for media_type */
+ ASSERT_CRITICAL (c1 =
+ gst_caps_new_simple (NULL, "field", G_TYPE_INT, 1, NULL));
+ fail_if (c1);
+
+#ifndef G_DISABLE_CHECKS
+ /* such a name is not valid, see gst_structure_validate_name() */
+ ASSERT_CRITICAL (c1 =
+ gst_caps_new_simple ("1#@abc", "field", G_TYPE_INT, 1, NULL));
+ fail_if (c1);
+#endif
+}
+
+GST_END_TEST;
+
+
static Suite *
gst_caps_suite (void)
{
@@ -815,6 +835,7 @@ gst_caps_suite (void)
tcase_add_test (tc_chain, test_intersect);
tcase_add_test (tc_chain, test_intersect2);
tcase_add_test (tc_chain, test_normalize);
+ tcase_add_test (tc_chain, test_broken);
return s;
}