2 * Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
4 * gstsystemclock.c: Unit test for GstSystemClock
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #include <gst/check/gstcheck.h>
24 static GMutex af_lock;
27 /* see if the defines make sense */
28 GST_START_TEST (test_range)
30 GstClockTime time, time2;
33 fail_unless (time == G_GUINT64_CONSTANT (1000000000));
36 fail_unless (time2 == 1000000);
37 fail_unless (time2 == GST_MSECOND);
38 fail_unless (time2 == GST_TIME_AS_USECONDS (time));
40 time2 = time / 1000000;
41 fail_unless (time2 == 1000);
42 fail_unless (time2 == GST_USECOND);
43 fail_unless (time2 == GST_TIME_AS_MSECONDS (time));
48 GST_START_TEST (test_signedness)
50 GstClockTime time[] = { 0, 1, G_MAXUINT64 / GST_SECOND };
51 GstClockTimeDiff diff[] =
52 { 0, 1, -1, G_MAXINT64 / GST_SECOND, G_MININT64 / GST_SECOND };
55 for (i = 0; i < G_N_ELEMENTS (time); i++) {
56 fail_if (time[i] != (time[i] * GST_SECOND / GST_SECOND));
58 for (i = 0; i < G_N_ELEMENTS (diff); i++) {
59 fail_if (diff[i] != (diff[i] * GST_SECOND / GST_SECOND));
65 #define TIME_UNIT (GST_SECOND / 5)
67 gst_clock_debug (GstClock * clock)
71 time = gst_clock_get_time (clock);
72 GST_DEBUG ("Clock info: time %" GST_TIME_FORMAT, GST_TIME_ARGS (time));
76 ok_callback (GstClock * clock, GstClockTime time,
77 GstClockID id, gpointer user_data)
79 GST_LOG ("unlocked async id %p", id);
84 error_callback (GstClock * clock, GstClockTime time,
85 GstClockID id, gpointer user_data)
87 GST_WARNING ("unlocked unscheduled async id %p, this is wrong", id);
96 store_callback (GstClock * clock, GstClockTime time,
97 GstClockID id, gpointer user_data)
99 GList **list = user_data;
101 GST_DEBUG ("unlocked async id %p", id);
102 g_mutex_lock (&store_lock);
103 *list = g_list_append (*list, id);
104 g_mutex_unlock (&store_lock);
109 notify_callback (GstClock * clock, GstClockTime time,
110 GstClockID id, gpointer user_data)
112 gboolean *ret = (gboolean *) user_data;
120 GST_START_TEST (test_set_default)
122 GstClock *clock, *static_clock;
124 /* obtain the default system clock, which keeps a static ref and bumps the
125 * refcount before returning */
126 static_clock = gst_system_clock_obtain ();
127 fail_unless (static_clock != NULL, "Could not create default system clock");
128 g_assert_cmpint (GST_OBJECT_REFCOUNT (static_clock), ==, 2);
130 /* set a new default clock to a different instance which should replace the
131 * static clock with this one, and unref the static clock */
132 clock = g_object_new (GST_TYPE_SYSTEM_CLOCK, "name", "TestClock", NULL);
133 gst_system_clock_set_default (clock);
134 g_assert_cmpint (GST_OBJECT_REFCOUNT (static_clock), ==, 1);
135 g_object_unref (static_clock);
136 static_clock = gst_system_clock_obtain ();
137 fail_unless (static_clock == clock);
138 g_assert_cmpint (GST_OBJECT_REFCOUNT (clock), ==, 3);
139 g_object_unref (static_clock);
141 /* Reset the default clock to the static one */
142 gst_system_clock_set_default (NULL);
143 static_clock = gst_system_clock_obtain ();
144 fail_unless (static_clock != clock);
145 g_assert_cmpint (GST_OBJECT_REFCOUNT (clock), ==, 1);
146 g_assert_cmpint (GST_OBJECT_REFCOUNT (static_clock), ==, 2);
147 g_object_unref (clock);
148 g_object_unref (static_clock);
153 GST_START_TEST (test_single_shot)
158 GstClockReturn result;
160 clock = gst_system_clock_obtain ();
161 fail_unless (clock != NULL, "Could not create instance of GstSystemClock");
163 gst_clock_debug (clock);
164 base = gst_clock_get_time (clock);
166 id = gst_clock_new_single_shot_id (clock, base + TIME_UNIT);
167 fail_unless (id != NULL, "Could not create single shot id");
169 GST_DEBUG ("waiting one time unit");
170 result = gst_clock_id_wait (id, NULL);
171 gst_clock_debug (clock);
172 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK (result=%d)",
174 fail_unless (gst_clock_get_time (clock) > (base + TIME_UNIT),
175 "target time has not been reached");
177 GST_DEBUG ("waiting in the past");
178 result = gst_clock_id_wait (id, NULL);
179 gst_clock_debug (clock);
180 fail_unless (result == GST_CLOCK_EARLY,
181 "Waiting did not return EARLY(result=%d)", result);
182 gst_clock_id_unref (id);
184 id = gst_clock_new_single_shot_id (clock, base + 2 * TIME_UNIT);
185 GST_DEBUG ("waiting one second async id %p", id);
186 result = gst_clock_id_wait_async (id, ok_callback, NULL, NULL);
187 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
188 g_usleep (TIME_UNIT / (2 * 1000));
189 gst_clock_id_unschedule (id);
190 gst_clock_id_unref (id);
192 id = gst_clock_new_single_shot_id (clock, base + 5 * TIME_UNIT);
193 GST_DEBUG ("waiting one second async, with cancel on id %p", id);
194 result = gst_clock_id_wait_async (id, error_callback, NULL, NULL);
195 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
196 g_usleep (TIME_UNIT / (2 * 1000));
197 GST_DEBUG ("cancel id %p after half a time unit", id);
198 gst_clock_id_unschedule (id);
199 gst_clock_id_unref (id);
200 GST_DEBUG ("canceled id %p", id);
202 GST_DEBUG ("waiting multiple one second async, with cancel");
203 id = gst_clock_new_single_shot_id (clock, base + 5 * TIME_UNIT);
204 id2 = gst_clock_new_single_shot_id (clock, base + 6 * TIME_UNIT);
205 GST_DEBUG ("waiting id %p", id);
206 result = gst_clock_id_wait_async (id, ok_callback, NULL, NULL);
207 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
209 GST_DEBUG ("waiting id %p", id2);
210 result = gst_clock_id_wait_async (id2, error_callback, NULL, NULL);
211 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
212 g_usleep (TIME_UNIT / (2 * 1000));
213 GST_DEBUG ("cancel id %p after half a time unit", id2);
214 gst_clock_id_unschedule (id2);
215 GST_DEBUG ("canceled id %p", id2);
216 gst_clock_id_unref (id2);
218 /* wait for the entry to time out */
219 g_usleep (TIME_UNIT / 1000 * 5);
220 fail_unless (((GstClockEntry *) id)->status == GST_CLOCK_OK,
221 "Waiting did not finish");
222 gst_clock_id_unref (id);
224 gst_object_unref (clock);
229 GST_START_TEST (test_periodic_shot)
234 GstClockReturn result;
236 clock = gst_system_clock_obtain ();
237 fail_unless (clock != NULL, "Could not create instance of GstSystemClock");
239 gst_clock_debug (clock);
240 base = gst_clock_get_time (clock);
242 /* signal every half a time unit */
243 id = gst_clock_new_periodic_id (clock, base + TIME_UNIT, TIME_UNIT / 2);
244 fail_unless (id != NULL, "Could not create periodic id");
246 GST_DEBUG ("waiting one time unit");
247 result = gst_clock_id_wait (id, NULL);
248 gst_clock_debug (clock);
249 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
251 GST_DEBUG ("waiting for the next");
252 result = gst_clock_id_wait (id, NULL);
253 gst_clock_debug (clock);
254 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
256 GST_DEBUG ("waiting for the next async %p", id);
257 result = gst_clock_id_wait_async (id, ok_callback, NULL, NULL);
258 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
259 g_usleep (TIME_UNIT / (2 * 1000));
261 GST_DEBUG ("waiting some more for the next async %p", id);
262 result = gst_clock_id_wait_async (id, ok_callback, NULL, NULL);
263 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
264 g_usleep (TIME_UNIT / (2 * 1000));
266 id2 = gst_clock_new_periodic_id (clock, base + TIME_UNIT, TIME_UNIT / 2);
267 fail_unless (id2 != NULL, "Could not create second periodic id");
269 GST_DEBUG ("waiting some more for another async %p", id2);
270 result = gst_clock_id_wait_async (id2, ok_callback, NULL, NULL);
271 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
272 g_usleep (TIME_UNIT / (2 * 1000));
274 GST_DEBUG ("unschedule %p", id);
275 gst_clock_id_unschedule (id);
277 /* entry cannot be used again */
278 result = gst_clock_id_wait_async (id, error_callback, NULL, NULL);
279 fail_unless (result == GST_CLOCK_UNSCHEDULED,
280 "Waiting did not return UNSCHEDULED");
281 result = gst_clock_id_wait (id, NULL);
282 fail_unless (result == GST_CLOCK_UNSCHEDULED,
283 "Waiting did not return UNSCHEDULED");
284 g_usleep (TIME_UNIT / (2 * 1000));
287 gst_clock_id_unref (id);
288 gst_clock_id_unschedule (id2);
289 gst_clock_id_unref (id2);
291 gst_object_unref (clock);
296 GST_START_TEST (test_async_order)
300 GList *cb_list = NULL, *next;
302 GstClockReturn result;
304 clock = gst_system_clock_obtain ();
305 fail_unless (clock != NULL, "Could not create instance of GstSystemClock");
307 gst_clock_debug (clock);
308 base = gst_clock_get_time (clock);
310 id1 = gst_clock_new_single_shot_id (clock, base + 2 * TIME_UNIT);
311 id2 = gst_clock_new_single_shot_id (clock, base + 1 * TIME_UNIT);
312 result = gst_clock_id_wait_async (id1, store_callback, &cb_list, NULL);
313 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
314 g_usleep (TIME_UNIT / (2 * 1000));
315 result = gst_clock_id_wait_async (id2, store_callback, &cb_list, NULL);
316 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
317 g_usleep (TIME_UNIT / 1000);
318 /* at this point at least one of the timers should have timed out */
319 g_mutex_lock (&store_lock);
320 fail_unless (cb_list != NULL, "expected notification");
321 fail_unless (cb_list->data == id2,
322 "Expected notification for id2 to come first");
323 g_mutex_unlock (&store_lock);
324 g_usleep (TIME_UNIT / 1000);
325 g_mutex_lock (&store_lock);
326 /* now both should have timed out */
327 next = g_list_next (cb_list);
328 fail_unless (next != NULL, "expected second notification");
329 fail_unless (next->data == id1, "Missing notification for id1");
330 g_mutex_unlock (&store_lock);
332 gst_clock_id_unref (id1);
333 gst_clock_id_unref (id2);
334 g_list_free (cb_list);
336 gst_object_unref (clock);
341 struct test_async_sync_interaction_data
349 GstClockID async_id2;
350 GstClockID async_id3;
354 test_async_sync_interaction_cb (GstClock * clock, GstClockTime time,
355 GstClockID id, gpointer user_data)
357 struct test_async_sync_interaction_data *td =
358 (struct test_async_sync_interaction_data *) (user_data);
360 g_mutex_lock (&td->lock);
361 /* The first async callback is ignored */
362 if (id == td->async_id)
365 if (id != td->async_id2 && id != td->async_id3)
368 /* Unschedule the sync callback */
369 if (id == td->async_id3) {
370 gst_clock_id_unschedule (td->sync_id);
371 gst_clock_id_unschedule (td->async_id2);
374 g_mutex_unlock (&td->lock);
378 GST_START_TEST (test_async_sync_interaction)
380 /* This test schedules an async callback, then before it completes, schedules
381 * an earlier async callback, and quickly unschedules the first, and inserts
382 * a THIRD even earlier async callback. It then attempts to wait on a
383 * sync clock ID. While that's sleeping, the 3rd async callback should fire
384 * and unschedule it. This tests for problems with unscheduling async and
385 * sync callbacks on the system clock. */
387 GstClockReturn result;
389 GstClockTimeDiff jitter;
390 struct test_async_sync_interaction_data td;
393 clock = gst_system_clock_obtain ();
394 fail_unless (clock != NULL, "Could not create instance of GstSystemClock");
396 g_mutex_init (&td.lock);
398 for (i = 0; i < 50; i++) {
399 gst_clock_debug (clock);
400 base = gst_clock_get_time (clock);
401 g_mutex_lock (&td.lock);
402 td.async_id = gst_clock_new_single_shot_id (clock, base + 40 * GST_MSECOND);
404 gst_clock_new_single_shot_id (clock, base + 30 * GST_MSECOND);
406 gst_clock_new_single_shot_id (clock, base + 20 * GST_MSECOND);
407 td.sync_id2 = gst_clock_new_single_shot_id (clock, base + 10 * GST_MSECOND);
408 td.sync_id = gst_clock_new_single_shot_id (clock, base + 50 * GST_MSECOND);
409 g_mutex_unlock (&td.lock);
411 result = gst_clock_id_wait_async (td.async_id,
412 test_async_sync_interaction_cb, &td, NULL);
413 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
415 /* Wait 10ms, then unschedule async_id and schedule async_id2 */
416 result = gst_clock_id_wait (td.sync_id2, &jitter);
417 fail_unless (result == GST_CLOCK_OK || result == GST_CLOCK_EARLY,
418 "Waiting did not return OK or EARLY");
419 /* async_id2 is earlier than async_id - should become head of the queue */
420 result = gst_clock_id_wait_async (td.async_id2,
421 test_async_sync_interaction_cb, &td, NULL);
422 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
423 gst_clock_id_unschedule (td.async_id);
425 /* async_id3 is earlier than async_id2 - should become head of the queue */
426 result = gst_clock_id_wait_async (td.async_id3,
427 test_async_sync_interaction_cb, &td, NULL);
428 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
430 /* While this is sleeping, the async3 id should fire and unschedule it */
431 result = gst_clock_id_wait (td.sync_id, &jitter);
432 fail_unless (result == GST_CLOCK_UNSCHEDULED || result == GST_CLOCK_EARLY,
433 "Waiting did not return UNSCHEDULED (was %d)", result);
435 gst_clock_id_unschedule (td.async_id3);
436 g_mutex_lock (&td.lock);
438 gst_clock_id_unref (td.sync_id);
439 gst_clock_id_unref (td.sync_id2);
440 gst_clock_id_unref (td.async_id);
441 gst_clock_id_unref (td.async_id2);
442 gst_clock_id_unref (td.async_id3);
443 g_mutex_unlock (&td.lock);
446 g_mutex_clear (&td.lock);
447 gst_object_unref (clock);
452 GST_START_TEST (test_periodic_multi)
456 GstClockID clock_id_async;
458 GstClockReturn result;
459 gboolean got_callback = FALSE;
461 clock = gst_system_clock_obtain ();
462 fail_unless (clock != NULL, "Could not create instance of GstSystemClock");
464 gst_clock_debug (clock);
465 base = gst_clock_get_time (clock);
467 clock_id = gst_clock_new_periodic_id (clock, base + TIME_UNIT, TIME_UNIT);
468 gst_clock_id_wait (clock_id, NULL);
469 fail_unless (gst_clock_get_time (clock) >= base + TIME_UNIT);
470 fail_unless (gst_clock_get_time (clock) < base + 2 * TIME_UNIT);
472 /* now perform a concurrent wait and wait_async */
475 gst_clock_new_periodic_id (clock, base + TIME_UNIT, TIME_UNIT);
477 gst_clock_id_wait_async (clock_id_async, notify_callback, &got_callback,
479 fail_unless (result == GST_CLOCK_OK, "Async waiting did not return OK");
481 result = gst_clock_id_wait (clock_id, NULL);
482 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
483 fail_unless (gst_clock_get_time (clock) >= base + 2 * TIME_UNIT);
484 /* give the async thread some time to call our callback: */
485 g_usleep (TIME_UNIT / (10 * 1000));
486 fail_unless (got_callback == TRUE, "got no async callback (1)");
487 fail_unless (gst_clock_get_time (clock) < base + 3 * TIME_UNIT);
488 got_callback = FALSE;
490 result = gst_clock_id_wait (clock_id, NULL);
491 fail_unless (result == GST_CLOCK_OK, "Waiting did not return OK");
492 fail_unless (gst_clock_get_time (clock) >= base + 3 * TIME_UNIT);
493 /* give the async thread some time to call our callback: */
494 g_usleep (TIME_UNIT / (10 * 1000));
495 fail_unless (got_callback == TRUE, "got no async callback (2)");
496 fail_unless (gst_clock_get_time (clock) < base + 4 * TIME_UNIT);
499 gst_clock_id_unref (clock_id);
500 gst_clock_id_unschedule (clock_id_async);
501 gst_clock_id_unref (clock_id_async);
502 gst_object_unref (clock);
507 GST_START_TEST (test_diff)
509 GstClockTime time1[] = { 0, (GstClockTime) - 1, 0, 1, 2 * GST_SECOND,
510 (GstClockTime) - GST_SECOND, (GstClockTime) - GST_SECOND
512 GstClockTime time2[] =
513 { 0, 1, 1, 0, 1 * GST_SECOND, (GstClockTime) - GST_SECOND, GST_SECOND };
514 GstClockTimeDiff d[] = { 0, 2, 1, -1, -GST_SECOND, 0, 2 * GST_SECOND };
517 for (i = 0; i < G_N_ELEMENTS (d); i++) {
518 fail_if (d[i] != GST_CLOCK_DIFF (time1[i], time2[i]));
524 /* test if a blocking wait, unblocked by an async entry continues to be
530 GstClockTimeDiff jitter;
535 mixed_thread (MixedInfo * info)
537 info->ret = gst_clock_id_wait (info->id, &info->jitter);
542 mixed_async_cb (GstClock * clock, GstClockTime time,
543 GstClockID id, gpointer user_data)
548 GST_START_TEST (test_mixed)
551 GError *error = NULL;
556 info.clock = gst_system_clock_obtain ();
557 fail_unless (info.clock != NULL,
558 "Could not create instance of GstSystemClock");
560 /* get current time of the clock as base time */
561 base = gst_clock_get_time (info.clock);
563 /* create entry to wait for 1 second */
564 info.id = gst_clock_new_single_shot_id (info.clock, base + GST_SECOND);
566 /* make and start an entry that is scheduled every 10ms */
567 id = gst_clock_new_periodic_id (info.clock, base, 10 * GST_MSECOND);
569 /* start waiting for the entry */
571 g_thread_try_new ("gst-check", (GThreadFunc) mixed_thread, &info, &error);
572 fail_unless (error == NULL, "error creating thread");
573 fail_unless (thread != NULL, "Could not create thread");
575 /* wait half a second so we are sure to be in the thread */
576 g_usleep (G_USEC_PER_SEC / 2);
578 /* start scheduling the entry */
579 gst_clock_id_wait_async (id, mixed_async_cb, NULL, NULL);
581 /* wait for thread to finish */
582 g_thread_join (thread);
583 /* entry must have timed out correctly */
584 fail_unless (info.ret == GST_CLOCK_OK, "clock return was %d", info.ret);
586 gst_clock_id_unschedule (id);
587 gst_clock_id_unref (id);
588 gst_clock_id_unref (info.id);
589 gst_object_unref (info.clock);
595 test_async_full_slave_callback (GstClock * master, GstClockTime time,
596 GstClockID id, GstClock * clock)
598 GstClockTime stime, mtime;
601 /* notify the test case that we started */
602 GST_INFO ("callback started");
603 g_mutex_lock (&af_lock);
604 g_cond_signal (&af_cond);
606 /* wait for the test case to unref "clock" and signal */
607 GST_INFO ("waiting for test case to signal");
608 g_cond_wait (&af_cond, &af_lock);
610 stime = gst_clock_get_internal_time (clock);
611 mtime = gst_clock_get_time (master);
613 gst_clock_add_observation (clock, stime, mtime, &r_squared);
615 g_cond_signal (&af_cond);
616 g_mutex_unlock (&af_lock);
617 GST_INFO ("callback finished");
622 GST_START_TEST (test_async_full)
624 GstClock *master, *slave;
627 /* create master and slave */
629 g_object_new (GST_TYPE_SYSTEM_CLOCK, "name", "TestClockMaster", NULL);
630 slave = g_object_new (GST_TYPE_SYSTEM_CLOCK, "name", "TestClockMaster", NULL);
631 GST_OBJECT_FLAG_SET (slave, GST_CLOCK_FLAG_CAN_SET_MASTER);
632 g_object_set (slave, "timeout", 50 * GST_MSECOND, NULL);
634 fail_unless (GST_OBJECT_REFCOUNT (master) == 1);
635 fail_unless (GST_OBJECT_REFCOUNT (slave) == 1);
637 /* register a periodic shot on the master to calibrate the slave */
638 g_mutex_lock (&af_lock);
639 clockid = gst_clock_new_periodic_id (master,
640 gst_clock_get_time (master), gst_clock_get_timeout (slave));
641 gst_clock_id_wait_async (clockid,
642 (GstClockCallback) test_async_full_slave_callback,
643 gst_object_ref (slave), (GDestroyNotify) gst_object_unref);
645 /* wait for the shot to be fired and test_async_full_slave_callback to be
647 GST_INFO ("waiting for the slave callback to start");
648 g_cond_wait (&af_cond, &af_lock);
649 GST_INFO ("slave callback running, unreffing slave");
651 /* unref the slave clock while the slave_callback is running. This should be
652 * safe since the master clock now stores a ref to the slave */
653 gst_object_unref (slave);
655 /* unref the clock entry. This should be safe as well since the clock thread
656 * refs the entry before executing it */
657 gst_clock_id_unschedule (clockid);
658 gst_clock_id_unref (clockid);
660 /* signal and wait for the callback to complete */
661 g_cond_signal (&af_cond);
663 GST_INFO ("waiting for callback to finish");
664 g_cond_wait (&af_cond, &af_lock);
665 GST_INFO ("callback finished");
666 g_mutex_unlock (&af_lock);
668 gst_object_unref (master);
673 GST_START_TEST (test_resolution)
676 GstClockTime now_t, prev_t, resolution;
679 now_t = prev_t = GST_CLOCK_TIME_NONE;
680 clock = gst_system_clock_obtain ();
681 fail_unless (clock != NULL, "Could not create default system clock");
682 resolution = gst_clock_get_resolution (clock);
683 fail_unless (resolution != GST_CLOCK_TIME_NONE);
685 for (i = 0; i < 100000; ++i) {
686 now_t = gst_clock_get_internal_time (clock);
687 fail_unless (now_t != GST_CLOCK_TIME_NONE);
688 if (prev_t != GST_CLOCK_TIME_NONE) {
690 fail_unless (now_t >= prev_t);
691 diff = now_t - prev_t;
692 fail_unless (diff == 0 || diff >= resolution);
697 g_object_unref (clock);
704 gst_systemclock_suite (void)
706 Suite *s = suite_create ("GstSystemClock");
707 TCase *tc_chain = tcase_create ("waiting");
709 suite_add_tcase (s, tc_chain);
710 tcase_add_test (tc_chain, test_range);
711 tcase_add_test (tc_chain, test_signedness);
712 tcase_add_test (tc_chain, test_single_shot);
713 tcase_add_test (tc_chain, test_periodic_shot);
714 tcase_add_test (tc_chain, test_periodic_multi);
715 tcase_add_test (tc_chain, test_async_order);
716 tcase_add_test (tc_chain, test_async_sync_interaction);
717 tcase_add_test (tc_chain, test_diff);
718 tcase_add_test (tc_chain, test_mixed);
719 tcase_add_test (tc_chain, test_async_full);
720 tcase_add_test (tc_chain, test_set_default);
721 tcase_add_test (tc_chain, test_resolution);
726 GST_CHECK_MAIN (gst_systemclock);