summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2011-04-16 08:59:58 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-04-16 08:59:58 +0200
commitf51a23a83c4118444cf3425acac4755e1bab34f1 (patch)
treec91f96a5eaaa694909f20e43f972a1ed03cb0960 /tests
parent62329c606aa253206933d217641b0f72fe4171c3 (diff)
parent8839c513f7fd1f5987c60e78aee177973ae3b77e (diff)
Merge branch 'master' into 0.11
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/multiqueue.c10
-rw-r--r--tests/check/elements/queue2.c4
-rw-r--r--tests/check/gst/gstbin.c17
-rw-r--r--tests/check/gst/gstutils.c23
-rw-r--r--tests/check/gst/gstvalue.c2
-rw-r--r--tests/check/libs/test_transform.c2
-rw-r--r--tests/check/pipelines/parse-launch.c14
7 files changed, 57 insertions, 15 deletions
diff --git a/tests/check/elements/multiqueue.c b/tests/check/elements/multiqueue.c
index 59c4bb4bb..efcf048c6 100644
--- a/tests/check/elements/multiqueue.c
+++ b/tests/check/elements/multiqueue.c
@@ -93,7 +93,7 @@ setup_multiqueue (GstElement * pipe, GstElement * inputs[],
GST_START_TEST (test_simple_pipeline)
{
- GstElement *pipe, *mq;
+ GstElement *pipe;
GstElement *inputs[1];
GstElement *outputs[1];
GstMessage *msg;
@@ -107,7 +107,7 @@ GST_START_TEST (test_simple_pipeline)
outputs[0] = gst_element_factory_make ("fakesink", NULL);
fail_unless (outputs[0] != NULL, "failed to create 'fakesink' element");
- mq = setup_multiqueue (pipe, inputs, outputs, 1);
+ setup_multiqueue (pipe, inputs, outputs, 1);
gst_element_set_state (pipe, GST_STATE_PLAYING);
@@ -128,7 +128,7 @@ GST_END_TEST;
GST_START_TEST (test_simple_shutdown_while_running)
{
- GstElement *pipe, *mq;
+ GstElement *pipe;
GstElement *inputs[1];
GstElement *outputs[1];
GstMessage *msg;
@@ -141,7 +141,7 @@ GST_START_TEST (test_simple_shutdown_while_running)
outputs[0] = gst_element_factory_make ("fakesink", NULL);
fail_unless (outputs[0] != NULL, "failed to create 'fakesink' element");
- mq = setup_multiqueue (pipe, inputs, outputs, 1);
+ setup_multiqueue (pipe, inputs, outputs, 1);
gst_element_set_state (pipe, GST_STATE_PAUSED);
@@ -282,6 +282,8 @@ GST_START_TEST (test_request_pads_named)
GST_LOG ("Cleaning up");
gst_object_unref (sink1);
gst_object_unref (sink2);
+ gst_object_unref (sink3);
+ gst_object_unref (sink4);
gst_object_unref (mq);
}
diff --git a/tests/check/elements/queue2.c b/tests/check/elements/queue2.c
index f226e0e7f..f74b3ea4e 100644
--- a/tests/check/elements/queue2.c
+++ b/tests/check/elements/queue2.c
@@ -59,7 +59,7 @@ setup_queue2 (GstElement * pipe, GstElement * input, GstElement * output)
GST_START_TEST (test_simple_pipeline)
{
- GstElement *pipe, *queue2, *input, *output;
+ GstElement *pipe, *input, *output;
GstMessage *msg;
pipe = gst_pipeline_new ("pipeline");
@@ -71,7 +71,7 @@ GST_START_TEST (test_simple_pipeline)
output = gst_element_factory_make ("fakesink", NULL);
fail_unless (output != NULL, "failed to create 'fakesink' element");
- queue2 = setup_queue2 (pipe, input, output);
+ setup_queue2 (pipe, input, output);
gst_element_set_state (pipe, GST_STATE_PLAYING);
diff --git a/tests/check/gst/gstbin.c b/tests/check/gst/gstbin.c
index ea942a9b9..3adfd9fb8 100644
--- a/tests/check/gst/gstbin.c
+++ b/tests/check/gst/gstbin.c
@@ -1137,11 +1137,15 @@ GST_START_TEST (test_many_bins)
fail_unless (gst_element_link (last_bin, sink));
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
- fail_unless (ret == GST_STATE_CHANGE_ASYNC, "did not get state change async");
+ fail_unless_equals_int (ret, GST_STATE_CHANGE_ASYNC);
- ret = gst_element_get_state (pipeline, NULL, NULL, 5 * GST_SECOND);
- fail_unless (ret == GST_STATE_CHANGE_SUCCESS,
- "did not get state change success");
+ for (i = 0; i < 15; ++i) {
+ GST_INFO ("waiting for preroll ...");
+ ret = gst_element_get_state (pipeline, NULL, NULL, GST_SECOND);
+ if (ret != GST_STATE_CHANGE_ASYNC)
+ break;
+ }
+ fail_unless_equals_int (ret, GST_STATE_CHANGE_SUCCESS);
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
@@ -1172,7 +1176,10 @@ gst_bin_suite (void)
tcase_add_test (tc_chain, test_iterate_sorted);
tcase_add_test (tc_chain, test_link_structure_change);
tcase_add_test (tc_chain, test_state_failure_remove);
- tcase_add_test (tc_chain, test_many_bins);
+
+ /* fails on OSX build bot for some reason, and is a bit silly anyway */
+ if (0)
+ tcase_add_test (tc_chain, test_many_bins);
return s;
}
diff --git a/tests/check/gst/gstutils.c b/tests/check/gst/gstutils.c
index 6bcc40003..b4d97399c 100644
--- a/tests/check/gst/gstutils.c
+++ b/tests/check/gst/gstutils.c
@@ -1031,6 +1031,28 @@ GST_START_TEST (test_pad_proxy_getcaps_aggregation)
GST_END_TEST;
+GST_START_TEST (test_greatest_common_divisor)
+{
+ fail_if (gst_util_greatest_common_divisor (1, 1) != 1);
+ fail_if (gst_util_greatest_common_divisor (2, 3) != 1);
+ fail_if (gst_util_greatest_common_divisor (3, 5) != 1);
+ fail_if (gst_util_greatest_common_divisor (-1, 1) != 1);
+ fail_if (gst_util_greatest_common_divisor (-2, 3) != 1);
+ fail_if (gst_util_greatest_common_divisor (-3, 5) != 1);
+ fail_if (gst_util_greatest_common_divisor (-1, -1) != 1);
+ fail_if (gst_util_greatest_common_divisor (-2, -3) != 1);
+ fail_if (gst_util_greatest_common_divisor (-3, -5) != 1);
+ fail_if (gst_util_greatest_common_divisor (1, -1) != 1);
+ fail_if (gst_util_greatest_common_divisor (2, -3) != 1);
+ fail_if (gst_util_greatest_common_divisor (3, -5) != 1);
+ fail_if (gst_util_greatest_common_divisor (2, 2) != 2);
+ fail_if (gst_util_greatest_common_divisor (2, 4) != 2);
+ fail_if (gst_util_greatest_common_divisor (1001, 11) != 11);
+
+}
+
+GST_END_TEST;
+
static Suite *
gst_utils_suite (void)
{
@@ -1063,6 +1085,7 @@ gst_utils_suite (void)
tcase_add_test (tc_chain, test_binary_search);
tcase_add_test (tc_chain, test_pad_proxy_getcaps_aggregation);
+ tcase_add_test (tc_chain, test_greatest_common_divisor);
return s;
}
diff --git a/tests/check/gst/gstvalue.c b/tests/check/gst/gstvalue.c
index d407d6342..2e5540cc5 100644
--- a/tests/check/gst/gstvalue.c
+++ b/tests/check/gst/gstvalue.c
@@ -624,7 +624,6 @@ GST_START_TEST (test_deserialize_string)
};
guint i;
GValue v = { 0, };
- gboolean ret = TRUE;
g_value_init (&v, G_TYPE_STRING);
for (i = 0; i < G_N_ELEMENTS (tests); i++) {
@@ -635,7 +634,6 @@ GST_START_TEST (test_deserialize_string)
"\nwanted: %s\ngot : %s", tests[i].to, g_value_get_string (&v));
} else {
fail_if (tests[i].to != NULL, "failed, but wanted: %s", tests[i].to);
- ret = FALSE;
}
}
g_value_unset (&v);
diff --git a/tests/check/libs/test_transform.c b/tests/check/libs/test_transform.c
index 7cca241e3..b0e611001 100644
--- a/tests/check/libs/test_transform.c
+++ b/tests/check/libs/test_transform.c
@@ -95,10 +95,8 @@ gst_test_trans_base_init (gpointer g_class)
static void
gst_test_trans_class_init (GstTestTransClass * klass)
{
- GObjectClass *gobject_class;
GstBaseTransformClass *trans_class;
- gobject_class = (GObjectClass *) klass;
trans_class = (GstBaseTransformClass *) klass;
trans_class->passthrough_on_same_caps = klass_passthrough_on_same_caps;
diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c
index 0f02b67cd..3c7fdf9f6 100644
--- a/tests/check/pipelines/parse-launch.c
+++ b/tests/check/pipelines/parse-launch.c
@@ -99,6 +99,8 @@ static const gchar *test_lines[] = {
"fakesrc ! video/raw, format=(fourcc)YUY2; video/raw, format=(fourcc)YV12 ! fakesink silent=true",
"fakesrc ! audio/x-raw-int, width=[16, 32], depth={16, 24, 32}, signed=TRUE ! fakesink silent=true",
"fakesrc ! identity silent=true ! identity silent=true ! identity silent=true ! fakesink silent=true",
+ "fakesrc name=100 fakesink name=101 silent=true 100. ! 101.",
+ "fakesrc ! 1dentity ! fakesink silent=true",
NULL
};
@@ -106,6 +108,18 @@ GST_START_TEST (test_launch_lines)
{
GstElement *pipeline;
const gchar **s;
+ GType type;
+ GstElementFactory *efac;
+
+ efac = gst_element_factory_find ("identity");
+ fail_unless (efac != NULL);
+ efac =
+ GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE (efac)));
+ fail_unless (efac != NULL);
+ type = gst_element_factory_get_element_type (efac);
+ fail_unless (type != 0);
+ g_object_unref (efac);
+ fail_unless (gst_element_register (NULL, "1dentity", GST_RANK_NONE, type));
for (s = test_lines; *s != NULL; s++) {
pipeline = setup_pipeline (*s);