3 * unit test for the controller library
5 * Copyright (C) <2005> Stefan Kost <ensonic at users dot sf dor net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
27 #include <gst/check/gstcheck.h>
28 #include <gst/controller/gstcontroller.h>
30 /* LOCAL TEST ELEMENT */
44 #define GST_TYPE_TEST_MONO_SOURCE (gst_test_mono_source_get_type ())
45 #define GST_TEST_MONO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TEST_MONO_SOURCE, GstTestMonoSource))
46 #define GST_TEST_MONO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TEST_MONO_SOURCE, GstTestMonoSourceClass))
47 #define GST_IS_TEST_MONO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TEST_MONO_SOURCE))
48 #define GST_IS_TEST_MONO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TEST_MONO_SOURCE))
49 #define GST_TEST_MONO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_TEST_MONO_SOURCE, GstTestMonoSourceClass))
51 typedef struct _GstTestMonoSource GstTestMonoSource;
52 typedef struct _GstTestMonoSourceClass GstTestMonoSourceClass;
54 struct _GstTestMonoSource
62 struct _GstTestMonoSourceClass
64 GstElementClass parent_class;
67 GType gst_test_mono_source_get_type (void);
70 gst_test_mono_source_get_property (GObject * object,
71 guint property_id, GValue * value, GParamSpec * pspec)
73 GstTestMonoSource *self = GST_TEST_MONO_SOURCE (object);
75 switch (property_id) {
77 g_value_set_ulong (value, self->val_ulong);
80 g_value_set_float (value, self->val_float);
83 g_value_set_double (value, self->val_double);
86 g_value_set_boolean (value, self->val_boolean);
89 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
95 gst_test_mono_source_set_property (GObject * object,
96 guint property_id, const GValue * value, GParamSpec * pspec)
98 GstTestMonoSource *self = GST_TEST_MONO_SOURCE (object);
100 switch (property_id) {
102 self->val_ulong = g_value_get_ulong (value);
105 self->val_float = g_value_get_float (value);
108 self->val_double = g_value_get_double (value);
111 self->val_boolean = g_value_get_boolean (value);
113 case ARG_CONSTRUCTONLY:
116 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
122 gst_test_mono_source_class_init (GstTestMonoSourceClass * klass)
124 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
126 gobject_class->set_property = gst_test_mono_source_set_property;
127 gobject_class->get_property = gst_test_mono_source_get_property;
129 g_object_class_install_property (gobject_class, ARG_ULONG,
130 g_param_spec_ulong ("ulong",
132 "ulong number parameter for the test_mono_source",
133 0, G_MAXULONG, 0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
135 g_object_class_install_property (gobject_class, ARG_FLOAT,
136 g_param_spec_float ("float",
138 "float number parameter for the test_mono_source",
139 0.0, 100.0, 0.0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
141 g_object_class_install_property (gobject_class, ARG_DOUBLE,
142 g_param_spec_double ("double",
144 "double number parameter for the test_mono_source",
145 0.0, 100.0, 0.0, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
147 g_object_class_install_property (gobject_class, ARG_BOOLEAN,
148 g_param_spec_boolean ("boolean",
150 "boolean parameter for the test_mono_source",
151 FALSE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
153 g_object_class_install_property (gobject_class, ARG_READONLY,
154 g_param_spec_ulong ("readonly",
156 "readonly parameter for the test_mono_source",
157 0, G_MAXULONG, 0, G_PARAM_READABLE | GST_PARAM_CONTROLLABLE));
159 g_object_class_install_property (gobject_class, ARG_STATIC,
160 g_param_spec_ulong ("static",
162 "static parameter for the test_mono_source",
163 0, G_MAXULONG, 0, G_PARAM_READWRITE));
165 g_object_class_install_property (gobject_class, ARG_CONSTRUCTONLY,
166 g_param_spec_ulong ("construct-only",
167 "construct-only prop",
168 "construct-only parameter for the test_mono_source",
169 0, G_MAXULONG, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
173 gst_test_mono_source_base_init (GstTestMonoSourceClass * klass)
175 static const GstElementDetails details = {
176 "Monophonic source for unit tests",
177 "Source/Audio/MonoSource",
179 "Stefan Kost <ensonic@users.sf.net>"
181 GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
183 gst_element_class_set_details (element_class, &details);
187 gst_test_mono_source_get_type (void)
189 static GType type = 0;
192 static const GTypeInfo info = {
193 (guint16) sizeof (GstTestMonoSourceClass),
194 (GBaseInitFunc) gst_test_mono_source_base_init, // base_init
195 NULL, // base_finalize
196 (GClassInitFunc) gst_test_mono_source_class_init, // class_init
197 NULL, // class_finalize
199 (guint16) sizeof (GstTestMonoSource),
201 NULL, // instance_init
205 g_type_register_static (GST_TYPE_ELEMENT, "GstTestMonoSource", &info,
212 plugin_init (GstPlugin * plugin)
216 res &= gst_element_register (plugin, "testmonosource", GST_RANK_NONE,
217 GST_TYPE_TEST_MONO_SOURCE);
221 GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR,
224 "controller test plugin - several unit test support elements",
225 plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
228 static void __attribute__ ((constructor))
229 _gst_plugin_static_init__plugin_init (void)
231 static GstPluginDesc plugin_desc_ = {
235 "controller test plugin - several unit test support elements",
244 _gst_plugin_register_static (&plugin_desc_);
248 /* double init should not harm */
249 GST_START_TEST (controller_init)
251 gst_controller_init (NULL, NULL);
256 /* tests for an element with no controlled params */
257 GST_START_TEST (controller_new_fail1)
262 elem = gst_element_factory_make ("fakesrc", "test_source");
264 /* that property should not exist */
265 ctrl = gst_controller_new (G_OBJECT (elem), "_schrompf_", NULL);
266 fail_unless (ctrl == NULL, NULL);
268 gst_object_unref (elem);
273 /* tests for an element with controlled params, but none given */
274 GST_START_TEST (controller_new_fail2)
279 elem = gst_element_factory_make ("testmonosource", "test_source");
281 /* no property given */
282 ctrl = gst_controller_new (G_OBJECT (elem), NULL);
283 fail_unless (ctrl == NULL, NULL);
285 gst_object_unref (elem);
290 /* tests for readonly params */
291 GST_START_TEST (controller_new_fail3)
296 elem = gst_element_factory_make ("testmonosource", "test_source");
298 /* that property should exist and but is readonly */
299 ASSERT_CRITICAL (ctrl =
300 gst_controller_new (G_OBJECT (elem), "readonly", NULL));
301 fail_unless (ctrl == NULL, NULL);
303 gst_object_unref (elem);
308 /* tests for static params */
309 GST_START_TEST (controller_new_fail4)
314 elem = gst_element_factory_make ("testmonosource", "test_source");
316 /* that property should exist and but is not controlable */
317 ASSERT_CRITICAL (ctrl = gst_controller_new (G_OBJECT (elem), "static", NULL));
318 fail_unless (ctrl == NULL, NULL);
320 gst_object_unref (elem);
325 /* tests for static params */
326 GST_START_TEST (controller_new_fail5)
331 elem = gst_element_factory_make ("testmonosource", "test_source");
333 /* that property should exist and but is construct-only */
334 ASSERT_CRITICAL (ctrl =
335 gst_controller_new (G_OBJECT (elem), "construct-only", NULL));
336 fail_unless (ctrl == NULL, NULL);
338 gst_object_unref (elem);
344 /* tests for an element with controlled params */
345 GST_START_TEST (controller_new_okay1)
350 elem = gst_element_factory_make ("testmonosource", "test_source");
352 /* that property should exist and should be controllable */
353 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
354 fail_unless (ctrl != NULL, NULL);
356 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
357 g_object_unref (ctrl);
358 gst_object_unref (elem);
363 /* tests for an element with several controlled params */
364 GST_START_TEST (controller_new_okay2)
369 elem = gst_element_factory_make ("testmonosource", "test_source");
371 /* that property should exist and should be controllable */
372 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", "double", "float", NULL);
373 fail_unless (ctrl != NULL, NULL);
375 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
376 g_object_unref (ctrl);
377 gst_object_unref (elem);
382 /* controlling several params should return the same controller */
383 GST_START_TEST (controller_new_okay3)
385 GstController *ctrl1, *ctrl2, *ctrl3;
388 elem = gst_element_factory_make ("testmonosource", "test_source");
390 /* that property should exist and should be controllable */
391 ctrl1 = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
392 fail_unless (ctrl1 != NULL, NULL);
394 /* that property should exist and should be controllable */
395 ctrl2 = gst_controller_new (G_OBJECT (elem), "double", NULL);
396 fail_unless (ctrl2 != NULL, NULL);
397 fail_unless (ctrl1 == ctrl2, NULL);
399 /* that property should exist and should be controllable */
400 ctrl3 = gst_controller_new (G_OBJECT (elem), "float", NULL);
401 fail_unless (ctrl3 != NULL, NULL);
402 fail_unless (ctrl1 == ctrl3, NULL);
404 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl1)->ref_count);
405 g_object_unref (ctrl1);
406 gst_object_unref (elem);
411 /* controlling a params twice should be handled */
412 GST_START_TEST (controller_param_twice)
418 elem = gst_element_factory_make ("testmonosource", "test_source");
420 /* that property should exist and should be controllable */
421 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", "ulong", NULL);
422 fail_unless (ctrl != NULL, NULL);
424 /* it should have been added at least once, let remove it */
425 res = gst_controller_remove_properties (ctrl, "ulong", NULL);
426 fail_unless (res, NULL);
428 /* removing it agian should not work */
429 res = gst_controller_remove_properties (ctrl, "ulong", NULL);
430 fail_unless (!res, NULL);
432 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
433 g_object_unref (ctrl);
434 gst_object_unref (elem);
439 /* tests if we cleanup properly */
440 GST_START_TEST (controller_finalize)
445 elem = gst_element_factory_make ("testmonosource", "test_source");
447 /* that property should exist and should be controllable */
448 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
449 fail_unless (ctrl != NULL, NULL);
451 /* free the controller */
452 g_object_unref (ctrl);
454 /* object shouldn't have a controller anymore */
455 ctrl = gst_object_get_controller (G_OBJECT (elem));
456 fail_unless (ctrl == NULL, NULL);
458 gst_object_unref (elem);
463 /* test timed value handling without interpolation */
464 GST_START_TEST (controller_interpolate_none)
469 GValue val_ulong = { 0, };
471 elem = gst_element_factory_make ("testmonosource", "test_source");
473 /* that property should exist and should be controllable */
474 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
475 fail_unless (ctrl != NULL, NULL);
477 /* set interpolation mode */
478 gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_NONE);
480 /* set control values */
481 g_value_init (&val_ulong, G_TYPE_ULONG);
482 g_value_set_ulong (&val_ulong, 0);
483 res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
484 fail_unless (res, NULL);
485 g_value_set_ulong (&val_ulong, 100);
486 res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
487 fail_unless (res, NULL);
489 /* now pull in values for some timestamps */
490 gst_controller_sync_values (ctrl, 0 * GST_SECOND);
491 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
492 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
493 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
494 gst_controller_sync_values (ctrl, 2 * GST_SECOND);
495 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
497 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
498 g_object_unref (ctrl);
499 gst_object_unref (elem);
504 /* test timed value handling in trigger mode */
505 GST_START_TEST (controller_interpolate_trigger)
510 GValue val_ulong = { 0, };
512 elem = gst_element_factory_make ("testmonosource", "test_source");
514 /* that property should exist and should be controllable */
515 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
516 fail_unless (ctrl != NULL, NULL);
518 /* set interpolation mode */
519 gst_controller_set_interpolation_mode (ctrl, "ulong",
520 GST_INTERPOLATE_TRIGGER);
522 /* set control values */
523 g_value_init (&val_ulong, G_TYPE_ULONG);
524 g_value_set_ulong (&val_ulong, 50);
525 res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
526 fail_unless (res, NULL);
527 g_value_set_ulong (&val_ulong, 100);
528 res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
529 fail_unless (res, NULL);
531 /* now pull in values for some timestamps */
532 gst_controller_sync_values (ctrl, 0 * GST_SECOND);
533 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
534 GST_TEST_MONO_SOURCE (elem)->val_ulong = 0;
535 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
536 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
537 gst_controller_sync_values (ctrl, 2 * GST_SECOND);
538 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
540 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
541 g_object_unref (ctrl);
542 gst_object_unref (elem);
547 /* test timed value handling with linear interpolation */
548 GST_START_TEST (controller_interpolate_linear)
553 GValue val_ulong = { 0, };
555 elem = gst_element_factory_make ("testmonosource", "test_source");
557 /* that property should exist and should be controllable */
558 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
559 fail_unless (ctrl != NULL, NULL);
561 /* set interpolation mode */
562 gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_LINEAR);
564 /* set control values */
565 g_value_init (&val_ulong, G_TYPE_ULONG);
566 g_value_set_ulong (&val_ulong, 0);
567 res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
568 fail_unless (res, NULL);
569 g_value_set_ulong (&val_ulong, 100);
570 res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
571 fail_unless (res, NULL);
573 /* now pull in values for some timestamps */
574 gst_controller_sync_values (ctrl, 0 * GST_SECOND);
575 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
576 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
577 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
578 gst_controller_sync_values (ctrl, 2 * GST_SECOND);
579 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
581 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
582 g_object_unref (ctrl);
583 gst_object_unref (elem);
589 GST_START_TEST (controller_unset)
594 GValue val_ulong = { 0, };
596 elem = gst_element_factory_make ("testmonosource", "test_source");
598 /* that property should exist and should be controllable */
599 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
600 fail_unless (ctrl != NULL, NULL);
602 /* set interpolation mode */
603 gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_NONE);
605 /* set control values */
606 g_value_init (&val_ulong, G_TYPE_ULONG);
607 g_value_set_ulong (&val_ulong, 0);
608 res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
609 fail_unless (res, NULL);
610 g_value_set_ulong (&val_ulong, 100);
611 res = gst_controller_set (ctrl, "ulong", 1 * GST_SECOND, &val_ulong);
612 fail_unless (res, NULL);
613 g_value_set_ulong (&val_ulong, 50);
614 res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
615 fail_unless (res, NULL);
618 gst_controller_sync_values (ctrl, 0 * GST_SECOND);
619 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
620 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
621 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
622 gst_controller_sync_values (ctrl, 2 * GST_SECOND);
623 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
626 res = gst_controller_unset (ctrl, "ulong", 1 * GST_SECOND);
627 fail_unless (res, NULL);
629 /* verify value again */
630 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
631 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
632 gst_controller_sync_values (ctrl, 2 * GST_SECOND);
633 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
635 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
636 g_object_unref (ctrl);
637 gst_object_unref (elem);
642 /* test _unset_all() */
643 GST_START_TEST (controller_unset_all)
648 GValue val_ulong = { 0, };
650 elem = gst_element_factory_make ("testmonosource", "test_source");
652 /* that property should exist and should be controllable */
653 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
654 fail_unless (ctrl != NULL, NULL);
656 /* set interpolation mode */
657 gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_NONE);
659 /* set control values */
660 g_value_init (&val_ulong, G_TYPE_ULONG);
661 g_value_set_ulong (&val_ulong, 0);
662 res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
663 fail_unless (res, NULL);
664 g_value_set_ulong (&val_ulong, 100);
665 res = gst_controller_set (ctrl, "ulong", 1 * GST_SECOND, &val_ulong);
666 fail_unless (res, NULL);
669 gst_controller_sync_values (ctrl, 0 * GST_SECOND);
670 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
671 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
672 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
675 res = gst_controller_unset_all (ctrl, "ulong");
676 fail_unless (res, NULL);
678 /* verify value again */
679 gst_controller_sync_values (ctrl, 1 * GST_SECOND);
680 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
682 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
683 g_object_unref (ctrl);
684 gst_object_unref (elem);
689 /* test live value handling */
690 GST_START_TEST (controller_live)
695 GValue val_ulong = { 0, };
697 elem = gst_element_factory_make ("testmonosource", "test_source");
699 /* that property should exist and should be controllable */
700 ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
701 fail_unless (ctrl != NULL, NULL);
703 /* set interpolation mode */
704 gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_LINEAR);
706 /* set control values */
707 g_value_init (&val_ulong, G_TYPE_ULONG);
708 g_value_set_ulong (&val_ulong, 0);
709 res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
710 fail_unless (res, NULL);
711 g_value_set_ulong (&val_ulong, 100);
712 res = gst_controller_set (ctrl, "ulong", 4 * GST_SECOND, &val_ulong);
713 fail_unless (res, NULL);
714 g_value_set_ulong (&val_ulong, 200);
715 res = gst_controller_set (ctrl, "ulong", 8 * GST_SECOND, &val_ulong);
716 fail_unless (res, NULL);
719 gst_controller_sync_values (ctrl, 2 * GST_SECOND);
720 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
723 g_object_set (elem, "ulong", 500, NULL);
725 /* we should still get the live value */
726 gst_controller_sync_values (ctrl, 3 * GST_SECOND);
727 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 500, NULL);
729 /* we should not get the live value anymore */
730 gst_controller_sync_values (ctrl, 4 * GST_SECOND);
731 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
732 gst_controller_sync_values (ctrl, 6 * GST_SECOND);
733 fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 150, NULL);
735 GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
736 g_object_unref (ctrl);
737 gst_object_unref (elem);
742 /* tests if we can run helper methods against any GObject */
743 GST_START_TEST (controller_helper_any_gobject)
748 elem = gst_element_factory_make ("bin", "test_elem");
750 /* that element is not controllable */
751 res = gst_object_sync_values (G_OBJECT (elem), 0LL);
752 fail_unless (res == FALSE, NULL);
754 gst_object_unref (elem);
761 gst_controller_suite (void)
763 Suite *s = suite_create ("Controller");
764 TCase *tc = tcase_create ("general");
766 suite_add_tcase (s, tc);
767 tcase_add_test (tc, controller_init);
768 tcase_add_test (tc, controller_new_fail1);
769 tcase_add_test (tc, controller_new_fail2);
770 tcase_add_test (tc, controller_new_fail3);
771 tcase_add_test (tc, controller_new_fail4);
772 tcase_add_test (tc, controller_new_fail5);
773 tcase_add_test (tc, controller_new_okay1);
774 tcase_add_test (tc, controller_new_okay2);
775 tcase_add_test (tc, controller_new_okay3);
776 tcase_add_test (tc, controller_param_twice);
777 tcase_add_test (tc, controller_finalize);
778 tcase_add_test (tc, controller_interpolate_none);
779 tcase_add_test (tc, controller_interpolate_trigger);
780 tcase_add_test (tc, controller_interpolate_linear);
781 tcase_add_test (tc, controller_unset);
782 tcase_add_test (tc, controller_unset_all);
783 tcase_add_test (tc, controller_live);
784 tcase_add_test (tc, controller_helper_any_gobject);
789 GST_CHECK_MAIN (gst_controller);