Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo MAILLART <tmaillart@gmail.com>2021-01-11 01:37:21 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-08-20 04:41:30 +0300
commitadc565ff4a10441412cd41c835d1d3b05b31f2ab (patch)
treebcc0eada91de8eb794a9cd76ea37d036fd0286b1
parentaadf84837b2c0397b02ffb39f704ef4649482a44 (diff)
tests: elementfactory: add element creation tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/736>
-rw-r--r--tests/check/gst/gstelementfactory.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/check/gst/gstelementfactory.c b/tests/check/gst/gstelementfactory.c
index 7a7cca92e7..7d722470c6 100644
--- a/tests/check/gst/gstelementfactory.c
+++ b/tests/check/gst/gstelementfactory.c
@@ -77,6 +77,35 @@ GST_START_TEST (test_create)
GST_END_TEST;
+/* test element creation */
+GST_START_TEST (test_element_factory)
+{
+ GstElement *e, *e_name, *e_prop;
+ const gchar name[] = "source";
+ const int nb = 10;
+ const gboolean do_ts = TRUE;
+ int num_buffers = nb;
+ gboolean do_timestamp = do_ts;
+
+ e = gst_element_factory_make ("fakesrc", NULL);
+ fail_if (e == NULL);
+
+ e_name = gst_element_factory_make ("fakesrc", name);
+ fail_if (e_name == NULL || g_strcmp0 (name, GST_OBJECT_NAME (e_name)) != 0);
+
+ e_prop = gst_element_factory_make_full ("fakesrc",
+ "num-buffers", nb, "do-timestamp", do_ts, NULL);
+ g_object_get (e_prop,
+ "num_buffers", &num_buffers, "do-timestamp", &do_timestamp, NULL);
+ fail_if (e_prop == NULL || num_buffers != nb || do_timestamp != do_ts);
+
+ gst_object_unref (e);
+ gst_object_unref (e_name);
+ gst_object_unref (e_prop);
+}
+
+GST_END_TEST;
+
/* test if the factory can accept some caps */
GST_START_TEST (test_can_sink_any_caps)
{
@@ -174,6 +203,7 @@ gst_element_factory_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_class);
tcase_add_test (tc_chain, test_create);
+ tcase_add_test (tc_chain, test_element_factory);
tcase_add_test (tc_chain, test_can_sink_any_caps);
tcase_add_test (tc_chain, test_can_sink_all_caps);