tests: make tests compile

This commit is contained in:
Wim Taymans 2012-01-04 10:33:27 +01:00
parent f9d64ff495
commit bc3c7aa05e
5 changed files with 26 additions and 20 deletions

View file

@ -62,8 +62,8 @@ setup_amrnbenc (void)
GST_DEBUG ("setup_amrnbenc");
amrnbenc = gst_check_setup_element ("amrnbenc");
srcpad = gst_check_setup_src_pad (amrnbenc, &srctemplate, NULL);
sinkpad = gst_check_setup_sink_pad (amrnbenc, &sinktemplate, NULL);
srcpad = gst_check_setup_src_pad (amrnbenc, &srctemplate);
sinkpad = gst_check_setup_sink_pad (amrnbenc, &sinktemplate);
gst_pad_set_active (srcpad, TRUE);
gst_pad_set_active (sinkpad, TRUE);

View file

@ -1345,8 +1345,8 @@ setup_mpeg2dec ()
GST_DEBUG ("setup_mpeg2dec");
mpeg2dec = gst_check_setup_element ("mpeg2dec");
mysrcpad = gst_check_setup_src_pad (mpeg2dec, &srctemplate, NULL);
mysinkpad = gst_check_setup_sink_pad (mpeg2dec, &sinktemplate, NULL);
mysrcpad = gst_check_setup_src_pad (mpeg2dec, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (mpeg2dec, &sinktemplate);
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE);

View file

@ -58,8 +58,8 @@ setup_x264enc (void)
GST_DEBUG ("setup_x264enc");
x264enc = gst_check_setup_element ("x264enc");
mysrcpad = gst_check_setup_src_pad (x264enc, &srctemplate, NULL);
mysinkpad = gst_check_setup_sink_pad (x264enc, &sinktemplate, NULL);
mysrcpad = gst_check_setup_src_pad (x264enc, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (x264enc, &sinktemplate);
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE);
@ -231,6 +231,7 @@ GST_END_TEST;
GstCaps *pad_caps;
#if 0
GstCaps *
getcaps_test (GstPad * pad, GstCaps * filter)
{
@ -239,6 +240,7 @@ getcaps_test (GstPad * pad, GstCaps * filter)
else
return gst_caps_intersect (pad_caps, filter);
}
#endif
GST_START_TEST (test_profile_in_caps)
{
@ -251,7 +253,9 @@ GST_START_TEST (test_profile_in_caps)
pad_caps = gst_caps_from_string (MPEG_CAPS_STRING);
x264enc = setup_x264enc ();
gst_pad_set_getcaps_function (mysinkpad, getcaps_test);
gst_pad_set_caps (mysinkpad, pad_caps);
gst_pad_use_fixed_caps (mysinkpad);
srcpad = gst_element_get_static_pad (x264enc, "src");
sinkpad = gst_element_get_static_pad (x264enc, "sink");
fail_unless (gst_element_set_state (x264enc,

View file

@ -89,9 +89,8 @@ GST_START_TEST (test_xing_remux)
"could not set to playing");
inbuffer = gst_buffer_new_and_alloc (sizeof (test_xing));
memcpy (GST_BUFFER_DATA (inbuffer), test_xing, sizeof (test_xing));
gst_buffer_fill (inbuffer, 0, test_xing, sizeof (test_xing));
gst_buffer_set_caps (inbuffer, GST_PAD_CAPS (mysrcpad));
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* pushing gives away my reference ... */
@ -103,27 +102,30 @@ GST_START_TEST (test_xing_remux)
verify_data = test_xing;
for (it = buffers; it != NULL; it = it->next) {
GstBuffer *outbuffer = (GstBuffer *) it->data;
gsize size;
guint8 *data;
data = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
if (it == buffers) {
gint j;
/* Empty Xing header, should be the same as input data until the "Xing" marker
* and zeroes afterwards. */
fail_unless (memcmp (test_xing, GST_BUFFER_DATA (outbuffer), 25) == 0);
for (j = 26; j < GST_BUFFER_SIZE (outbuffer); j++)
fail_unless (GST_BUFFER_DATA (outbuffer)[j] == 0);
verify_data += GST_BUFFER_SIZE (outbuffer);
fail_unless (memcmp (data, test_xing, 25) == 0);
for (j = 26; j < size; j++)
fail_unless (data[j] == 0);
verify_data += size;
} else if (it->next != NULL) {
/* Should contain the raw MP3 data without changes */
fail_unless (memcmp (verify_data, GST_BUFFER_DATA (outbuffer),
GST_BUFFER_SIZE (outbuffer)) == 0);
verify_data += GST_BUFFER_SIZE (outbuffer);
fail_unless (memcmp (data, verify_data, size) == 0);
verify_data += size;
} else {
/* Last buffer is the rewrite of the first buffer and should be exactly the same
* as the old Xing header we had */
fail_unless (memcmp (test_xing, GST_BUFFER_DATA (outbuffer),
GST_BUFFER_SIZE (outbuffer)) == 0);
fail_unless (memcmp (test_xing, data, size) == 0);
}
gst_buffer_unmap (outbuffer, data, size);
}
/* cleanup */

View file

@ -45,7 +45,7 @@ setup ()
ignorelist = g_strsplit (STATE_IGNORE_ELEMENTS, " ", 0);
}
plugins = gst_registry_get_plugin_list (gst_registry_get_default ());
plugins = gst_registry_get_plugin_list (gst_registry_get ());
for (p = plugins; p; p = p->next) {
GstPlugin *plugin = p->data;
@ -54,7 +54,7 @@ setup ()
continue;
features =
gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
gst_registry_get_feature_list_by_plugin (gst_registry_get (),
gst_plugin_get_name (plugin));
for (f = features; f; f = f->next) {