gst/gstcaps.c: whitespace fixes

Original commit message from CVS:
* 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
This commit is contained in:
Thomas Vander Stichele 2006-07-02 12:54:03 +00:00
parent 50dc8ab313
commit 5d47eca524
4 changed files with 42 additions and 8 deletions

View file

@ -1,3 +1,11 @@
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> 2006-07-02 Thomas Vander Stichele <thomas at apestaart dot org>
* libs/gst/dataprotocol/Makefile.am: * libs/gst/dataprotocol/Makefile.am:

View file

@ -1309,7 +1309,7 @@ gst_caps_compare_structures (gconstpointer one, gconstpointer two)
const GstStructure *struct1 = *((const GstStructure **) one); const GstStructure *struct1 = *((const GstStructure **) one);
const GstStructure *struct2 = *((const GstStructure **) two); 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? */ So what's the best way? */
ret = strcmp (gst_structure_get_name (struct1), ret = strcmp (gst_structure_get_name (struct1),
gst_structure_get_name (struct2)); gst_structure_get_name (struct2));

View file

@ -39,6 +39,10 @@ GST_START_TEST (test_caps)
fail_unless (GST_BUFFER_CAPS (buffer) == caps); fail_unless (GST_BUFFER_CAPS (buffer) == caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 2); 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"); caps2 = gst_caps_from_string ("audio/x-raw-float");
ASSERT_CAPS_REFCOUNT (caps2, "caps2", 1); ASSERT_CAPS_REFCOUNT (caps2, "caps2", 1);

View file

@ -22,6 +22,7 @@
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
#include <gst/gstcaps.h>
#include "capslist.h" #include "capslist.h"
GST_START_TEST (test_from_string) GST_START_TEST (test_from_string)
@ -197,12 +198,16 @@ GST_START_TEST (test_simplify)
{ {
GstStructure *s1, *s2; GstStructure *s1, *s2;
gboolean did_simplify; gboolean did_simplify;
GstCaps *caps; GstCaps *caps, *simplecaps;
caps = gst_caps_from_string (non_simple_caps_string); caps = gst_caps_from_string (non_simple_caps_string);
fail_unless (caps != NULL, fail_unless (caps != NULL,
"gst_caps_from_string (non_simple_caps_string) failed"); "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); did_simplify = gst_caps_do_simplify (caps);
fail_unless (did_simplify == TRUE, fail_unless (did_simplify == TRUE,
"gst_caps_do_simplify() should have worked"); "gst_caps_do_simplify() should have worked");
@ -332,6 +337,22 @@ GST_START_TEST (test_simplify)
GST_END_TEST; 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 * Suite *
gst_caps_suite (void) 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_buffer);
tcase_add_test (tc_chain, test_static_caps); tcase_add_test (tc_chain, test_static_caps);
tcase_add_test (tc_chain, test_simplify); tcase_add_test (tc_chain, test_simplify);
tcase_add_test (tc_chain, test_truncate);
return s; return s;
} }