tests/check/: Don't busy-wait in tests; this was causing test timeouts very frequentl...
authorMichael Smith <msmith@xiph.org>
Fri, 2 Jun 2006 17:01:02 +0000 (17:01 +0000)
committerMichael Smith <msmith@xiph.org>
Fri, 2 Jun 2006 17:01:02 +0000 (17:01 +0000)
Original commit message from CVS:
* tests/check/elements/audioconvert.c: (set_channel_positions),
(get_float_mc_caps), (get_int_mc_caps):
* tests/check/elements/audioresample.c:
* tests/check/elements/audiotestsrc.c: (GST_START_TEST):
* tests/check/elements/videorate.c:
* tests/check/elements/videotestsrc.c: (GST_START_TEST):
* tests/check/elements/volume.c:
* tests/check/elements/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c: (GST_START_TEST):
Don't busy-wait in tests; this was causing test timeouts very
frequently when running under valgrind.

ChangeLog
tests/check/elements/audioconvert.c
tests/check/elements/audioresample.c
tests/check/elements/audiotestsrc.c
tests/check/elements/videorate.c
tests/check/elements/videotestsrc.c
tests/check/elements/volume.c
tests/check/elements/vorbisdec.c
tests/check/pipelines/vorbisenc.c

index 2aaeb65..1502bb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-06-02  Michael Smith  <msmith@fluendo.com>
+
+       * tests/check/elements/audioconvert.c: (set_channel_positions),
+       (get_float_mc_caps), (get_int_mc_caps):
+       * tests/check/elements/audioresample.c:
+       * tests/check/elements/audiotestsrc.c: (GST_START_TEST):
+       * tests/check/elements/videorate.c:
+       * tests/check/elements/videotestsrc.c: (GST_START_TEST):
+       * tests/check/elements/volume.c:
+       * tests/check/elements/vorbisdec.c:
+       * tests/check/pipelines/vorbisenc.c: (GST_START_TEST):
+         Don't busy-wait in tests; this was causing test timeouts very
+         frequently when running under valgrind.
+
 2006-06-02  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * gst/tcp/README:
index 0249a60..a8bd698 100644 (file)
@@ -25,7 +25,6 @@
 #include <gst/check/gstcheck.h>
 #include <gst/audio/multichannel.h>
 
-GList *buffers = NULL;
 gboolean have_eos = FALSE;
 
 /* For ease of programming we use globals to keep refs for our floating
index 680ab7b..3d6a751 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gst/check/gstcheck.h>
 
-GList *buffers = NULL;
 gboolean have_eos = FALSE;
 
 /* For ease of programming we use globals to keep refs for our floating
index c97ae04..3649555 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gst/check/gstcheck.h>
 
-GList *buffers = NULL;
 gboolean have_eos = FALSE;
 
 /* For ease of programming we use globals to keep refs for our floating
@@ -96,7 +95,10 @@ GST_START_TEST (test_all_waves)
             GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
         "could not set to playing");
 
-    while (g_list_length (buffers) < 10);
+    g_mutex_lock (check_mutex);
+    while (g_list_length (buffers) < 10)
+      g_cond_wait (check_cond, check_mutex);
+    g_mutex_unlock (check_mutex);
 
     gst_element_set_state (audiotestsrc, GST_STATE_READY);
 
index 285f381..632faea 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gst/check/gstcheck.h>
 
-GList *buffers = NULL;
 gboolean have_eos = FALSE;
 
 /* For ease of programming we use globals to keep refs for our floating
index db528f5..a38ce88 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gst/check/gstcheck.h>
 
-GList *buffers = NULL;
 gboolean have_eos = FALSE;
 
 /* For ease of programming we use globals to keep refs for our floating
@@ -94,7 +93,13 @@ GST_START_TEST (test_all_patterns)
             GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
         "could not set to playing");
 
-    while (g_list_length (buffers) < 10);
+    g_mutex_lock (check_mutex);
+    while (g_list_length (buffers) < 10) {
+      GST_DEBUG_OBJECT (videotestsrc, "Waiting for more buffers");
+      g_cond_wait (check_cond, check_mutex);
+    }
+    g_mutex_unlock (check_mutex);
+
 
     gst_element_set_state (videotestsrc, GST_STATE_READY);
 
index a594bcd..fb63696 100644 (file)
@@ -25,7 +25,6 @@
 #include <gst/base/gstbasetransform.h>
 #include <gst/check/gstcheck.h>
 
-GList *buffers = NULL;
 gboolean have_eos = FALSE;
 
 /* For ease of programming we use globals to keep refs for our floating
index d704d79..070248f 100644 (file)
@@ -24,8 +24,6 @@
 
 #include <gst/check/gstcheck.h>
 
-GList *buffers = NULL;
-
 /* For ease of programming we use globals to keep refs for our floating
  * src and sink pads we create; otherwise we always have to do get_pad,
  * get_peer, and then remove references in every test function */
index 866887f..57cdd92 100644 (file)
@@ -198,10 +198,12 @@ GST_START_TEST (test_granulepos_offset)
 
   /* header packets should have timestamp == NONE, granulepos 0 */
   buffer = get_buffer (bin, pad);
+  GST_DEBUG ("Got buffer in test");
   check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
   check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
   check_buffer_granulepos (buffer, 0);
   gst_buffer_unref (buffer);
+  GST_DEBUG ("Unreffed buffer in test");
 
   buffer = get_buffer (bin, pad);
   check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);