From: <tho...@ke...> - 2006-07-02 12:54:28
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: thomasvs Date: Sun Jul 02 2006 12:54:15 UTC Log message: * 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 Modified files: . : ChangeLog gst : gstcaps.c tests/check/gst : gstbuffer.c gstcaps.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.2630&r2=1.2631 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstcaps.c.diff?r1=1.165&r2=1.166 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/tests/check/gst/gstbuffer.c.diff?r1=1.13&r2=1.14 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/tests/check/gst/gstcaps.c.diff?r1=1.14&r2=1.15 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.2630 retrieving revision 1.2631 diff -u -d -r1.2630 -r1.2631 --- ChangeLog 2 Jul 2006 09:04:45 -0000 1.2630 +++ ChangeLog 2 Jul 2006 12:54:03 -0000 1.2631 @@ -1,5 +1,13 @@ 2006-07-02 Thomas Vander Stichele <thomas at apestaart dot org> + * 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 <thomas at apestaart dot org> * libs/gst/dataprotocol/Makefile.am: build dataprotocol test by linking to the lib, instead of compiling the source, so we get coverage Index: gstcaps.c RCS file: /cvs/gstreamer/gstreamer/gst/gstcaps.c,v retrieving revision 1.165 retrieving revision 1.166 diff -u -d -r1.165 -r1.166 --- gstcaps.c 22 Jun 2006 13:51:19 -0000 1.165 +++ gstcaps.c 2 Jul 2006 12:54:03 -0000 1.166 @@ -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); * </programlisting> * </example> @@ -875,9 +875,9 @@ * <note>This function does not work reliably if optional properties for caps * are included on one caps and omitted on the other.</note> - * 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 @@ 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)); Index: gstbuffer.c RCS file: /cvs/gstreamer/gstreamer/tests/check/gst/gstbuffer.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- gstbuffer.c 1 Jul 2006 20:56:55 -0000 1.13 +++ gstbuffer.c 2 Jul 2006 12:54:03 -0000 1.14 @@ -39,6 +39,10 @@ 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); RCS file: /cvs/gstreamer/gstreamer/tests/check/gst/gstcaps.c,v retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstcaps.c 1 Jul 2006 20:56:55 -0000 1.14 +++ gstcaps.c 2 Jul 2006 12:54:03 -0000 1.15 @@ -22,6 +22,7 @@ #include <gst/check/gstcheck.h> +#include <gst/gstcaps.h> #include "capslist.h" GST_START_TEST (test_from_string) @@ -197,12 +198,16 @@ { 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_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_END_TEST; Suite * gst_caps_suite (void) @@ -345,6 +366,7 @@ 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; } |