diff --git a/ChangeLog b/ChangeLog index ea0a715715..e7bbb9d9d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-07-02 Thomas Vander Stichele + + * gst/gstcaps.c: (gst_caps_compare_structures): + whitespace fixes + * tests/check/gst/gstbuffer.c: (GST_START_TEST): + * tests/check/gst/gstcaps.c: (GST_START_TEST), (gst_caps_suite): + add more tests + 2006-07-02 Thomas Vander Stichele * libs/gst/dataprotocol/Makefile.am: diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 2298cd90cb..bebde264af 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -29,8 +29,8 @@ * given pad can handle. They are also stored in the registry along with * a description of the element. * - * Caps are exposed on the element pads using the gst_pad_get_caps() pad - * function. This function describes the possible types that the pad can + * Caps are exposed on the element pads using the gst_pad_get_caps() pad + * function. This function describes the possible types that the pad can * handle or produce at runtime. * * Caps are also attached to buffers to describe to content of the data @@ -47,8 +47,8 @@ * "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), * "framerate", G_TYPE_DOUBLE, 25.0, * "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, - * "width", G_TYPE_INT, 320, - * "height", G_TYPE_INT, 240, + * "width", G_TYPE_INT, 320, + * "height", G_TYPE_INT, 240, * NULL); * * @@ -875,9 +875,9 @@ gst_caps_is_subset (const GstCaps * subset, const GstCaps * superset) * This function does not work reliably if optional properties for caps * are included on one caps and omitted on the other. * - * This function deals correctly with passing NULL for any of the caps. + * This function deals correctly with passing NULL for any of the caps. * - * Returns: TRUE if both caps are equal. + * Returns: TRUE if both caps are equal. */ gboolean gst_caps_is_equal (const GstCaps * caps1, const GstCaps * caps2) @@ -1309,7 +1309,7 @@ gst_caps_compare_structures (gconstpointer one, gconstpointer two) const GstStructure *struct1 = *((const GstStructure **) one); const GstStructure *struct2 = *((const GstStructure **) two); - /* FIXME: this orders aphabetically, but ordering the quarks might be faster + /* FIXME: this orders alphabetically, but ordering the quarks might be faster So what's the best way? */ ret = strcmp (gst_structure_get_name (struct1), gst_structure_get_name (struct2)); diff --git a/tests/check/gst/gstbuffer.c b/tests/check/gst/gstbuffer.c index 20c0fb89bf..dcf321e26b 100644 --- a/tests/check/gst/gstbuffer.c +++ b/tests/check/gst/gstbuffer.c @@ -39,6 +39,10 @@ GST_START_TEST (test_caps) fail_unless (GST_BUFFER_CAPS (buffer) == caps); ASSERT_CAPS_REFCOUNT (caps, "caps", 2); + fail_unless (gst_buffer_get_caps (buffer) == caps); + gst_caps_unref (caps); + ASSERT_CAPS_REFCOUNT (caps, "caps", 2); + caps2 = gst_caps_from_string ("audio/x-raw-float"); ASSERT_CAPS_REFCOUNT (caps2, "caps2", 1); diff --git a/tests/check/gst/gstcaps.c b/tests/check/gst/gstcaps.c index 8bb73db178..fa33d4bff9 100644 --- a/tests/check/gst/gstcaps.c +++ b/tests/check/gst/gstcaps.c @@ -22,6 +22,7 @@ #include +#include #include "capslist.h" GST_START_TEST (test_from_string) @@ -197,12 +198,16 @@ GST_START_TEST (test_simplify) { GstStructure *s1, *s2; gboolean did_simplify; - GstCaps *caps; + GstCaps *caps, *simplecaps; caps = gst_caps_from_string (non_simple_caps_string); fail_unless (caps != NULL, "gst_caps_from_string (non_simple_caps_string) failed"); + /* first get a new copy of simplified caps */ + simplecaps = gst_caps_simplify (caps); + fail_unless (simplecaps != NULL, "simplifying caps failed"); + did_simplify = gst_caps_do_simplify (caps); fail_unless (did_simplify == TRUE, "gst_caps_do_simplify() should have worked"); @@ -332,6 +337,22 @@ GST_START_TEST (test_simplify) GST_END_TEST; +GST_START_TEST (test_truncate) +{ + GstCaps *caps; + + caps = gst_caps_from_string (non_simple_caps_string); + fail_unless (caps != NULL, + "gst_caps_from_string (non_simple_caps_string) failed"); + fail_unless_equals_int (gst_caps_get_size (caps), 4); + gst_caps_truncate (caps); + fail_unless_equals_int (gst_caps_get_size (caps), 1); + gst_caps_unref (caps); +} + +GST_END_TEST; + + Suite * gst_caps_suite (void) { @@ -345,6 +366,7 @@ gst_caps_suite (void) tcase_add_test (tc_chain, test_buffer); tcase_add_test (tc_chain, test_static_caps); tcase_add_test (tc_chain, test_simplify); + tcase_add_test (tc_chain, test_truncate); return s; }