diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-22 18:13:34 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-22 18:13:34 +0100 |
commit | 0b72df8e58c07cf364c6d81a32077771efdcdebd (patch) | |
tree | 5c1aab344f281f096dedda87f3f32a39553cb25a /tests | |
parent | d528759e03c7b2092acae3b2bc5d79289da86161 (diff) |
Imported Upstream version 1.0.6upstream/1.0.6
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/adder.c | 51 | ||||
-rw-r--r-- | tests/check/libs/libsabi.c | 4 |
2 files changed, 53 insertions, 2 deletions
diff --git a/tests/check/elements/adder.c b/tests/check/elements/adder.c index 1e9c226..19b83e7 100644 --- a/tests/check/elements/adder.c +++ b/tests/check/elements/adder.c @@ -76,6 +76,56 @@ GST_START_TEST (test_caps) GST_END_TEST; +/* check that caps set on the property are honoured */ +GST_START_TEST (test_filter_caps) +{ + GstElement *pipeline, *src, *adder, *sink; + GstStateChangeReturn state_res; + GstCaps *filter_caps, *caps; + GstPad *pad; + + filter_caps = gst_caps_new_simple ("audio/x-raw", + "format", G_TYPE_STRING, "F32LE", + "layout", G_TYPE_STRING, "interleaved", + "rate", G_TYPE_INT, 44100, "channels", G_TYPE_INT, 1, NULL); + + /* build pipeline */ + pipeline = gst_pipeline_new ("pipeline"); + + src = gst_element_factory_make ("audiotestsrc", NULL); + g_object_set (src, "wave", 4, NULL); /* silence */ + adder = gst_element_factory_make ("adder", NULL); + g_object_set (adder, "caps", filter_caps, NULL); + sink = gst_element_factory_make ("fakesink", "sink"); + gst_bin_add_many (GST_BIN (pipeline), src, adder, sink, NULL); + + fail_unless (gst_element_link_many (src, adder, sink, NULL)); + + /* prepare playing */ + state_res = gst_element_set_state (pipeline, GST_STATE_PAUSED); + fail_unless_equals_int (state_res, GST_STATE_CHANGE_ASYNC); + + /* wait for preroll */ + state_res = gst_element_get_state (pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); + fail_unless_equals_int (state_res, GST_STATE_CHANGE_SUCCESS); + + /* check caps on fakesink */ + pad = gst_element_get_static_pad (sink, "sink"); + caps = gst_pad_get_current_caps (pad); + fail_unless (caps != NULL); + GST_INFO_OBJECT (pipeline, "received caps: %" GST_PTR_FORMAT, caps); + fail_unless (gst_caps_is_equal_fixed (caps, filter_caps)); + gst_caps_unref (caps); + gst_object_unref (pad); + + gst_element_set_state (pipeline, GST_STATE_NULL); + gst_object_unref (pipeline); + + gst_caps_unref (filter_caps); +} + +GST_END_TEST; + static void message_received (GstBus * bus, GstMessage * message, GstPipeline * bin) { @@ -1028,6 +1078,7 @@ adder_suite (void) suite_add_tcase (s, tc_chain); tcase_add_test (tc_chain, test_caps); + tcase_add_test (tc_chain, test_filter_caps); tcase_add_test (tc_chain, test_event); tcase_add_test (tc_chain, test_play_twice); tcase_add_test (tc_chain, test_play_twice_then_add_and_play_again); diff --git a/tests/check/libs/libsabi.c b/tests/check/libs/libsabi.c index 421f72e..34fac67 100644 --- a/tests/check/libs/libsabi.c +++ b/tests/check/libs/libsabi.c @@ -77,7 +77,7 @@ #ifdef HAVE_CPU_I386 # ifdef __APPLE__ # include "struct_i386_osx.h" -# define HAVE_ABI_SIZES TRUE +# define HAVE_ABI_SIZES FALSE # else # include "struct_i386.h" # define HAVE_ABI_SIZES TRUE @@ -89,7 +89,7 @@ #else #ifdef HAVE_CPU_ARM #include "struct_arm.h" -#define HAVE_ABI_SIZES TRUE +#define HAVE_ABI_SIZES FALSE #else #ifdef __powerpc__ #include "struct_ppc32.h" |