mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
add debugging category use GST_START_TEST now, so we add a debug line
Original commit message from CVS: add debugging category use GST_START_TEST now, so we add a debug line
This commit is contained in:
parent
48464956ca
commit
bb3914dd30
47 changed files with 416 additions and 236 deletions
30
ChangeLog
30
ChangeLog
|
@ -1,3 +1,33 @@
|
||||||
|
2005-07-09 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* check/elements/gstfakesrc.c: (chain_func), (event_func),
|
||||||
|
(GST_START_TEST), (fakesrc_suite):
|
||||||
|
* check/gst-libs/gdp.c: (GST_START_TEST):
|
||||||
|
* check/gst/gst.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstbin.c: (GST_START_TEST), (gst_bin_suite):
|
||||||
|
* check/gst/gstbuffer.c: (GST_START_TEST), (gst_test_suite):
|
||||||
|
* check/gst/gstbus.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstcaps.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstdata.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstelement.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstghostpad.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstiterator.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstmessage.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstobject.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstpad.c: (GST_START_TEST):
|
||||||
|
* check/gst/gststructure.c: (GST_START_TEST):
|
||||||
|
* check/gst/gstsystemclock.c: (GST_START_TEST),
|
||||||
|
(gst_systemclock_suite):
|
||||||
|
* check/gst/gsttag.c: (GST_START_TEST), (gst_tag_suite):
|
||||||
|
* check/gst/gstvalue.c: (GST_START_TEST):
|
||||||
|
* check/pipelines/cleanup.c: (GST_START_TEST):
|
||||||
|
* check/pipelines/simple_launch_lines.c: (GST_START_TEST):
|
||||||
|
* check/states/sinks.c: (GST_START_TEST):
|
||||||
|
* check/gstcheck.c: (gst_check_init):
|
||||||
|
* check/gstcheck.h:
|
||||||
|
add debugging category
|
||||||
|
use GST_START_TEST now, so we add a debug line
|
||||||
|
|
||||||
2005-07-09 Thomas Vander Stichele <thomas at apestaart dot org>
|
2005-07-09 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* check/gst/gstbin.c: (START_TEST), (gst_bin_suite):
|
* check/gst/gstbin.c: (START_TEST), (gst_bin_suite):
|
||||||
|
|
|
@ -55,7 +55,7 @@ event_func (GstPad * pad, GstEvent * event)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_num_buffers)
|
GST_START_TEST (test_num_buffers)
|
||||||
{
|
{
|
||||||
GstElement *src;
|
GstElement *src;
|
||||||
GstScheduler *scheduler;
|
GstScheduler *scheduler;
|
||||||
|
@ -95,7 +95,7 @@ START_TEST (test_num_buffers)
|
||||||
g_list_free (buffers);
|
g_list_free (buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
fakesrc_suite (void)
|
fakesrc_suite (void)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "libs/gst/dataprotocol/dp-private.h" /* private header */
|
#include "libs/gst/dataprotocol/dp-private.h" /* private header */
|
||||||
|
|
||||||
/* test our method of reading and writing headers using TO/FROM_BE */
|
/* test our method of reading and writing headers using TO/FROM_BE */
|
||||||
START_TEST (test_conversion)
|
GST_START_TEST (test_conversion)
|
||||||
{
|
{
|
||||||
guint8 array[9];
|
guint8 array[9];
|
||||||
guint8 write_array[9];
|
guint8 write_array[9];
|
||||||
|
@ -81,9 +81,9 @@ START_TEST (test_conversion)
|
||||||
"GST_WRITE_UINT64_BE: memcmp failed");
|
"GST_WRITE_UINT64_BE: memcmp failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* test creation of header from buffer and back again */
|
/* test creation of header from buffer and back again */
|
||||||
START_TEST (test_buffer)
|
GST_START_TEST (test_buffer)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstBuffer *newbuffer;
|
GstBuffer *newbuffer;
|
||||||
|
@ -141,8 +141,8 @@ START_TEST (test_buffer)
|
||||||
g_free (header);
|
g_free (header);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_caps)
|
GST_START_TEST (test_caps)
|
||||||
{
|
{
|
||||||
gchar *string, *newstring;
|
gchar *string, *newstring;
|
||||||
GstCaps *caps, *newcaps;
|
GstCaps *caps, *newcaps;
|
||||||
|
@ -173,8 +173,8 @@ START_TEST (test_caps)
|
||||||
g_free (newstring);
|
g_free (newstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_event)
|
GST_START_TEST (test_event)
|
||||||
{
|
{
|
||||||
GstEvent *send;
|
GstEvent *send;
|
||||||
GstEvent *receive;
|
GstEvent *receive;
|
||||||
|
@ -240,7 +240,7 @@ START_TEST (test_event)
|
||||||
gst_event_unref (send);
|
gst_event_unref (send);
|
||||||
gst_event_unref (receive);
|
gst_event_unref (receive);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_object_suite (void)
|
gst_object_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("data protocol");
|
Suite *s = suite_create ("data protocol");
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_init)
|
GST_START_TEST (test_init)
|
||||||
{
|
{
|
||||||
/* don't segfault with NULL, NULL */
|
/* don't segfault with NULL, NULL */
|
||||||
gst_init (NULL, NULL);
|
gst_init (NULL, NULL);
|
||||||
|
@ -29,7 +29,7 @@ START_TEST (test_init)
|
||||||
gst_init (NULL, NULL);
|
gst_init (NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_suite (void)
|
gst_suite (void)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_interface)
|
GST_START_TEST (test_interface)
|
||||||
{
|
{
|
||||||
GstBin *bin, *bin2;
|
GstBin *bin, *bin2;
|
||||||
GstElement *filesrc;
|
GstElement *filesrc;
|
||||||
|
@ -83,9 +83,9 @@ START_TEST (test_interface)
|
||||||
gst_object_unref (bin);
|
gst_object_unref (bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_message_state_changed)
|
GST_START_TEST (test_message_state_changed)
|
||||||
{
|
{
|
||||||
GstBin *bin;
|
GstBin *bin;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
|
@ -116,7 +116,62 @@ START_TEST (test_message_state_changed)
|
||||||
gst_object_unref (bin);
|
gst_object_unref (bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
GST_START_TEST (test_message_state_changed_child)
|
||||||
|
{
|
||||||
|
GstBin *bin;
|
||||||
|
GstElement *src;
|
||||||
|
GstBus *bus;
|
||||||
|
GstMessage *message;
|
||||||
|
|
||||||
|
bin = GST_BIN (gst_bin_new (NULL));
|
||||||
|
fail_unless (bin != NULL, "Could not create bin");
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 1);
|
||||||
|
|
||||||
|
src = gst_element_factory_make ("fakesrc", NULL);
|
||||||
|
fail_if (src == NULL, "Could not create fakesrc");
|
||||||
|
gst_bin_add (bin, src);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 1);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||||
|
|
||||||
|
bus = GST_ELEMENT_BUS (bin);
|
||||||
|
|
||||||
|
/* change state, spawning three messages:
|
||||||
|
* - first for fakesrc, causing incref on fakesrc
|
||||||
|
* - then two on bin, causing an incref on the bin */
|
||||||
|
GST_DEBUG ("setting bin to READY");
|
||||||
|
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_READY);
|
||||||
|
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 2);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 2);
|
||||||
|
|
||||||
|
/* get and unref the message, causing a decref on the src */
|
||||||
|
fail_unless (gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1)
|
||||||
|
== GST_MESSAGE_STATE_CHANGED, "did not get GST_MESSAGE_STATE_CHANGED");
|
||||||
|
|
||||||
|
message = gst_bus_pop (bus);
|
||||||
|
gst_message_unref (message);
|
||||||
|
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 2);
|
||||||
|
|
||||||
|
/* get and unref message 2, causing a decref on the bin */
|
||||||
|
fail_unless (gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1)
|
||||||
|
== GST_MESSAGE_STATE_CHANGED, "did not get GST_MESSAGE_STATE_CHANGED");
|
||||||
|
|
||||||
|
message = gst_bus_pop (bus);
|
||||||
|
gst_message_unref (message);
|
||||||
|
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 1);
|
||||||
|
|
||||||
|
/* clean up */
|
||||||
|
gst_object_unref (bin);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_bin_suite (void)
|
gst_bin_suite (void)
|
||||||
|
@ -127,6 +182,7 @@ gst_bin_suite (void)
|
||||||
suite_add_tcase (s, tc_chain);
|
suite_add_tcase (s, tc_chain);
|
||||||
tcase_add_test (tc_chain, test_interface);
|
tcase_add_test (tc_chain, test_interface);
|
||||||
tcase_add_test (tc_chain, test_message_state_changed);
|
tcase_add_test (tc_chain, test_message_state_changed);
|
||||||
|
tcase_add_test (tc_chain, test_message_state_changed_child);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_subbuffer)
|
GST_START_TEST (test_subbuffer)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer, *sub;
|
GstBuffer *buffer, *sub;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -41,8 +41,8 @@ START_TEST (test_subbuffer)
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_is_span_fast)
|
GST_START_TEST (test_is_span_fast)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer, *sub1, *sub2;
|
GstBuffer *buffer, *sub1, *sub2;
|
||||||
|
|
||||||
|
@ -63,7 +63,8 @@ START_TEST (test_is_span_fast)
|
||||||
fail_if (gst_buffer_is_span_fast (sub1, sub2) == FALSE,
|
fail_if (gst_buffer_is_span_fast (sub1, sub2) == FALSE,
|
||||||
"two subbuffers next to each other should be span_fast");
|
"two subbuffers next to each other should be span_fast");
|
||||||
}
|
}
|
||||||
END_TEST Suite * gst_test_suite (void)
|
GST_END_TEST Suite *
|
||||||
|
gst_test_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstBuffer");
|
Suite *s = suite_create ("GstBuffer");
|
||||||
TCase *tc_chain = tcase_create ("general");
|
TCase *tc_chain = tcase_create ("general");
|
||||||
|
|
|
@ -81,7 +81,7 @@ pull_messages ()
|
||||||
g_return_if_fail (message_ids[i] == NUM_MESSAGES);
|
g_return_if_fail (message_ids[i] == NUM_MESSAGES);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_hammer_bus)
|
GST_START_TEST (test_hammer_bus)
|
||||||
{
|
{
|
||||||
GThread *threads[NUM_THREADS];
|
GThread *threads[NUM_THREADS];
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -99,7 +99,7 @@ START_TEST (test_hammer_bus)
|
||||||
|
|
||||||
gst_object_unref ((GstObject *) test_bus);
|
gst_object_unref ((GstObject *) test_bus);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gstbus_suite (void)
|
gstbus_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstBus");
|
Suite *s = suite_create ("GstBus");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
#include "capslist.h"
|
#include "capslist.h"
|
||||||
|
|
||||||
START_TEST (test_from_string)
|
GST_START_TEST (test_from_string)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
int i;
|
int i;
|
||||||
|
@ -37,9 +37,9 @@ START_TEST (test_from_string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_buffer)
|
GST_START_TEST (test_buffer)
|
||||||
{
|
{
|
||||||
GstCaps *c1;
|
GstCaps *c1;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
@ -53,9 +53,9 @@ START_TEST (test_buffer)
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_double_append)
|
GST_START_TEST (test_double_append)
|
||||||
{
|
{
|
||||||
GstStructure *s1;
|
GstStructure *s1;
|
||||||
GstCaps *c1;
|
GstCaps *c1;
|
||||||
|
@ -66,9 +66,9 @@ START_TEST (test_double_append)
|
||||||
ASSERT_CRITICAL (gst_caps_append_structure (c1, s1));
|
ASSERT_CRITICAL (gst_caps_append_structure (c1, s1));
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_mutability)
|
GST_START_TEST (test_mutability)
|
||||||
{
|
{
|
||||||
GstStructure *s1;
|
GstStructure *s1;
|
||||||
GstCaps *c1;
|
GstCaps *c1;
|
||||||
|
@ -95,7 +95,7 @@ START_TEST (test_mutability)
|
||||||
fail_unless (ret == 1);
|
fail_unless (ret == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_caps_suite (void)
|
gst_caps_suite (void)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_copy)
|
GST_START_TEST (test_copy)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer, *copy;
|
GstBuffer *buffer, *copy;
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ START_TEST (test_copy)
|
||||||
"Copy of buffer has different size");
|
"Copy of buffer has different size");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_is_writable)
|
GST_START_TEST (test_is_writable)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
@ -60,8 +60,8 @@ START_TEST (test_is_writable)
|
||||||
"A buffer with two refs should not be writable");
|
"A buffer with two refs should not be writable");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_copy_on_write)
|
GST_START_TEST (test_copy_on_write)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data, *data2, *data3;
|
GstData *data, *data2, *data3;
|
||||||
|
@ -90,7 +90,7 @@ START_TEST (test_copy_on_write)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST gint num_threads = 10;
|
GST_END_TEST gint num_threads = 10;
|
||||||
gint refs_per_thread = 10000;
|
gint refs_per_thread = 10000;
|
||||||
|
|
||||||
/* test thread-safe refcounting of GstData */
|
/* test thread-safe refcounting of GstData */
|
||||||
|
@ -110,7 +110,7 @@ thread_ref (GstData * data)
|
||||||
g_message ("thread stopped\n");
|
g_message ("thread stopped\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_ref_threaded)
|
GST_START_TEST (test_ref_threaded)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
@ -128,7 +128,7 @@ START_TEST (test_ref_threaded)
|
||||||
fail_unless (GST_DATA_REFCOUNT_VALUE (data) == expected,
|
fail_unless (GST_DATA_REFCOUNT_VALUE (data) == expected,
|
||||||
"Refcount of data is %d != %d", GST_DATA_REFCOUNT_VALUE (data), expected);
|
"Refcount of data is %d != %d", GST_DATA_REFCOUNT_VALUE (data), expected);
|
||||||
}
|
}
|
||||||
END_TEST void
|
GST_END_TEST void
|
||||||
thread_unref (GstData * data)
|
thread_unref (GstData * data)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
@ -143,7 +143,7 @@ thread_unref (GstData * data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_unref_threaded)
|
GST_START_TEST (test_unref_threaded)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
@ -164,7 +164,7 @@ START_TEST (test_unref_threaded)
|
||||||
/* final unref */
|
/* final unref */
|
||||||
gst_data_unref (data);
|
gst_data_unref (data);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_data_suite (void)
|
gst_data_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstData");
|
Suite *s = suite_create ("GstData");
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_add_remove_pad)
|
GST_START_TEST (test_add_remove_pad)
|
||||||
{
|
{
|
||||||
GstElement *e;
|
GstElement *e;
|
||||||
GstPad *p;
|
GstPad *p;
|
||||||
|
@ -47,9 +47,9 @@ START_TEST (test_add_remove_pad)
|
||||||
gst_object_unref (p);
|
gst_object_unref (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_add_pad_unref_element)
|
GST_START_TEST (test_add_pad_unref_element)
|
||||||
{
|
{
|
||||||
GstElement *e;
|
GstElement *e;
|
||||||
GstPad *p;
|
GstPad *p;
|
||||||
|
@ -76,7 +76,7 @@ START_TEST (test_add_pad_unref_element)
|
||||||
gst_object_unref (p);
|
gst_object_unref (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
|
|
|
@ -29,7 +29,7 @@ assert_gstrefcount (gpointer p, gint i)
|
||||||
GST_OBJECT_REFCOUNT_VALUE (p));
|
GST_OBJECT_REFCOUNT_VALUE (p));
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_ghost_pads)
|
GST_START_TEST (test_ghost_pads)
|
||||||
{
|
{
|
||||||
GstElement *b1, *b2, *src, *i1, *sink;
|
GstElement *b1, *b2, *src, *i1, *sink;
|
||||||
GstPad *gsink, *gsrc, *gisrc, *gisink, *isink, *isrc, *fsrc, *fsink;
|
GstPad *gsink, *gsrc, *gisrc, *gisink, *isink, *isrc, *fsrc, *fsink;
|
||||||
|
@ -124,7 +124,7 @@ START_TEST (test_ghost_pads)
|
||||||
gst_object_unref (gisink);
|
gst_object_unref (gisink);
|
||||||
assert_gstrefcount (fsink, 1);
|
assert_gstrefcount (fsink, 1);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_ghost_pad_suite (void)
|
gst_ghost_pad_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstGhostPad");
|
Suite *s = suite_create ("GstGhostPad");
|
||||||
|
|
|
@ -37,7 +37,7 @@ make_list_of_ints (gint n)
|
||||||
|
|
||||||
#define NUM_ELEMENTS 10
|
#define NUM_ELEMENTS 10
|
||||||
|
|
||||||
START_TEST (test_manual_iteration)
|
GST_START_TEST (test_manual_iteration)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
guint32 cookie = 0;
|
guint32 cookie = 0;
|
||||||
|
@ -70,8 +70,8 @@ START_TEST (test_manual_iteration)
|
||||||
gst_iterator_free (iter);
|
gst_iterator_free (iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_resync)
|
GST_START_TEST (test_resync)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
guint32 cookie = 0;
|
guint32 cookie = 0;
|
||||||
|
@ -115,14 +115,14 @@ START_TEST (test_resync)
|
||||||
|
|
||||||
gst_iterator_free (iter);
|
gst_iterator_free (iter);
|
||||||
}
|
}
|
||||||
END_TEST static gboolean
|
GST_END_TEST static gboolean
|
||||||
add_fold_func (gpointer item, GValue * ret, gpointer user_data)
|
add_fold_func (gpointer item, GValue * ret, gpointer user_data)
|
||||||
{
|
{
|
||||||
g_value_set_int (ret, g_value_get_int (ret) + GPOINTER_TO_INT (item));
|
g_value_set_int (ret, g_value_get_int (ret) + GPOINTER_TO_INT (item));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_fold)
|
GST_START_TEST (test_fold)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
guint32 cookie = 0;
|
guint32 cookie = 0;
|
||||||
|
@ -149,7 +149,7 @@ START_TEST (test_fold)
|
||||||
g_return_if_fail (res == GST_ITERATOR_DONE);
|
g_return_if_fail (res == GST_ITERATOR_DONE);
|
||||||
g_return_if_fail (g_value_get_int (&ret) == expected);
|
g_return_if_fail (g_value_get_int (&ret) == expected);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gstiterator_suite (void)
|
gstiterator_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstIterator");
|
Suite *s = suite_create ("GstIterator");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
static GQuark domain;
|
static GQuark domain;
|
||||||
|
|
||||||
START_TEST (test_parsing)
|
GST_START_TEST (test_parsing)
|
||||||
{
|
{
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ START_TEST (test_parsing)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_data_suite (void)
|
gst_data_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstMessage");
|
Suite *s = suite_create ("GstMessage");
|
||||||
|
|
|
@ -67,7 +67,7 @@ gst_fake_object_get_type (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* g_object_new on abstract GstObject should fail */
|
/* g_object_new on abstract GstObject should fail */
|
||||||
START_TEST (test_fail_abstract_new)
|
GST_START_TEST (test_fail_abstract_new)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
|
|
||||||
|
@ -75,9 +75,9 @@ START_TEST (test_fail_abstract_new)
|
||||||
fail_unless (object == NULL, "Created an instance of abstract GstObject");
|
fail_unless (object == NULL, "Created an instance of abstract GstObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* g_object_new on GstFakeObject should succeed */
|
/* g_object_new on GstFakeObject should succeed */
|
||||||
START_TEST (test_fake_object_new)
|
GST_START_TEST (test_fake_object_new)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
|
|
||||||
|
@ -87,9 +87,9 @@ START_TEST (test_fake_object_new)
|
||||||
"GstFakeObject instance is not a GstObject");
|
"GstFakeObject instance is not a GstObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* GstFakeObject name tests */
|
/* GstFakeObject name tests */
|
||||||
START_TEST (test_fake_object_name)
|
GST_START_TEST (test_fake_object_name)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -125,7 +125,7 @@ START_TEST (test_fake_object_name)
|
||||||
g_free (name2);
|
g_free (name2);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* thread function for threaded name change test */
|
/* thread function for threaded name change test */
|
||||||
gpointer thread_name_object (GstObject * object)
|
gpointer thread_name_object (GstObject * object)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@ END_TEST
|
||||||
* constantly; fails because lock is released inbetween set and get
|
* constantly; fails because lock is released inbetween set and get
|
||||||
*/
|
*/
|
||||||
|
|
||||||
START_TEST (test_fake_object_name_threaded_wrong)
|
GST_START_TEST (test_fake_object_name_threaded_wrong)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -188,12 +188,12 @@ START_TEST (test_fake_object_name_threaded_wrong)
|
||||||
fail_unless (expected_failure, "name did not get changed");
|
fail_unless (expected_failure, "name did not get changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/*
|
/*
|
||||||
* main thread sets and gets name directly on struct inside the object lock
|
* main thread sets and gets name directly on struct inside the object lock
|
||||||
* succeed because lock is held during set/get, and threads are locked out
|
* succeed because lock is held during set/get, and threads are locked out
|
||||||
*/
|
*/
|
||||||
START_TEST (test_fake_object_name_threaded_right)
|
GST_START_TEST (test_fake_object_name_threaded_right)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -222,7 +222,7 @@ START_TEST (test_fake_object_name_threaded_right)
|
||||||
MAIN_STOP_THREADS ();
|
MAIN_STOP_THREADS ();
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/*
|
/*
|
||||||
* main thread creates lots of objects
|
* main thread creates lots of objects
|
||||||
* child threads sets default names on objects
|
* child threads sets default names on objects
|
||||||
|
@ -280,7 +280,7 @@ gst_object_name_compare (GstObject * o, GstObject * p)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_fake_object_name_threaded_unique)
|
GST_START_TEST (test_fake_object_name_threaded_unique)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -326,9 +326,9 @@ START_TEST (test_fake_object_name_threaded_unique)
|
||||||
g_list_foreach (object_list, (GFunc) g_object_unref, NULL);
|
g_list_foreach (object_list, (GFunc) g_object_unref, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* parentage test on GstFakeObject */
|
/* parentage test on GstFakeObject */
|
||||||
START_TEST (test_fake_object_parentage)
|
GST_START_TEST (test_fake_object_parentage)
|
||||||
{
|
{
|
||||||
GstObject *object1, *object2;
|
GstObject *object1, *object2;
|
||||||
GstObject *parent;
|
GstObject *parent;
|
||||||
|
@ -402,13 +402,13 @@ START_TEST (test_fake_object_parentage)
|
||||||
gst_object_unref (object2);
|
gst_object_unref (object2);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* parentage test dispose on GstFakeObject, since our testcase
|
/* parentage test dispose on GstFakeObject, since our testcase
|
||||||
* does not handle the parent relation completely, the parent does
|
* does not handle the parent relation completely, the parent does
|
||||||
* not hold a ref to the child, we cannot dispose the parent to
|
* not hold a ref to the child, we cannot dispose the parent to
|
||||||
* dipose the child as well. This test needs to be run with DEBUG
|
* dipose the child as well. This test needs to be run with DEBUG
|
||||||
* info to check if the finalize methods are called correctly. */
|
* info to check if the finalize methods are called correctly. */
|
||||||
START_TEST (test_fake_object_parentage_dispose)
|
GST_START_TEST (test_fake_object_parentage_dispose)
|
||||||
{
|
{
|
||||||
GstObject *object1, *object2;
|
GstObject *object1, *object2;
|
||||||
gboolean result;
|
gboolean result;
|
||||||
|
@ -431,7 +431,7 @@ START_TEST (test_fake_object_parentage_dispose)
|
||||||
gst_object_unref (object2);
|
gst_object_unref (object2);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* test: try renaming a parented object, make sure it fails */
|
/* test: try renaming a parented object, make sure it fails */
|
||||||
Suite * gst_object_suite (void)
|
Suite * gst_object_suite (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_link)
|
GST_START_TEST (test_link)
|
||||||
{
|
{
|
||||||
GstPad *src, *sink;
|
GstPad *src, *sink;
|
||||||
GstPadTemplate *srct;
|
GstPadTemplate *srct;
|
||||||
|
@ -48,7 +48,7 @@ START_TEST (test_link)
|
||||||
fail_unless (srct == NULL);
|
fail_unless (srct == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
/* threaded link/unlink */
|
/* threaded link/unlink */
|
||||||
/* use globals */
|
/* use globals */
|
||||||
|
@ -66,7 +66,7 @@ thread_link_unlink (gpointer data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_link_unlink_threaded)
|
GST_START_TEST (test_link_unlink_threaded)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
int i;
|
int i;
|
||||||
|
@ -89,9 +89,9 @@ START_TEST (test_link_unlink_threaded)
|
||||||
MAIN_STOP_THREADS ();
|
MAIN_STOP_THREADS ();
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_refcount)
|
GST_START_TEST (test_refcount)
|
||||||
{
|
{
|
||||||
GstPad *src, *sink;
|
GstPad *src, *sink;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -127,9 +127,9 @@ START_TEST (test_refcount)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_get_allowed_caps)
|
GST_START_TEST (test_get_allowed_caps)
|
||||||
{
|
{
|
||||||
GstPad *src, *sink;
|
GstPad *src, *sink;
|
||||||
GstCaps *caps, *gotcaps;
|
GstCaps *caps, *gotcaps;
|
||||||
|
@ -180,7 +180,7 @@ START_TEST (test_get_allowed_caps)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_pad_suite (void)
|
gst_pad_suite (void)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_from_string_int)
|
GST_START_TEST (test_from_string_int)
|
||||||
{
|
{
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
"video/x-raw-rgb, width = (int) 123456",
|
"video/x-raw-rgb, width = (int) 123456",
|
||||||
|
@ -63,7 +63,7 @@ START_TEST (test_from_string_int)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_value_suite (void)
|
gst_value_suite (void)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_signedness)
|
GST_START_TEST (test_signedness)
|
||||||
{
|
{
|
||||||
GstClockTime time[] = { 0, 1, G_MAXUINT64 / GST_SECOND };
|
GstClockTime time[] = { 0, 1, G_MAXUINT64 / GST_SECOND };
|
||||||
GstClockTimeDiff diff[] =
|
GstClockTimeDiff diff[] =
|
||||||
|
@ -36,7 +36,7 @@ START_TEST (test_signedness)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
#define TIME_UNIT GST_SECOND
|
#define TIME_UNIT GST_SECOND
|
||||||
static void
|
static void
|
||||||
gst_clock_debug (GstClock * clock)
|
gst_clock_debug (GstClock * clock)
|
||||||
|
@ -65,7 +65,7 @@ error_callback (GstClock * clock, GstClockTime time,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_single_shot)
|
GST_START_TEST (test_single_shot)
|
||||||
{
|
{
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
GstClockID id, id2;
|
GstClockID id, id2;
|
||||||
|
@ -128,8 +128,8 @@ START_TEST (test_single_shot)
|
||||||
g_usleep (2 * G_USEC_PER_SEC);
|
g_usleep (2 * G_USEC_PER_SEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_periodic_shot)
|
GST_START_TEST (test_periodic_shot)
|
||||||
{
|
{
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
GstClockID id, id2;
|
GstClockID id, id2;
|
||||||
|
@ -187,7 +187,7 @@ START_TEST (test_periodic_shot)
|
||||||
g_usleep (2 * G_USEC_PER_SEC);
|
g_usleep (2 * G_USEC_PER_SEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite * gst_systemclock_suite (void)
|
GST_END_TEST Suite * gst_systemclock_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstSystemClock");
|
Suite *s = suite_create ("GstSystemClock");
|
||||||
TCase *tc_chain = tcase_create ("waiting");
|
TCase *tc_chain = tcase_create ("waiting");
|
||||||
|
|
|
@ -102,7 +102,7 @@ G_STMT_START { \
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_merge)
|
GST_START_TEST (test_merge)
|
||||||
{
|
{
|
||||||
GstTagList *list = NULL, *list2 = NULL, *merge = NULL;
|
GstTagList *list = NULL, *list2 = NULL, *merge = NULL;
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ START_TEST (test_merge)
|
||||||
check_tags (merge, FTAG, FIXED1, NULL);
|
check_tags (merge, FTAG, FIXED1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_tag_suite (void)
|
gst_tag_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstTag");
|
Suite *s = suite_create ("GstTag");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_deserialize_buffer)
|
GST_START_TEST (test_deserialize_buffer)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
|
|
||||||
|
@ -32,9 +32,9 @@ START_TEST (test_deserialize_buffer)
|
||||||
fail_unless (gst_value_deserialize (&value, "1234567890abcdef"));
|
fail_unless (gst_value_deserialize (&value, "1234567890abcdef"));
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_gint64)
|
GST_START_TEST (test_deserialize_gint64)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -58,9 +58,9 @@ START_TEST (test_deserialize_gint64)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_gint)
|
GST_START_TEST (test_deserialize_gint)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -112,9 +112,9 @@ START_TEST (test_deserialize_gint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_gint_failures)
|
GST_START_TEST (test_deserialize_gint_failures)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -138,9 +138,9 @@ START_TEST (test_deserialize_gint_failures)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_guint)
|
GST_START_TEST (test_deserialize_guint)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -192,9 +192,9 @@ START_TEST (test_deserialize_guint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_guint_failures)
|
GST_START_TEST (test_deserialize_guint_failures)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -222,10 +222,10 @@ START_TEST (test_deserialize_guint_failures)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_string)
|
GST_START_TEST (test_string)
|
||||||
{
|
{
|
||||||
gchar *try[] = {
|
gchar *try[] = {
|
||||||
"Dude",
|
"Dude",
|
||||||
|
@ -252,9 +252,9 @@ START_TEST (test_string)
|
||||||
g_value_unset (&v);
|
g_value_unset (&v);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_string)
|
GST_START_TEST (test_deserialize_string)
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,7 @@ START_TEST (test_deserialize_string)
|
||||||
g_value_unset (&v);
|
g_value_unset (&v);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_value_suite (void)
|
gst_value_suite (void)
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "gstcheck.h"
|
#include "gstcheck.h"
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY (check_debug);
|
||||||
|
|
||||||
/* logging function for tests
|
/* logging function for tests
|
||||||
* a test uses g_message() to log a debug line
|
* a test uses g_message() to log a debug line
|
||||||
|
@ -71,6 +72,8 @@ gst_check_init (int *argc, char **argv[])
|
||||||
{
|
{
|
||||||
gst_init (argc, argv);
|
gst_init (argc, argv);
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (check_debug, "check", 0, "check regression tests");
|
||||||
|
|
||||||
if (g_getenv ("GST_TEST_DEBUG"))
|
if (g_getenv ("GST_TEST_DEBUG"))
|
||||||
_gst_check_debug = TRUE;
|
_gst_check_debug = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_EXTERN (check_debug);
|
||||||
|
#define GST_CAT_DEFAULT check_debug
|
||||||
|
|
||||||
/* logging function for tests
|
/* logging function for tests
|
||||||
* a test uses g_message() to log a debug line
|
* a test uses g_message() to log a debug line
|
||||||
* a gst unit test can be run with GST_TEST_DEBUG env var set to see the
|
* a gst unit test can be run with GST_TEST_DEBUG env var set to see the
|
||||||
|
@ -42,6 +45,17 @@ extern gboolean _gst_check_expecting_log;
|
||||||
|
|
||||||
void gst_check_init (int *argc, char **argv[]);
|
void gst_check_init (int *argc, char **argv[]);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* wrappers for START_TEST and END_TEST
|
||||||
|
*/
|
||||||
|
#define GST_START_TEST(__testname) \
|
||||||
|
static void __testname (void)\
|
||||||
|
{\
|
||||||
|
GST_DEBUG ("test start"); \
|
||||||
|
tcase_fn_start (""# __testname, __FILE__, __LINE__);
|
||||||
|
|
||||||
|
#define GST_END_TEST END_TEST
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* thread test macros and variables
|
* thread test macros and variables
|
||||||
*/
|
*/
|
||||||
|
@ -134,6 +148,7 @@ G_STMT_START { \
|
||||||
|
|
||||||
#define THREAD_TEST_RUNNING() (_gst_check_threads_running == TRUE)
|
#define THREAD_TEST_RUNNING() (_gst_check_threads_running == TRUE)
|
||||||
|
|
||||||
|
/* additional assertions */
|
||||||
#define ASSERT_CRITICAL(code) \
|
#define ASSERT_CRITICAL(code) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
_gst_check_expecting_log = TRUE; \
|
_gst_check_expecting_log = TRUE; \
|
||||||
|
|
|
@ -71,7 +71,7 @@ run_pipeline (GstElement * pipe, gchar * descr,
|
||||||
gst_object_unref (pipe);
|
gst_object_unref (pipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_pipeline_unref)
|
GST_START_TEST (test_pipeline_unref)
|
||||||
{
|
{
|
||||||
gchar *s;
|
gchar *s;
|
||||||
gint count;
|
gint count;
|
||||||
|
@ -94,7 +94,7 @@ START_TEST (test_pipeline_unref)
|
||||||
gst_object_unref (sink);
|
gst_object_unref (sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
cleanup_suite (void)
|
cleanup_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("Pipeline cleanup");
|
Suite *s = suite_create ("Pipeline cleanup");
|
||||||
|
|
|
@ -71,7 +71,7 @@ run_pipeline (GstElement * pipe, gchar * descr,
|
||||||
gst_object_unref (pipe);
|
gst_object_unref (pipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_2_elements)
|
GST_START_TEST (test_2_elements)
|
||||||
{
|
{
|
||||||
gchar *s;
|
gchar *s;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ START_TEST (test_2_elements)
|
||||||
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
|
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
|
||||||
GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN)); */
|
GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN)); */
|
||||||
}
|
}
|
||||||
END_TEST static void
|
GST_END_TEST static void
|
||||||
got_handoff (GstElement * sink, GstBuffer * buf, GstPad * pad, gpointer unused)
|
got_handoff (GstElement * sink, GstBuffer * buf, GstPad * pad, gpointer unused)
|
||||||
{
|
{
|
||||||
gst_element_post_message
|
gst_element_post_message
|
||||||
|
@ -125,7 +125,7 @@ assert_live_count (GType type, gint live)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_stop_from_app)
|
GST_START_TEST (test_stop_from_app)
|
||||||
{
|
{
|
||||||
GstElement *fakesrc, *fakesink, *pipeline;
|
GstElement *fakesrc, *fakesink, *pipeline;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
|
@ -161,7 +161,7 @@ START_TEST (test_stop_from_app)
|
||||||
|
|
||||||
assert_live_count (GST_TYPE_BUFFER, 0);
|
assert_live_count (GST_TYPE_BUFFER, 0);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
simple_launch_lines_suite (void)
|
simple_launch_lines_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("Pipelines");
|
Suite *s = suite_create ("Pipelines");
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
/* a sink should go ASYNC to PAUSE. forcing PLAYING is possible */
|
/* a sink should go ASYNC to PAUSE. forcing PLAYING is possible */
|
||||||
START_TEST (test_sink)
|
GST_START_TEST (test_sink)
|
||||||
{
|
{
|
||||||
GstElement *sink;
|
GstElement *sink;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -43,10 +43,10 @@ START_TEST (test_sink)
|
||||||
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* a sink should go ASYNC to PAUSE. PAUSE should complete when
|
/* a sink should go ASYNC to PAUSE. PAUSE should complete when
|
||||||
* prerolled. */
|
* prerolled. */
|
||||||
START_TEST (test_src_sink)
|
GST_START_TEST (test_src_sink)
|
||||||
{
|
{
|
||||||
GstElement *sink, *src, *pipeline;
|
GstElement *sink, *src, *pipeline;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -79,11 +79,11 @@ START_TEST (test_src_sink)
|
||||||
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* a pipeline with live source should return NO_PREROLL in
|
/* a pipeline with live source should return NO_PREROLL in
|
||||||
* PAUSE. When removing the live source it should return ASYNC
|
* PAUSE. When removing the live source it should return ASYNC
|
||||||
* from the sink */
|
* from the sink */
|
||||||
START_TEST (test_livesrc_remove)
|
GST_START_TEST (test_livesrc_remove)
|
||||||
{
|
{
|
||||||
GstElement *sink, *src, *pipeline;
|
GstElement *sink, *src, *pipeline;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -123,10 +123,10 @@ START_TEST (test_livesrc_remove)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* a sink should go ASYNC to PAUSE. PAUSE does not complete
|
/* a sink should go ASYNC to PAUSE. PAUSE does not complete
|
||||||
* since we have a live source. */
|
* since we have a live source. */
|
||||||
START_TEST (test_livesrc_sink)
|
GST_START_TEST (test_livesrc_sink)
|
||||||
{
|
{
|
||||||
GstElement *sink, *src, *pipeline;
|
GstElement *sink, *src, *pipeline;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -169,7 +169,7 @@ START_TEST (test_livesrc_sink)
|
||||||
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* test: try changing state of sinks */
|
/* test: try changing state of sinks */
|
||||||
Suite * gst_object_suite (void)
|
Suite * gst_object_suite (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ event_func (GstPad * pad, GstEvent * event)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_num_buffers)
|
GST_START_TEST (test_num_buffers)
|
||||||
{
|
{
|
||||||
GstElement *src;
|
GstElement *src;
|
||||||
GstScheduler *scheduler;
|
GstScheduler *scheduler;
|
||||||
|
@ -95,7 +95,7 @@ START_TEST (test_num_buffers)
|
||||||
g_list_free (buffers);
|
g_list_free (buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
fakesrc_suite (void)
|
fakesrc_suite (void)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
/* a sink should go ASYNC to PAUSE. forcing PLAYING is possible */
|
/* a sink should go ASYNC to PAUSE. forcing PLAYING is possible */
|
||||||
START_TEST (test_sink)
|
GST_START_TEST (test_sink)
|
||||||
{
|
{
|
||||||
GstElement *sink;
|
GstElement *sink;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -43,10 +43,10 @@ START_TEST (test_sink)
|
||||||
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* a sink should go ASYNC to PAUSE. PAUSE should complete when
|
/* a sink should go ASYNC to PAUSE. PAUSE should complete when
|
||||||
* prerolled. */
|
* prerolled. */
|
||||||
START_TEST (test_src_sink)
|
GST_START_TEST (test_src_sink)
|
||||||
{
|
{
|
||||||
GstElement *sink, *src, *pipeline;
|
GstElement *sink, *src, *pipeline;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -79,11 +79,11 @@ START_TEST (test_src_sink)
|
||||||
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* a pipeline with live source should return NO_PREROLL in
|
/* a pipeline with live source should return NO_PREROLL in
|
||||||
* PAUSE. When removing the live source it should return ASYNC
|
* PAUSE. When removing the live source it should return ASYNC
|
||||||
* from the sink */
|
* from the sink */
|
||||||
START_TEST (test_livesrc_remove)
|
GST_START_TEST (test_livesrc_remove)
|
||||||
{
|
{
|
||||||
GstElement *sink, *src, *pipeline;
|
GstElement *sink, *src, *pipeline;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -123,10 +123,10 @@ START_TEST (test_livesrc_remove)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* a sink should go ASYNC to PAUSE. PAUSE does not complete
|
/* a sink should go ASYNC to PAUSE. PAUSE does not complete
|
||||||
* since we have a live source. */
|
* since we have a live source. */
|
||||||
START_TEST (test_livesrc_sink)
|
GST_START_TEST (test_livesrc_sink)
|
||||||
{
|
{
|
||||||
GstElement *sink, *src, *pipeline;
|
GstElement *sink, *src, *pipeline;
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
@ -169,7 +169,7 @@ START_TEST (test_livesrc_sink)
|
||||||
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* test: try changing state of sinks */
|
/* test: try changing state of sinks */
|
||||||
Suite * gst_object_suite (void)
|
Suite * gst_object_suite (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_init)
|
GST_START_TEST (test_init)
|
||||||
{
|
{
|
||||||
/* don't segfault with NULL, NULL */
|
/* don't segfault with NULL, NULL */
|
||||||
gst_init (NULL, NULL);
|
gst_init (NULL, NULL);
|
||||||
|
@ -29,7 +29,7 @@ START_TEST (test_init)
|
||||||
gst_init (NULL, NULL);
|
gst_init (NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_suite (void)
|
gst_suite (void)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_interface)
|
GST_START_TEST (test_interface)
|
||||||
{
|
{
|
||||||
GstBin *bin, *bin2;
|
GstBin *bin, *bin2;
|
||||||
GstElement *filesrc;
|
GstElement *filesrc;
|
||||||
|
@ -83,9 +83,9 @@ START_TEST (test_interface)
|
||||||
gst_object_unref (bin);
|
gst_object_unref (bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_message_state_changed)
|
GST_START_TEST (test_message_state_changed)
|
||||||
{
|
{
|
||||||
GstBin *bin;
|
GstBin *bin;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
|
@ -116,7 +116,62 @@ START_TEST (test_message_state_changed)
|
||||||
gst_object_unref (bin);
|
gst_object_unref (bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
GST_START_TEST (test_message_state_changed_child)
|
||||||
|
{
|
||||||
|
GstBin *bin;
|
||||||
|
GstElement *src;
|
||||||
|
GstBus *bus;
|
||||||
|
GstMessage *message;
|
||||||
|
|
||||||
|
bin = GST_BIN (gst_bin_new (NULL));
|
||||||
|
fail_unless (bin != NULL, "Could not create bin");
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 1);
|
||||||
|
|
||||||
|
src = gst_element_factory_make ("fakesrc", NULL);
|
||||||
|
fail_if (src == NULL, "Could not create fakesrc");
|
||||||
|
gst_bin_add (bin, src);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 1);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||||
|
|
||||||
|
bus = GST_ELEMENT_BUS (bin);
|
||||||
|
|
||||||
|
/* change state, spawning three messages:
|
||||||
|
* - first for fakesrc, causing incref on fakesrc
|
||||||
|
* - then two on bin, causing an incref on the bin */
|
||||||
|
GST_DEBUG ("setting bin to READY");
|
||||||
|
gst_element_set_state (GST_ELEMENT (bin), GST_STATE_READY);
|
||||||
|
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 2);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 2);
|
||||||
|
|
||||||
|
/* get and unref the message, causing a decref on the src */
|
||||||
|
fail_unless (gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1)
|
||||||
|
== GST_MESSAGE_STATE_CHANGED, "did not get GST_MESSAGE_STATE_CHANGED");
|
||||||
|
|
||||||
|
message = gst_bus_pop (bus);
|
||||||
|
gst_message_unref (message);
|
||||||
|
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 2);
|
||||||
|
|
||||||
|
/* get and unref message 2, causing a decref on the bin */
|
||||||
|
fail_unless (gst_bus_poll (bus, GST_MESSAGE_STATE_CHANGED, -1)
|
||||||
|
== GST_MESSAGE_STATE_CHANGED, "did not get GST_MESSAGE_STATE_CHANGED");
|
||||||
|
|
||||||
|
message = gst_bus_pop (bus);
|
||||||
|
gst_message_unref (message);
|
||||||
|
|
||||||
|
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||||
|
ASSERT_OBJECT_REFCOUNT (bin, "bin", 1);
|
||||||
|
|
||||||
|
/* clean up */
|
||||||
|
gst_object_unref (bin);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_bin_suite (void)
|
gst_bin_suite (void)
|
||||||
|
@ -127,6 +182,7 @@ gst_bin_suite (void)
|
||||||
suite_add_tcase (s, tc_chain);
|
suite_add_tcase (s, tc_chain);
|
||||||
tcase_add_test (tc_chain, test_interface);
|
tcase_add_test (tc_chain, test_interface);
|
||||||
tcase_add_test (tc_chain, test_message_state_changed);
|
tcase_add_test (tc_chain, test_message_state_changed);
|
||||||
|
tcase_add_test (tc_chain, test_message_state_changed_child);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_subbuffer)
|
GST_START_TEST (test_subbuffer)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer, *sub;
|
GstBuffer *buffer, *sub;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -41,8 +41,8 @@ START_TEST (test_subbuffer)
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_is_span_fast)
|
GST_START_TEST (test_is_span_fast)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer, *sub1, *sub2;
|
GstBuffer *buffer, *sub1, *sub2;
|
||||||
|
|
||||||
|
@ -63,7 +63,8 @@ START_TEST (test_is_span_fast)
|
||||||
fail_if (gst_buffer_is_span_fast (sub1, sub2) == FALSE,
|
fail_if (gst_buffer_is_span_fast (sub1, sub2) == FALSE,
|
||||||
"two subbuffers next to each other should be span_fast");
|
"two subbuffers next to each other should be span_fast");
|
||||||
}
|
}
|
||||||
END_TEST Suite * gst_test_suite (void)
|
GST_END_TEST Suite *
|
||||||
|
gst_test_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstBuffer");
|
Suite *s = suite_create ("GstBuffer");
|
||||||
TCase *tc_chain = tcase_create ("general");
|
TCase *tc_chain = tcase_create ("general");
|
||||||
|
|
|
@ -81,7 +81,7 @@ pull_messages ()
|
||||||
g_return_if_fail (message_ids[i] == NUM_MESSAGES);
|
g_return_if_fail (message_ids[i] == NUM_MESSAGES);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_hammer_bus)
|
GST_START_TEST (test_hammer_bus)
|
||||||
{
|
{
|
||||||
GThread *threads[NUM_THREADS];
|
GThread *threads[NUM_THREADS];
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -99,7 +99,7 @@ START_TEST (test_hammer_bus)
|
||||||
|
|
||||||
gst_object_unref ((GstObject *) test_bus);
|
gst_object_unref ((GstObject *) test_bus);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gstbus_suite (void)
|
gstbus_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstBus");
|
Suite *s = suite_create ("GstBus");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
#include "capslist.h"
|
#include "capslist.h"
|
||||||
|
|
||||||
START_TEST (test_from_string)
|
GST_START_TEST (test_from_string)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
int i;
|
int i;
|
||||||
|
@ -37,9 +37,9 @@ START_TEST (test_from_string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_buffer)
|
GST_START_TEST (test_buffer)
|
||||||
{
|
{
|
||||||
GstCaps *c1;
|
GstCaps *c1;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
@ -53,9 +53,9 @@ START_TEST (test_buffer)
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_double_append)
|
GST_START_TEST (test_double_append)
|
||||||
{
|
{
|
||||||
GstStructure *s1;
|
GstStructure *s1;
|
||||||
GstCaps *c1;
|
GstCaps *c1;
|
||||||
|
@ -66,9 +66,9 @@ START_TEST (test_double_append)
|
||||||
ASSERT_CRITICAL (gst_caps_append_structure (c1, s1));
|
ASSERT_CRITICAL (gst_caps_append_structure (c1, s1));
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_mutability)
|
GST_START_TEST (test_mutability)
|
||||||
{
|
{
|
||||||
GstStructure *s1;
|
GstStructure *s1;
|
||||||
GstCaps *c1;
|
GstCaps *c1;
|
||||||
|
@ -95,7 +95,7 @@ START_TEST (test_mutability)
|
||||||
fail_unless (ret == 1);
|
fail_unless (ret == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_caps_suite (void)
|
gst_caps_suite (void)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_copy)
|
GST_START_TEST (test_copy)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer, *copy;
|
GstBuffer *buffer, *copy;
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ START_TEST (test_copy)
|
||||||
"Copy of buffer has different size");
|
"Copy of buffer has different size");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_is_writable)
|
GST_START_TEST (test_is_writable)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
@ -60,8 +60,8 @@ START_TEST (test_is_writable)
|
||||||
"A buffer with two refs should not be writable");
|
"A buffer with two refs should not be writable");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_copy_on_write)
|
GST_START_TEST (test_copy_on_write)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data, *data2, *data3;
|
GstData *data, *data2, *data3;
|
||||||
|
@ -90,7 +90,7 @@ START_TEST (test_copy_on_write)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST gint num_threads = 10;
|
GST_END_TEST gint num_threads = 10;
|
||||||
gint refs_per_thread = 10000;
|
gint refs_per_thread = 10000;
|
||||||
|
|
||||||
/* test thread-safe refcounting of GstData */
|
/* test thread-safe refcounting of GstData */
|
||||||
|
@ -110,7 +110,7 @@ thread_ref (GstData * data)
|
||||||
g_message ("thread stopped\n");
|
g_message ("thread stopped\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_ref_threaded)
|
GST_START_TEST (test_ref_threaded)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
@ -128,7 +128,7 @@ START_TEST (test_ref_threaded)
|
||||||
fail_unless (GST_DATA_REFCOUNT_VALUE (data) == expected,
|
fail_unless (GST_DATA_REFCOUNT_VALUE (data) == expected,
|
||||||
"Refcount of data is %d != %d", GST_DATA_REFCOUNT_VALUE (data), expected);
|
"Refcount of data is %d != %d", GST_DATA_REFCOUNT_VALUE (data), expected);
|
||||||
}
|
}
|
||||||
END_TEST void
|
GST_END_TEST void
|
||||||
thread_unref (GstData * data)
|
thread_unref (GstData * data)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
@ -143,7 +143,7 @@ thread_unref (GstData * data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_unref_threaded)
|
GST_START_TEST (test_unref_threaded)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
@ -164,7 +164,7 @@ START_TEST (test_unref_threaded)
|
||||||
/* final unref */
|
/* final unref */
|
||||||
gst_data_unref (data);
|
gst_data_unref (data);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_data_suite (void)
|
gst_data_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstData");
|
Suite *s = suite_create ("GstData");
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_add_remove_pad)
|
GST_START_TEST (test_add_remove_pad)
|
||||||
{
|
{
|
||||||
GstElement *e;
|
GstElement *e;
|
||||||
GstPad *p;
|
GstPad *p;
|
||||||
|
@ -47,9 +47,9 @@ START_TEST (test_add_remove_pad)
|
||||||
gst_object_unref (p);
|
gst_object_unref (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_add_pad_unref_element)
|
GST_START_TEST (test_add_pad_unref_element)
|
||||||
{
|
{
|
||||||
GstElement *e;
|
GstElement *e;
|
||||||
GstPad *p;
|
GstPad *p;
|
||||||
|
@ -76,7 +76,7 @@ START_TEST (test_add_pad_unref_element)
|
||||||
gst_object_unref (p);
|
gst_object_unref (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
|
|
|
@ -29,7 +29,7 @@ assert_gstrefcount (gpointer p, gint i)
|
||||||
GST_OBJECT_REFCOUNT_VALUE (p));
|
GST_OBJECT_REFCOUNT_VALUE (p));
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_ghost_pads)
|
GST_START_TEST (test_ghost_pads)
|
||||||
{
|
{
|
||||||
GstElement *b1, *b2, *src, *i1, *sink;
|
GstElement *b1, *b2, *src, *i1, *sink;
|
||||||
GstPad *gsink, *gsrc, *gisrc, *gisink, *isink, *isrc, *fsrc, *fsink;
|
GstPad *gsink, *gsrc, *gisrc, *gisink, *isink, *isrc, *fsrc, *fsink;
|
||||||
|
@ -124,7 +124,7 @@ START_TEST (test_ghost_pads)
|
||||||
gst_object_unref (gisink);
|
gst_object_unref (gisink);
|
||||||
assert_gstrefcount (fsink, 1);
|
assert_gstrefcount (fsink, 1);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_ghost_pad_suite (void)
|
gst_ghost_pad_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstGhostPad");
|
Suite *s = suite_create ("GstGhostPad");
|
||||||
|
|
|
@ -37,7 +37,7 @@ make_list_of_ints (gint n)
|
||||||
|
|
||||||
#define NUM_ELEMENTS 10
|
#define NUM_ELEMENTS 10
|
||||||
|
|
||||||
START_TEST (test_manual_iteration)
|
GST_START_TEST (test_manual_iteration)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
guint32 cookie = 0;
|
guint32 cookie = 0;
|
||||||
|
@ -70,8 +70,8 @@ START_TEST (test_manual_iteration)
|
||||||
gst_iterator_free (iter);
|
gst_iterator_free (iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_resync)
|
GST_START_TEST (test_resync)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
guint32 cookie = 0;
|
guint32 cookie = 0;
|
||||||
|
@ -115,14 +115,14 @@ START_TEST (test_resync)
|
||||||
|
|
||||||
gst_iterator_free (iter);
|
gst_iterator_free (iter);
|
||||||
}
|
}
|
||||||
END_TEST static gboolean
|
GST_END_TEST static gboolean
|
||||||
add_fold_func (gpointer item, GValue * ret, gpointer user_data)
|
add_fold_func (gpointer item, GValue * ret, gpointer user_data)
|
||||||
{
|
{
|
||||||
g_value_set_int (ret, g_value_get_int (ret) + GPOINTER_TO_INT (item));
|
g_value_set_int (ret, g_value_get_int (ret) + GPOINTER_TO_INT (item));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_fold)
|
GST_START_TEST (test_fold)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
guint32 cookie = 0;
|
guint32 cookie = 0;
|
||||||
|
@ -149,7 +149,7 @@ START_TEST (test_fold)
|
||||||
g_return_if_fail (res == GST_ITERATOR_DONE);
|
g_return_if_fail (res == GST_ITERATOR_DONE);
|
||||||
g_return_if_fail (g_value_get_int (&ret) == expected);
|
g_return_if_fail (g_value_get_int (&ret) == expected);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gstiterator_suite (void)
|
gstiterator_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstIterator");
|
Suite *s = suite_create ("GstIterator");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
static GQuark domain;
|
static GQuark domain;
|
||||||
|
|
||||||
START_TEST (test_parsing)
|
GST_START_TEST (test_parsing)
|
||||||
{
|
{
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ START_TEST (test_parsing)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_data_suite (void)
|
gst_data_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstMessage");
|
Suite *s = suite_create ("GstMessage");
|
||||||
|
|
|
@ -67,7 +67,7 @@ gst_fake_object_get_type (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* g_object_new on abstract GstObject should fail */
|
/* g_object_new on abstract GstObject should fail */
|
||||||
START_TEST (test_fail_abstract_new)
|
GST_START_TEST (test_fail_abstract_new)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
|
|
||||||
|
@ -75,9 +75,9 @@ START_TEST (test_fail_abstract_new)
|
||||||
fail_unless (object == NULL, "Created an instance of abstract GstObject");
|
fail_unless (object == NULL, "Created an instance of abstract GstObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* g_object_new on GstFakeObject should succeed */
|
/* g_object_new on GstFakeObject should succeed */
|
||||||
START_TEST (test_fake_object_new)
|
GST_START_TEST (test_fake_object_new)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
|
|
||||||
|
@ -87,9 +87,9 @@ START_TEST (test_fake_object_new)
|
||||||
"GstFakeObject instance is not a GstObject");
|
"GstFakeObject instance is not a GstObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* GstFakeObject name tests */
|
/* GstFakeObject name tests */
|
||||||
START_TEST (test_fake_object_name)
|
GST_START_TEST (test_fake_object_name)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -125,7 +125,7 @@ START_TEST (test_fake_object_name)
|
||||||
g_free (name2);
|
g_free (name2);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* thread function for threaded name change test */
|
/* thread function for threaded name change test */
|
||||||
gpointer thread_name_object (GstObject * object)
|
gpointer thread_name_object (GstObject * object)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@ END_TEST
|
||||||
* constantly; fails because lock is released inbetween set and get
|
* constantly; fails because lock is released inbetween set and get
|
||||||
*/
|
*/
|
||||||
|
|
||||||
START_TEST (test_fake_object_name_threaded_wrong)
|
GST_START_TEST (test_fake_object_name_threaded_wrong)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -188,12 +188,12 @@ START_TEST (test_fake_object_name_threaded_wrong)
|
||||||
fail_unless (expected_failure, "name did not get changed");
|
fail_unless (expected_failure, "name did not get changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/*
|
/*
|
||||||
* main thread sets and gets name directly on struct inside the object lock
|
* main thread sets and gets name directly on struct inside the object lock
|
||||||
* succeed because lock is held during set/get, and threads are locked out
|
* succeed because lock is held during set/get, and threads are locked out
|
||||||
*/
|
*/
|
||||||
START_TEST (test_fake_object_name_threaded_right)
|
GST_START_TEST (test_fake_object_name_threaded_right)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -222,7 +222,7 @@ START_TEST (test_fake_object_name_threaded_right)
|
||||||
MAIN_STOP_THREADS ();
|
MAIN_STOP_THREADS ();
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/*
|
/*
|
||||||
* main thread creates lots of objects
|
* main thread creates lots of objects
|
||||||
* child threads sets default names on objects
|
* child threads sets default names on objects
|
||||||
|
@ -280,7 +280,7 @@ gst_object_name_compare (GstObject * o, GstObject * p)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_fake_object_name_threaded_unique)
|
GST_START_TEST (test_fake_object_name_threaded_unique)
|
||||||
{
|
{
|
||||||
GstObject *object;
|
GstObject *object;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -326,9 +326,9 @@ START_TEST (test_fake_object_name_threaded_unique)
|
||||||
g_list_foreach (object_list, (GFunc) g_object_unref, NULL);
|
g_list_foreach (object_list, (GFunc) g_object_unref, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* parentage test on GstFakeObject */
|
/* parentage test on GstFakeObject */
|
||||||
START_TEST (test_fake_object_parentage)
|
GST_START_TEST (test_fake_object_parentage)
|
||||||
{
|
{
|
||||||
GstObject *object1, *object2;
|
GstObject *object1, *object2;
|
||||||
GstObject *parent;
|
GstObject *parent;
|
||||||
|
@ -402,13 +402,13 @@ START_TEST (test_fake_object_parentage)
|
||||||
gst_object_unref (object2);
|
gst_object_unref (object2);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* parentage test dispose on GstFakeObject, since our testcase
|
/* parentage test dispose on GstFakeObject, since our testcase
|
||||||
* does not handle the parent relation completely, the parent does
|
* does not handle the parent relation completely, the parent does
|
||||||
* not hold a ref to the child, we cannot dispose the parent to
|
* not hold a ref to the child, we cannot dispose the parent to
|
||||||
* dipose the child as well. This test needs to be run with DEBUG
|
* dipose the child as well. This test needs to be run with DEBUG
|
||||||
* info to check if the finalize methods are called correctly. */
|
* info to check if the finalize methods are called correctly. */
|
||||||
START_TEST (test_fake_object_parentage_dispose)
|
GST_START_TEST (test_fake_object_parentage_dispose)
|
||||||
{
|
{
|
||||||
GstObject *object1, *object2;
|
GstObject *object1, *object2;
|
||||||
gboolean result;
|
gboolean result;
|
||||||
|
@ -431,7 +431,7 @@ START_TEST (test_fake_object_parentage_dispose)
|
||||||
gst_object_unref (object2);
|
gst_object_unref (object2);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* test: try renaming a parented object, make sure it fails */
|
/* test: try renaming a parented object, make sure it fails */
|
||||||
Suite * gst_object_suite (void)
|
Suite * gst_object_suite (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_link)
|
GST_START_TEST (test_link)
|
||||||
{
|
{
|
||||||
GstPad *src, *sink;
|
GstPad *src, *sink;
|
||||||
GstPadTemplate *srct;
|
GstPadTemplate *srct;
|
||||||
|
@ -48,7 +48,7 @@ START_TEST (test_link)
|
||||||
fail_unless (srct == NULL);
|
fail_unless (srct == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
/* threaded link/unlink */
|
/* threaded link/unlink */
|
||||||
/* use globals */
|
/* use globals */
|
||||||
|
@ -66,7 +66,7 @@ thread_link_unlink (gpointer data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_link_unlink_threaded)
|
GST_START_TEST (test_link_unlink_threaded)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
int i;
|
int i;
|
||||||
|
@ -89,9 +89,9 @@ START_TEST (test_link_unlink_threaded)
|
||||||
MAIN_STOP_THREADS ();
|
MAIN_STOP_THREADS ();
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_refcount)
|
GST_START_TEST (test_refcount)
|
||||||
{
|
{
|
||||||
GstPad *src, *sink;
|
GstPad *src, *sink;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -127,9 +127,9 @@ START_TEST (test_refcount)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_get_allowed_caps)
|
GST_START_TEST (test_get_allowed_caps)
|
||||||
{
|
{
|
||||||
GstPad *src, *sink;
|
GstPad *src, *sink;
|
||||||
GstCaps *caps, *gotcaps;
|
GstCaps *caps, *gotcaps;
|
||||||
|
@ -180,7 +180,7 @@ START_TEST (test_get_allowed_caps)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_pad_suite (void)
|
gst_pad_suite (void)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_from_string_int)
|
GST_START_TEST (test_from_string_int)
|
||||||
{
|
{
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
"video/x-raw-rgb, width = (int) 123456",
|
"video/x-raw-rgb, width = (int) 123456",
|
||||||
|
@ -63,7 +63,7 @@ START_TEST (test_from_string_int)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_value_suite (void)
|
gst_value_suite (void)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
START_TEST (test_signedness)
|
GST_START_TEST (test_signedness)
|
||||||
{
|
{
|
||||||
GstClockTime time[] = { 0, 1, G_MAXUINT64 / GST_SECOND };
|
GstClockTime time[] = { 0, 1, G_MAXUINT64 / GST_SECOND };
|
||||||
GstClockTimeDiff diff[] =
|
GstClockTimeDiff diff[] =
|
||||||
|
@ -36,7 +36,7 @@ START_TEST (test_signedness)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
#define TIME_UNIT GST_SECOND
|
#define TIME_UNIT GST_SECOND
|
||||||
static void
|
static void
|
||||||
gst_clock_debug (GstClock * clock)
|
gst_clock_debug (GstClock * clock)
|
||||||
|
@ -65,7 +65,7 @@ error_callback (GstClock * clock, GstClockTime time,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_single_shot)
|
GST_START_TEST (test_single_shot)
|
||||||
{
|
{
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
GstClockID id, id2;
|
GstClockID id, id2;
|
||||||
|
@ -128,8 +128,8 @@ START_TEST (test_single_shot)
|
||||||
g_usleep (2 * G_USEC_PER_SEC);
|
g_usleep (2 * G_USEC_PER_SEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_periodic_shot)
|
GST_START_TEST (test_periodic_shot)
|
||||||
{
|
{
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
GstClockID id, id2;
|
GstClockID id, id2;
|
||||||
|
@ -187,7 +187,7 @@ START_TEST (test_periodic_shot)
|
||||||
g_usleep (2 * G_USEC_PER_SEC);
|
g_usleep (2 * G_USEC_PER_SEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite * gst_systemclock_suite (void)
|
GST_END_TEST Suite * gst_systemclock_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstSystemClock");
|
Suite *s = suite_create ("GstSystemClock");
|
||||||
TCase *tc_chain = tcase_create ("waiting");
|
TCase *tc_chain = tcase_create ("waiting");
|
||||||
|
|
|
@ -102,7 +102,7 @@ G_STMT_START { \
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_merge)
|
GST_START_TEST (test_merge)
|
||||||
{
|
{
|
||||||
GstTagList *list = NULL, *list2 = NULL, *merge = NULL;
|
GstTagList *list = NULL, *list2 = NULL, *merge = NULL;
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ START_TEST (test_merge)
|
||||||
check_tags (merge, FTAG, FIXED1, NULL);
|
check_tags (merge, FTAG, FIXED1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_tag_suite (void)
|
gst_tag_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("GstTag");
|
Suite *s = suite_create ("GstTag");
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "../gstcheck.h"
|
#include "../gstcheck.h"
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_deserialize_buffer)
|
GST_START_TEST (test_deserialize_buffer)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
|
|
||||||
|
@ -32,9 +32,9 @@ START_TEST (test_deserialize_buffer)
|
||||||
fail_unless (gst_value_deserialize (&value, "1234567890abcdef"));
|
fail_unless (gst_value_deserialize (&value, "1234567890abcdef"));
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_gint64)
|
GST_START_TEST (test_deserialize_gint64)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -58,9 +58,9 @@ START_TEST (test_deserialize_gint64)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_gint)
|
GST_START_TEST (test_deserialize_gint)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -112,9 +112,9 @@ START_TEST (test_deserialize_gint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_gint_failures)
|
GST_START_TEST (test_deserialize_gint_failures)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -138,9 +138,9 @@ START_TEST (test_deserialize_gint_failures)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_guint)
|
GST_START_TEST (test_deserialize_guint)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -192,9 +192,9 @@ START_TEST (test_deserialize_guint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_guint_failures)
|
GST_START_TEST (test_deserialize_guint_failures)
|
||||||
{
|
{
|
||||||
GValue value = { 0 };
|
GValue value = { 0 };
|
||||||
const char *strings[] = {
|
const char *strings[] = {
|
||||||
|
@ -222,10 +222,10 @@ START_TEST (test_deserialize_guint_failures)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
|
|
||||||
START_TEST (test_string)
|
GST_START_TEST (test_string)
|
||||||
{
|
{
|
||||||
gchar *try[] = {
|
gchar *try[] = {
|
||||||
"Dude",
|
"Dude",
|
||||||
|
@ -252,9 +252,9 @@ START_TEST (test_string)
|
||||||
g_value_unset (&v);
|
g_value_unset (&v);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
START_TEST (test_deserialize_string)
|
GST_START_TEST (test_deserialize_string)
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,7 @@ START_TEST (test_deserialize_string)
|
||||||
g_value_unset (&v);
|
g_value_unset (&v);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST;
|
GST_END_TEST;
|
||||||
|
|
||||||
Suite *
|
Suite *
|
||||||
gst_value_suite (void)
|
gst_value_suite (void)
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "gstcheck.h"
|
#include "gstcheck.h"
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY (check_debug);
|
||||||
|
|
||||||
/* logging function for tests
|
/* logging function for tests
|
||||||
* a test uses g_message() to log a debug line
|
* a test uses g_message() to log a debug line
|
||||||
|
@ -71,6 +72,8 @@ gst_check_init (int *argc, char **argv[])
|
||||||
{
|
{
|
||||||
gst_init (argc, argv);
|
gst_init (argc, argv);
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (check_debug, "check", 0, "check regression tests");
|
||||||
|
|
||||||
if (g_getenv ("GST_TEST_DEBUG"))
|
if (g_getenv ("GST_TEST_DEBUG"))
|
||||||
_gst_check_debug = TRUE;
|
_gst_check_debug = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_EXTERN (check_debug);
|
||||||
|
#define GST_CAT_DEFAULT check_debug
|
||||||
|
|
||||||
/* logging function for tests
|
/* logging function for tests
|
||||||
* a test uses g_message() to log a debug line
|
* a test uses g_message() to log a debug line
|
||||||
* a gst unit test can be run with GST_TEST_DEBUG env var set to see the
|
* a gst unit test can be run with GST_TEST_DEBUG env var set to see the
|
||||||
|
@ -42,6 +45,17 @@ extern gboolean _gst_check_expecting_log;
|
||||||
|
|
||||||
void gst_check_init (int *argc, char **argv[]);
|
void gst_check_init (int *argc, char **argv[]);
|
||||||
|
|
||||||
|
/***
|
||||||
|
* wrappers for START_TEST and END_TEST
|
||||||
|
*/
|
||||||
|
#define GST_START_TEST(__testname) \
|
||||||
|
static void __testname (void)\
|
||||||
|
{\
|
||||||
|
GST_DEBUG ("test start"); \
|
||||||
|
tcase_fn_start (""# __testname, __FILE__, __LINE__);
|
||||||
|
|
||||||
|
#define GST_END_TEST END_TEST
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* thread test macros and variables
|
* thread test macros and variables
|
||||||
*/
|
*/
|
||||||
|
@ -134,6 +148,7 @@ G_STMT_START { \
|
||||||
|
|
||||||
#define THREAD_TEST_RUNNING() (_gst_check_threads_running == TRUE)
|
#define THREAD_TEST_RUNNING() (_gst_check_threads_running == TRUE)
|
||||||
|
|
||||||
|
/* additional assertions */
|
||||||
#define ASSERT_CRITICAL(code) \
|
#define ASSERT_CRITICAL(code) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
_gst_check_expecting_log = TRUE; \
|
_gst_check_expecting_log = TRUE; \
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "libs/gst/dataprotocol/dp-private.h" /* private header */
|
#include "libs/gst/dataprotocol/dp-private.h" /* private header */
|
||||||
|
|
||||||
/* test our method of reading and writing headers using TO/FROM_BE */
|
/* test our method of reading and writing headers using TO/FROM_BE */
|
||||||
START_TEST (test_conversion)
|
GST_START_TEST (test_conversion)
|
||||||
{
|
{
|
||||||
guint8 array[9];
|
guint8 array[9];
|
||||||
guint8 write_array[9];
|
guint8 write_array[9];
|
||||||
|
@ -81,9 +81,9 @@ START_TEST (test_conversion)
|
||||||
"GST_WRITE_UINT64_BE: memcmp failed");
|
"GST_WRITE_UINT64_BE: memcmp failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
/* test creation of header from buffer and back again */
|
/* test creation of header from buffer and back again */
|
||||||
START_TEST (test_buffer)
|
GST_START_TEST (test_buffer)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstBuffer *newbuffer;
|
GstBuffer *newbuffer;
|
||||||
|
@ -141,8 +141,8 @@ START_TEST (test_buffer)
|
||||||
g_free (header);
|
g_free (header);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_caps)
|
GST_START_TEST (test_caps)
|
||||||
{
|
{
|
||||||
gchar *string, *newstring;
|
gchar *string, *newstring;
|
||||||
GstCaps *caps, *newcaps;
|
GstCaps *caps, *newcaps;
|
||||||
|
@ -173,8 +173,8 @@ START_TEST (test_caps)
|
||||||
g_free (newstring);
|
g_free (newstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST
|
GST_END_TEST
|
||||||
START_TEST (test_event)
|
GST_START_TEST (test_event)
|
||||||
{
|
{
|
||||||
GstEvent *send;
|
GstEvent *send;
|
||||||
GstEvent *receive;
|
GstEvent *receive;
|
||||||
|
@ -240,7 +240,7 @@ START_TEST (test_event)
|
||||||
gst_event_unref (send);
|
gst_event_unref (send);
|
||||||
gst_event_unref (receive);
|
gst_event_unref (receive);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
gst_object_suite (void)
|
gst_object_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("data protocol");
|
Suite *s = suite_create ("data protocol");
|
||||||
|
|
|
@ -71,7 +71,7 @@ run_pipeline (GstElement * pipe, gchar * descr,
|
||||||
gst_object_unref (pipe);
|
gst_object_unref (pipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_pipeline_unref)
|
GST_START_TEST (test_pipeline_unref)
|
||||||
{
|
{
|
||||||
gchar *s;
|
gchar *s;
|
||||||
gint count;
|
gint count;
|
||||||
|
@ -94,7 +94,7 @@ START_TEST (test_pipeline_unref)
|
||||||
gst_object_unref (sink);
|
gst_object_unref (sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
cleanup_suite (void)
|
cleanup_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("Pipeline cleanup");
|
Suite *s = suite_create ("Pipeline cleanup");
|
||||||
|
|
|
@ -71,7 +71,7 @@ run_pipeline (GstElement * pipe, gchar * descr,
|
||||||
gst_object_unref (pipe);
|
gst_object_unref (pipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_2_elements)
|
GST_START_TEST (test_2_elements)
|
||||||
{
|
{
|
||||||
gchar *s;
|
gchar *s;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ START_TEST (test_2_elements)
|
||||||
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
|
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
|
||||||
GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN)); */
|
GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN)); */
|
||||||
}
|
}
|
||||||
END_TEST static void
|
GST_END_TEST static void
|
||||||
got_handoff (GstElement * sink, GstBuffer * buf, GstPad * pad, gpointer unused)
|
got_handoff (GstElement * sink, GstBuffer * buf, GstPad * pad, gpointer unused)
|
||||||
{
|
{
|
||||||
gst_element_post_message
|
gst_element_post_message
|
||||||
|
@ -125,7 +125,7 @@ assert_live_count (GType type, gint live)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST (test_stop_from_app)
|
GST_START_TEST (test_stop_from_app)
|
||||||
{
|
{
|
||||||
GstElement *fakesrc, *fakesink, *pipeline;
|
GstElement *fakesrc, *fakesink, *pipeline;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
|
@ -161,7 +161,7 @@ START_TEST (test_stop_from_app)
|
||||||
|
|
||||||
assert_live_count (GST_TYPE_BUFFER, 0);
|
assert_live_count (GST_TYPE_BUFFER, 0);
|
||||||
}
|
}
|
||||||
END_TEST Suite *
|
GST_END_TEST Suite *
|
||||||
simple_launch_lines_suite (void)
|
simple_launch_lines_suite (void)
|
||||||
{
|
{
|
||||||
Suite *s = suite_create ("Pipelines");
|
Suite *s = suite_create ("Pipelines");
|
||||||
|
|
Loading…
Reference in a new issue