remove wrong commit
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 31 May 2006 16:56:45 +0000 (16:56 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 31 May 2006 16:56:45 +0000 (16:56 +0000)
Original commit message from CVS:
remove wrong commit

tests/check/elements/multifdsink.c

index 656267b..67c8c47 100644 (file)
@@ -31,7 +31,7 @@ GstPad *mysrcpad;
 static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("application/x-gst-check")
+    GST_STATIC_CAPS ("application/x-gdp")
     );
 
 GstElement *
@@ -80,16 +80,12 @@ GST_START_TEST (test_no_clients)
 {
   GstElement *sink;
   GstBuffer *buffer;
-  GstCaps *caps;
 
   sink = setup_multifdsink ();
 
   ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
 
-  caps = gst_caps_from_string ("application/x-gst-check");
   buffer = gst_buffer_new_and_alloc (4);
-  gst_buffer_set_caps (buffer, caps);
-  gst_caps_unref (caps);
   fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
 
   GST_DEBUG ("cleaning up multifdsink");
@@ -103,7 +99,6 @@ GST_START_TEST (test_add_client)
 {
   GstElement *sink;
   GstBuffer *buffer;
-  GstCaps *caps;
   int pfd[2];
   gchar data[4];
   guint64 bytes_served;
@@ -117,10 +112,7 @@ GST_START_TEST (test_add_client)
   /* add the client */
   g_signal_emit_by_name (sink, "add", pfd[1]);
 
-  caps = gst_caps_from_string ("application/x-gst-check");
   buffer = gst_buffer_new_and_alloc (4);
-  gst_buffer_set_caps (buffer, caps);
-  gst_caps_unref (caps);
   memcpy (GST_BUFFER_DATA (buffer), "dead", 4);
   fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
 
@@ -196,12 +188,6 @@ gst_multifdsink_create_streamheader (const gchar * data1,
 
   gst_structure_set_value (structure, "streamheader", &array);
   g_value_unset (&array);
-
-  /* set our streamheadery caps on the buffers */
-  gst_buffer_set_caps (*hbuf1, *caps);
-  gst_buffer_set_caps (*hbuf2, *caps);
-
-  GST_DEBUG ("created streamheader caps %" GST_PTR_FORMAT, *caps);
 }
 
 
@@ -320,7 +306,7 @@ GST_START_TEST (test_change_streamheader)
 
   /* create caps with streamheader, set the caps, and push the IN_CAPS
    * buffers */
-  gst_multifdsink_create_streamheader ("first", "header", &hbuf1, &hbuf2,
+  gst_multifdsink_create_streamheader ("babe", "deadbeef", &hbuf1, &hbuf2,
       &caps);
   fail_unless (gst_pad_set_caps (mysrcpad, caps));
   gst_caps_unref (caps);
@@ -341,10 +327,10 @@ GST_START_TEST (test_change_streamheader)
   memcpy (GST_BUFFER_DATA (buf), "f00d", 4);
   gst_pad_push (mysrcpad, buf);
 
-  fail_unless_read ("change: first client", pfd1[0], 5, "first");
-  fail_unless_read ("change: first client", pfd1[0], 6, "header");
+  fail_unless_read ("change: first client", pfd1[0], 4, "babe");
+  fail_unless_read ("change: first client", pfd1[0], 8, "deadbeef");
   fail_unless_read ("change: first client", pfd1[0], 4, "f00d");
-  //wait_bytes_served (sink, 16);
+  wait_bytes_served (sink, 16);
 
   /* now add the second client */
   g_signal_emit_by_name (sink, "add", pfd2[1]);
@@ -353,7 +339,7 @@ GST_START_TEST (test_change_streamheader)
   /* change the streamheader */
   gst_buffer_unref (hbuf1);
   gst_buffer_unref (hbuf2);
-  gst_multifdsink_create_streamheader ("second", "header", &hbuf1, &hbuf2,
+  gst_multifdsink_create_streamheader ("beef", "deadbabe", &hbuf1, &hbuf2,
       &caps);
   fail_unless (gst_pad_set_caps (mysrcpad, caps));
   gst_caps_unref (caps);
@@ -367,20 +353,19 @@ GST_START_TEST (test_change_streamheader)
 
   /* now push another buffer, which will trigger streamheader for second
    * client, but should also send new streamheaders to first client */
-  buf = gst_buffer_new_and_alloc (8);
-  memcpy (GST_BUFFER_DATA (buf), "deadbabe", 8);
+  buf = gst_buffer_new_and_alloc (4);
+  memcpy (GST_BUFFER_DATA (buf), "deaf", 4);
   gst_pad_push (mysrcpad, buf);
 
-  fail_unless_read ("first client", pfd1[0], 6, "second");
-  fail_unless_read ("first client", pfd1[0], 6, "header");
-  fail_unless_read ("first client", pfd1[0], 8, "deadbabe");
+  /* FIXME: here's a bug - the first client does not get new streamheaders */
+  fail_unless_read ("first client", pfd1[0], 4, "deaf");
 
   /* new streamheader data */
-  fail_unless_read ("second client", pfd2[0], 6, "second");
-  fail_unless_read ("second client", pfd2[0], 6, "header");
-  /* we missed the f00d buffer */
+  fail_unless_read ("second client", pfd2[0], 4, "beef");
   fail_unless_read ("second client", pfd2[0], 8, "deadbabe");
-  //wait_bytes_served (sink, 36);
+  /* we missed the f00d buffer */
+  fail_unless_read ("second client", pfd2[0], 4, "deaf");
+  wait_bytes_served (sink, 36);
 
   gst_buffer_unref (hbuf1);
   gst_buffer_unref (hbuf2);
@@ -406,9 +391,9 @@ multifdsink_suite (void)
   TCase *tc_chain = tcase_create ("general");
 
   suite_add_tcase (s, tc_chain);
-//  tcase_add_test (tc_chain, test_no_clients);
-//  tcase_add_test (tc_chain, test_add_client);
-//  tcase_add_test (tc_chain, test_streamheader);
+  tcase_add_test (tc_chain, test_no_clients);
+  tcase_add_test (tc_chain, test_add_client);
+  tcase_add_test (tc_chain, test_streamheader);
   tcase_add_test (tc_chain, test_change_streamheader);
 
   return s;