put some make-up on the gstevent test

Original commit message from CVS:
put some make-up on the gstevent test
This commit is contained in:
Thomas Vander Stichele 2005-08-20 12:43:18 +00:00
parent dcfa474078
commit 22aef1b98f
4 changed files with 22 additions and 12 deletions

View file

@ -37,7 +37,7 @@ TESTS = $(top_builddir)/tools/gst-register \
gst/gstbus \ gst/gstbus \
gst/gstcaps \ gst/gstcaps \
gst/gstelement \ gst/gstelement \
gst/gstevents \ gst/gstevent \
gst/gstghostpad \ gst/gstghostpad \
gst/gstiterator \ gst/gstiterator \
gst/gstmessage \ gst/gstmessage \

View file

@ -1,7 +1,7 @@
/* GStreamer /* GStreamer
* Copyright (C) 2005 Jan Schmidt <thaytan@mad.scientist.com> * Copyright (C) 2005 Jan Schmidt <thaytan@mad.scientist.com>
* *
* gstevents.c: Unit test for event handling * gstevent.c: Unit test for event handling
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -20,7 +20,7 @@
*/ */
#include "../gstcheck.h" #include <gst/check/gstcheck.h>
GST_START_TEST (create_custom_events) GST_START_TEST (create_custom_events)
{ {
@ -184,7 +184,9 @@ GST_START_TEST (create_custom_events)
} }
} }
GST_END_TEST GTimeVal sent_event_time; GST_END_TEST;
GTimeVal sent_event_time;
GstEvent *got_event_before_q, *got_event_after_q; GstEvent *got_event_before_q, *got_event_after_q;
GTimeVal got_event_time; GTimeVal got_event_time;
@ -328,7 +330,7 @@ GST_START_TEST (send_custom_events)
&sent_event_time) < G_USEC_PER_SEC / 2, &sent_event_time) < G_USEC_PER_SEC / 2,
"GST_EVENT_CUSTOM_BOTH_OOB took to long to reach source"); "GST_EVENT_CUSTOM_BOTH_OOB took to long to reach source");
/* In-band downstream events are expected to take at least 1 second /* In-band downstream events are expected to take at least 1 second
* to traverse the the queue */ * to traverse the the queue */
test_event (GST_EVENT_CUSTOM_DS, srcpad, FALSE); test_event (GST_EVENT_CUSTOM_DS, srcpad, FALSE);
fail_unless (timediff (&got_event_time, fail_unless (timediff (&got_event_time,
@ -348,7 +350,10 @@ GST_START_TEST (send_custom_events)
gst_object_unref (pipeline); gst_object_unref (pipeline);
} }
GST_END_TEST Suite * gstevents_suite (void) GST_END_TEST;
Suite *
gstevents_suite (void)
{ {
Suite *s = suite_create ("GstEvent"); Suite *s = suite_create ("GstEvent");
TCase *tc_chain = tcase_create ("customevents"); TCase *tc_chain = tcase_create ("customevents");

View file

@ -37,7 +37,7 @@ TESTS = $(top_builddir)/tools/gst-register \
gst/gstbus \ gst/gstbus \
gst/gstcaps \ gst/gstcaps \
gst/gstelement \ gst/gstelement \
gst/gstevents \ gst/gstevent \
gst/gstghostpad \ gst/gstghostpad \
gst/gstiterator \ gst/gstiterator \
gst/gstmessage \ gst/gstmessage \

View file

@ -1,7 +1,7 @@
/* GStreamer /* GStreamer
* Copyright (C) 2005 Jan Schmidt <thaytan@mad.scientist.com> * Copyright (C) 2005 Jan Schmidt <thaytan@mad.scientist.com>
* *
* gstevents.c: Unit test for event handling * gstevent.c: Unit test for event handling
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -20,7 +20,7 @@
*/ */
#include "../gstcheck.h" #include <gst/check/gstcheck.h>
GST_START_TEST (create_custom_events) GST_START_TEST (create_custom_events)
{ {
@ -184,7 +184,9 @@ GST_START_TEST (create_custom_events)
} }
} }
GST_END_TEST GTimeVal sent_event_time; GST_END_TEST;
GTimeVal sent_event_time;
GstEvent *got_event_before_q, *got_event_after_q; GstEvent *got_event_before_q, *got_event_after_q;
GTimeVal got_event_time; GTimeVal got_event_time;
@ -328,7 +330,7 @@ GST_START_TEST (send_custom_events)
&sent_event_time) < G_USEC_PER_SEC / 2, &sent_event_time) < G_USEC_PER_SEC / 2,
"GST_EVENT_CUSTOM_BOTH_OOB took to long to reach source"); "GST_EVENT_CUSTOM_BOTH_OOB took to long to reach source");
/* In-band downstream events are expected to take at least 1 second /* In-band downstream events are expected to take at least 1 second
* to traverse the the queue */ * to traverse the the queue */
test_event (GST_EVENT_CUSTOM_DS, srcpad, FALSE); test_event (GST_EVENT_CUSTOM_DS, srcpad, FALSE);
fail_unless (timediff (&got_event_time, fail_unless (timediff (&got_event_time,
@ -348,7 +350,10 @@ GST_START_TEST (send_custom_events)
gst_object_unref (pipeline); gst_object_unref (pipeline);
} }
GST_END_TEST Suite * gstevents_suite (void) GST_END_TEST;
Suite *
gstevents_suite (void)
{ {
Suite *s = suite_create ("GstEvent"); Suite *s = suite_create ("GstEvent");
TCase *tc_chain = tcase_create ("customevents"); TCase *tc_chain = tcase_create ("customevents");