[pulseaudio-discuss] [PATCH 4/4] resampler-test: Change the default test case to test all methods

poljar (Damir Jelić) poljarinho at gmail.com
Tue Dec 10 16:42:51 PST 2013


This changes the default behaviour of our resampler-test if we
don't provide a resampling method or sample format on the command line.

If neither a method or a sample format is specified we test all
resampling methods.

This way if we run 'make check' all our resampling methods will be
tested.
---
 src/tests/resampler-test.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/tests/resampler-test.c b/src/tests/resampler-test.c
index 096d8e1..5c4f348 100644
--- a/src/tests/resampler-test.c
+++ b/src/tests/resampler-test.c
@@ -390,7 +390,7 @@ int main(int argc, char *argv[]) {
     pa_mempool *pool = NULL;
     pa_sample_spec a, b;
     int ret = 1, c;
-    bool all_formats = true;
+    bool all_formats = true, all_methods = true;
     pa_resample_method_t method;
     int seconds;
 
@@ -457,7 +457,7 @@ int main(int argc, char *argv[]) {
 
             case ARG_FROM_SAMPLEFORMAT:
                 a.format = pa_parse_sample_format(optarg);
-                all_formats = false;
+                all_formats = all_methods = false;
                 break;
 
             case ARG_FROM_SAMPLERATE:
@@ -470,7 +470,7 @@ int main(int argc, char *argv[]) {
 
             case ARG_TO_SAMPLEFORMAT:
                 b.format = pa_parse_sample_format(optarg);
-                all_formats = false;
+                all_formats = all_methods = false;
                 break;
 
             case ARG_TO_SAMPLERATE:
@@ -488,6 +488,7 @@ int main(int argc, char *argv[]) {
                     goto quit;
                 }
                 method = pa_parse_resample_method(optarg);
+                all_methods = false;
                 break;
 
             default:
@@ -500,8 +501,11 @@ int main(int argc, char *argv[]) {
 
     if (!all_formats)
         single_format_test(pool, method, &a, &b, seconds);
-    else
+    else if (!all_methods)
         all_formats_test(pool, method, &a, &b);
+    else
+        for (method = 0; method < PA_RESAMPLER_MAX; method++)
+            all_formats_test(pool, method, &a, &b);
 
  quit:
     if (pool)
-- 
1.8.4.2



More information about the pulseaudio-discuss mailing list