tests: fix more tests
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 6 Feb 2012 14:52:49 +0000 (15:52 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 6 Feb 2012 14:52:49 +0000 (15:52 +0100)
tests/check/elements/id3demux.c
tests/check/elements/level.c
tests/check/elements/multifile.c

index dec7fdb..b907da4 100644 (file)
 
 typedef void (CheckTagsFunc) (const GstTagList * tags, const gchar * file);
 
-static void
-pad_added_cb (GstElement * id3demux, GstPad * pad, GstBin * pipeline)
-{
-  GstElement *sink;
-
-  sink = gst_bin_get_by_name (pipeline, "fakesink");
-  fail_unless (gst_element_link (id3demux, sink));
-  gst_object_unref (sink);
-
-  gst_element_set_state (sink, GST_STATE_PAUSED);
-}
-
 static GstBusSyncReply
 error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
 {
@@ -91,9 +79,7 @@ read_tags_from_file (const gchar * file, gboolean push_mode)
 
   fail_unless (gst_element_link (src, sep));
   fail_unless (gst_element_link (sep, id3demux));
-
-  /* can't link id3demux and sink yet, do that later */
-  g_signal_connect (id3demux, "pad-added", G_CALLBACK (pad_added_cb), pipeline);
+  fail_unless (gst_element_link (id3demux, sink));
 
   path = g_build_filename (GST_TEST_FILES_PATH, file, NULL);
   GST_LOG ("reading file '%s'", path);
index 4d44087..286316e 100644 (file)
@@ -36,14 +36,17 @@ GstPad *mysrcpad, *mysinkpad;
 #define LEVEL_CAPS_TEMPLATE_STRING \
   "audio/x-raw, " \
     "format = (string) { S8, "GST_AUDIO_NE(S16)" }, " \
+    "layout = (string) interleaved, " \
     "rate = (int) [ 1, MAX ], " \
     "channels = (int) [ 1, 8 ]"
 
 #define LEVEL_CAPS_STRING \
   "audio/x-raw, " \
     "format = (string) "GST_AUDIO_NE(S16)", " \
+    "layout = (string) interleaved, " \
     "rate = (int) 1000, " \
-    "channels = (int) 2"
+    "channels = (int) 2, "  \
+    "channel-mask = (bitmask) 3"  \
 
 static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
index 3102e53..9679f93 100644 (file)
@@ -161,10 +161,10 @@ GST_START_TEST (test_multifilesink_key_unit)
   buf = gst_buffer_new_and_alloc (4);
 
   gst_buffer_fill (buf, 0, "foo", 4);
-  fail_if (gst_pad_chain (sink, gst_buffer_ref (buf)) != GST_FLOW_OK);
+  fail_if (gst_pad_chain (sink, gst_buffer_copy (buf)) != GST_FLOW_OK);
 
   gst_buffer_fill (buf, 0, "bar", 4);
-  fail_if (gst_pad_chain (sink, gst_buffer_ref (buf)) != GST_FLOW_OK);
+  fail_if (gst_pad_chain (sink, gst_buffer_copy (buf)) != GST_FLOW_OK);
 
   fail_unless (gst_pad_send_event (sink,
           gst_video_event_new_downstream_force_key_unit (GST_CLOCK_TIME_NONE,