fixing up tests
authorThomas Vander Stichele <thomas@apestaart.org>
Thu, 9 May 2002 16:43:10 +0000 (16:43 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Thu, 9 May 2002 16:43:10 +0000 (16:43 +0000)
Original commit message from CVS:
fixing up tests

tests/old/testsuite/cleanup/cleanup1.c
tests/old/testsuite/cleanup/cleanup2.c
tests/old/testsuite/cleanup/cleanup3.c
tests/old/testsuite/cleanup/cleanup4.c
tests/old/testsuite/cleanup/cleanup5.c
testsuite/cleanup/cleanup1.c
testsuite/cleanup/cleanup2.c
testsuite/cleanup/cleanup3.c
testsuite/cleanup/cleanup4.c
testsuite/cleanup/cleanup5.c

index 9342ac7..3c8ff13 100644 (file)
@@ -12,10 +12,9 @@ create_pipeline (void)
   fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
   fakesink = gst_element_factory_make ("fakesink", "fakesink");
 
-  gst_element_connect (fakesrc, "src", fakesink, "sink");
+  gst_element_connect (fakesrc, fakesink);
 
-  gst_bin_add (GST_BIN (pipeline), fakesrc);
-  gst_bin_add (GST_BIN (pipeline), fakesink);
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
 
   g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
 
@@ -26,17 +25,17 @@ gint
 main (gint argc, gchar *argv[])
 {
   GstElement *pipeline;
-  gint i;
+  gint i = 10000;
+  gint step = 100;
 
   free (malloc(8)); /* -lefence */
 
   gst_init (&argc, &argv);
 
-  i = 10000;
-
   g_mem_chunk_info ();
   while (i--) {
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "%10d\r", i);
     pipeline = create_pipeline ();
          
     gst_element_set_state (pipeline, GST_STATE_PLAYING);
@@ -51,7 +50,6 @@ main (gint argc, gchar *argv[])
 
     gst_element_set_state (pipeline, GST_STATE_NULL);
 
-    fprintf (stderr, "-");
     gst_object_unref (GST_OBJECT (pipeline));
 
   }
index b32df0e..92e0217 100644 (file)
@@ -15,10 +15,9 @@ create_pipeline (void)
   gst_bin_add (GST_BIN (bin), fakesink);
   gst_element_add_ghost_pad (bin, gst_element_get_pad (fakesink, "sink"), "sink");
 
-  gst_element_connect (fakesrc, "src", bin, "sink");
+  gst_element_connect (fakesrc, bin);
 
-  gst_bin_add (GST_BIN (pipeline), fakesrc);
-  gst_bin_add (GST_BIN (pipeline), bin);
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc, bin, NULL);
 
   g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
 
@@ -29,17 +28,18 @@ gint
 main (gint argc, gchar *argv[])
 {
   GstElement *pipeline;
-  gint i;
+  gint i = 10000;
+  gint step = 100;
 
   free (malloc(8)); /* -lefence */
 
   gst_init (&argc, &argv);
 
-  i = 10000;
 
   g_mem_chunk_info ();
   while (i--) {
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "%10d\r", i);
     pipeline = create_pipeline ();
          
     gst_element_set_state (pipeline, GST_STATE_PLAYING);
@@ -54,9 +54,9 @@ main (gint argc, gchar *argv[])
 
     gst_element_set_state (pipeline, GST_STATE_NULL);
 
-    fprintf (stderr, "-");
     gst_object_unref (GST_OBJECT (pipeline));
   }
+  fprintf (stderr, "\n");
   g_mem_chunk_info ();
 
   return 0;
index 48e39a8..0bf0129 100644 (file)
@@ -15,10 +15,10 @@ create_pipeline (void)
   queue = gst_element_factory_make ("queue", "queue");
   gst_bin_add (GST_BIN (thread), fakesink);
   gst_bin_add (GST_BIN (thread), queue);
-  gst_element_connect (queue, "src", fakesink, "sink");
+  gst_element_connect (queue, fakesink); 
   gst_element_add_ghost_pad (thread, gst_element_get_pad (queue, "sink"), "sink");
 
-  gst_element_connect (fakesrc, "src", thread, "sink");
+  gst_element_connect (fakesrc, thread);
 
   gst_bin_add (GST_BIN (pipeline), fakesrc);
   gst_bin_add (GST_BIN (pipeline), thread);
@@ -32,17 +32,18 @@ gint
 main (gint argc, gchar *argv[])
 {
   GstElement *pipeline;
-  gint i;
+  gint i = 10000;
+  gint step = 100;
 
   free (malloc(8)); /* -lefence */
 
   gst_init (&argc, &argv);
 
-  i = 10000;
 
   g_mem_chunk_info ();
   while (i--) {
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "%10d\r", i);
     pipeline = create_pipeline ();
          
     gst_element_set_state (pipeline, GST_STATE_PLAYING);
@@ -57,7 +58,6 @@ main (gint argc, gchar *argv[])
 
     gst_element_set_state (pipeline, GST_STATE_NULL);
 
-    fprintf (stderr, "-");
     gst_object_unref (GST_OBJECT (pipeline));
   }
   fprintf (stderr, "\n");
index 5892e8f..91b92f7 100644 (file)
@@ -1,10 +1,5 @@
 #include <gst/gst.h>
 
-static GstElement *
-create_pipeline (void)
-{
-}
-
 gint
 main (gint argc, gchar *argv[])
 {
@@ -35,7 +30,7 @@ main (gint argc, gchar *argv[])
 
     fakesink = gst_element_factory_make ("fakesink", "fakesink");
 
-    gst_element_connect (fakesrc, "src", fakesink, "sink");
+    gst_element_connect (fakesrc, fakesink);
 
     gst_bin_add (GST_BIN (bin), fakesink);
     gst_bin_add (GST_BIN (pipeline), bin);
index 482a21b..86af3c3 100644 (file)
@@ -3,7 +3,9 @@
 int main(int argc,char *argv[]) 
 {
   GstElement *bin, *element;
-  gint i=1000000;
+  gint i = 100000;
+  gint step = 100;
+  
 
   free (malloc(8)); /* -lefence */
 
@@ -17,13 +19,14 @@ int main(int argc,char *argv[])
   {
     GstPad *pad;
 
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "\r%10d", i);
 
     element = gst_element_factory_make ("tee", "tee");
     if (!element) 
       break;
 
-    pad = gst_element_request_pad_by_name (element, "src%d");
+    pad = gst_element_get_request_pad (element, "src%d");
 
     gst_bin_add (GST_BIN (bin), element);
     gst_bin_remove (GST_BIN (bin), element);
@@ -34,4 +37,5 @@ int main(int argc,char *argv[])
   gst_object_unref (GST_OBJECT (bin));
 
   g_mem_chunk_info ();
+  return 0;
 }
index 9342ac7..3c8ff13 100644 (file)
@@ -12,10 +12,9 @@ create_pipeline (void)
   fakesrc = gst_element_factory_make ("fakesrc", "fakesrc");
   fakesink = gst_element_factory_make ("fakesink", "fakesink");
 
-  gst_element_connect (fakesrc, "src", fakesink, "sink");
+  gst_element_connect (fakesrc, fakesink);
 
-  gst_bin_add (GST_BIN (pipeline), fakesrc);
-  gst_bin_add (GST_BIN (pipeline), fakesink);
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL);
 
   g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
 
@@ -26,17 +25,17 @@ gint
 main (gint argc, gchar *argv[])
 {
   GstElement *pipeline;
-  gint i;
+  gint i = 10000;
+  gint step = 100;
 
   free (malloc(8)); /* -lefence */
 
   gst_init (&argc, &argv);
 
-  i = 10000;
-
   g_mem_chunk_info ();
   while (i--) {
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "%10d\r", i);
     pipeline = create_pipeline ();
          
     gst_element_set_state (pipeline, GST_STATE_PLAYING);
@@ -51,7 +50,6 @@ main (gint argc, gchar *argv[])
 
     gst_element_set_state (pipeline, GST_STATE_NULL);
 
-    fprintf (stderr, "-");
     gst_object_unref (GST_OBJECT (pipeline));
 
   }
index b32df0e..92e0217 100644 (file)
@@ -15,10 +15,9 @@ create_pipeline (void)
   gst_bin_add (GST_BIN (bin), fakesink);
   gst_element_add_ghost_pad (bin, gst_element_get_pad (fakesink, "sink"), "sink");
 
-  gst_element_connect (fakesrc, "src", bin, "sink");
+  gst_element_connect (fakesrc, bin);
 
-  gst_bin_add (GST_BIN (pipeline), fakesrc);
-  gst_bin_add (GST_BIN (pipeline), bin);
+  gst_bin_add_many (GST_BIN (pipeline), fakesrc, bin, NULL);
 
   g_object_set (G_OBJECT (fakesrc), "num_buffers", 5, NULL);
 
@@ -29,17 +28,18 @@ gint
 main (gint argc, gchar *argv[])
 {
   GstElement *pipeline;
-  gint i;
+  gint i = 10000;
+  gint step = 100;
 
   free (malloc(8)); /* -lefence */
 
   gst_init (&argc, &argv);
 
-  i = 10000;
 
   g_mem_chunk_info ();
   while (i--) {
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "%10d\r", i);
     pipeline = create_pipeline ();
          
     gst_element_set_state (pipeline, GST_STATE_PLAYING);
@@ -54,9 +54,9 @@ main (gint argc, gchar *argv[])
 
     gst_element_set_state (pipeline, GST_STATE_NULL);
 
-    fprintf (stderr, "-");
     gst_object_unref (GST_OBJECT (pipeline));
   }
+  fprintf (stderr, "\n");
   g_mem_chunk_info ();
 
   return 0;
index 48e39a8..0bf0129 100644 (file)
@@ -15,10 +15,10 @@ create_pipeline (void)
   queue = gst_element_factory_make ("queue", "queue");
   gst_bin_add (GST_BIN (thread), fakesink);
   gst_bin_add (GST_BIN (thread), queue);
-  gst_element_connect (queue, "src", fakesink, "sink");
+  gst_element_connect (queue, fakesink); 
   gst_element_add_ghost_pad (thread, gst_element_get_pad (queue, "sink"), "sink");
 
-  gst_element_connect (fakesrc, "src", thread, "sink");
+  gst_element_connect (fakesrc, thread);
 
   gst_bin_add (GST_BIN (pipeline), fakesrc);
   gst_bin_add (GST_BIN (pipeline), thread);
@@ -32,17 +32,18 @@ gint
 main (gint argc, gchar *argv[])
 {
   GstElement *pipeline;
-  gint i;
+  gint i = 10000;
+  gint step = 100;
 
   free (malloc(8)); /* -lefence */
 
   gst_init (&argc, &argv);
 
-  i = 10000;
 
   g_mem_chunk_info ();
   while (i--) {
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "%10d\r", i);
     pipeline = create_pipeline ();
          
     gst_element_set_state (pipeline, GST_STATE_PLAYING);
@@ -57,7 +58,6 @@ main (gint argc, gchar *argv[])
 
     gst_element_set_state (pipeline, GST_STATE_NULL);
 
-    fprintf (stderr, "-");
     gst_object_unref (GST_OBJECT (pipeline));
   }
   fprintf (stderr, "\n");
index 5892e8f..91b92f7 100644 (file)
@@ -1,10 +1,5 @@
 #include <gst/gst.h>
 
-static GstElement *
-create_pipeline (void)
-{
-}
-
 gint
 main (gint argc, gchar *argv[])
 {
@@ -35,7 +30,7 @@ main (gint argc, gchar *argv[])
 
     fakesink = gst_element_factory_make ("fakesink", "fakesink");
 
-    gst_element_connect (fakesrc, "src", fakesink, "sink");
+    gst_element_connect (fakesrc, fakesink);
 
     gst_bin_add (GST_BIN (bin), fakesink);
     gst_bin_add (GST_BIN (pipeline), bin);
index 482a21b..86af3c3 100644 (file)
@@ -3,7 +3,9 @@
 int main(int argc,char *argv[]) 
 {
   GstElement *bin, *element;
-  gint i=1000000;
+  gint i = 100000;
+  gint step = 100;
+  
 
   free (malloc(8)); /* -lefence */
 
@@ -17,13 +19,14 @@ int main(int argc,char *argv[])
   {
     GstPad *pad;
 
-    fprintf (stderr, "+");
+    if (i % step == 0)
+      fprintf (stderr, "\r%10d", i);
 
     element = gst_element_factory_make ("tee", "tee");
     if (!element) 
       break;
 
-    pad = gst_element_request_pad_by_name (element, "src%d");
+    pad = gst_element_get_request_pad (element, "src%d");
 
     gst_bin_add (GST_BIN (bin), element);
     gst_bin_remove (GST_BIN (bin), element);
@@ -34,4 +37,5 @@ int main(int argc,char *argv[])
   gst_object_unref (GST_OBJECT (bin));
 
   g_mem_chunk_info ();
+  return 0;
 }