[pulseaudio-discuss] [PATCH 6/6] tests: Reduce time needed for a make check

Maarten Bosmans mkbosmans at gmail.com
Fri Oct 28 13:44:24 PDT 2011


---
 src/tests/interpol-test.c       |    7 +------
 src/tests/lock-autospawn-test.c |    8 ++++----
 src/tests/once-test.c           |    2 +-
 src/tests/rtpoll-test.c         |    4 +++-
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c
index ad00aca..fa89e8e 100644
--- a/src/tests/interpol-test.c
+++ b/src/tests/interpol-test.c
@@ -174,12 +174,7 @@ int main(int argc, char *argv[]) {
 
     pa_assert_se(pa_threaded_mainloop_start(m) >= 0);
 
-/* #ifdef CORK */
-    for (k = 0; k < 20000; k++)
-/* #else */
-/*     for (k = 0; k < 2000; k++) */
-/* #endif */
-    {
+    for (k = 0; k < 4000; k++) {
         pa_bool_t success = FALSE, changed = FALSE;
         pa_usec_t t, rtc, d;
         struct timeval now, tv;
diff --git a/src/tests/lock-autospawn-test.c b/src/tests/lock-autospawn-test.c
index e2db24c..a7324ab 100644
--- a/src/tests/lock-autospawn-test.c
+++ b/src/tests/lock-autospawn-test.c
@@ -38,9 +38,9 @@ static void thread_func(void*k) {
 
     pa_assert_se(pa_autospawn_lock_acquire(TRUE) > 0);
 
-    pa_log("%i, Got the lock!, Sleeping for 5s", PA_PTR_TO_INT(k));
+    pa_log("%i, Got the lock!, Sleeping for 2s", PA_PTR_TO_INT(k));
 
-    pa_msleep(5000);
+    pa_msleep(2000);
 
     pa_log("%i, Releasing", PA_PTR_TO_INT(k));
 
@@ -74,9 +74,9 @@ static void thread_func2(void *k) {
         pa_log("%i, woke up", PA_PTR_TO_INT(k));
     }
 
-    pa_log("%i, Got the lock!, Sleeping for 5s", PA_PTR_TO_INT(k));
+    pa_log("%i, Got the lock!, Sleeping for 2s", PA_PTR_TO_INT(k));
 
-    pa_msleep(5000);
+    pa_msleep(2000);
 
     pa_log("%i, Releasing", PA_PTR_TO_INT(k));
 
diff --git a/src/tests/once-test.c b/src/tests/once-test.c
index b1ef6ba..cf33057 100644
--- a/src/tests/once-test.c
+++ b/src/tests/once-test.c
@@ -40,7 +40,7 @@ static pthread_barrier_t barrier;
 #endif
 static unsigned n_cpu;
 
-#define N_ITERATIONS 500
+#define N_ITERATIONS 200
 #define N_THREADS 100
 
 static void once_func(void) {
diff --git a/src/tests/rtpoll-test.c b/src/tests/rtpoll-test.c
index 6a6b73a..4c862b2 100644
--- a/src/tests/rtpoll-test.c
+++ b/src/tests/rtpoll-test.c
@@ -23,6 +23,8 @@
 
 #include <signal.h>
 
+#include <pulse/timeval.h>
+
 #include <pulsecore/poll.h>
 #include <pulsecore/log.h>
 #include <pulsecore/rtpoll.h>
@@ -59,7 +61,7 @@ int main(int argc, char *argv[]) {
     w = pa_rtpoll_item_new(p, PA_RTPOLL_NORMAL, 0);
     pa_rtpoll_item_set_before_callback(w, worker);
 
-    pa_rtpoll_set_timer_relative(p, 10000000); /* 10 s */
+    pa_rtpoll_set_timer_relative(p, 4 * PA_USEC_PER_SEC);
 
     pa_rtpoll_run(p, 1);
 
-- 
1.7.4.1



More information about the pulseaudio-discuss mailing list