shithub: libsamplerate

Download patch

ref: 9204b0344a8f687aff7dcc9444bb4ed073de1b7d
parent: 9863cefd5e86d5445e86a777caf7e9cdc557949c
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Mon Dec 15 16:43:18 EST 2008

tests/ : Update multichannel tests to make sure tests include tests for 6 channels with the Sinc converters.

--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
     * tests/util.c
     Make sure FILE* is closed. Thanks Erik Hovland.
 
+    * tests/multi_channel_test.c tests/multichan_throughput_test.c
+    Update tests to make sure tests include tests for 6 channels with the Sinc
+    converters.
+
 2008-12-13  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * tests/multichan_throughput_test.c
--- a/tests/multi_channel_test.c
+++ b/tests/multi_channel_test.c
@@ -30,7 +30,7 @@
 #define	BUFFER_LEN		50000
 #define	BLOCK_LEN		(12)
 
-#define	MAX_CHANNELS	4
+#define	MAX_CHANNELS	6
 
 static void simple_test (int converter, int channel_count, double target_snr) ;
 static void process_test (int converter, int channel_count, double target_snr) ;
@@ -39,51 +39,31 @@
 int
 main (void)
 {	double target ;
+	int k ;
 
 	puts ("\n    Zero Order Hold interpolator :") ;
 	target = 38.0 ;
-	simple_test		(SRC_ZERO_ORDER_HOLD, 1, target) ;
-	process_test	(SRC_ZERO_ORDER_HOLD, 1, target) ;
-	callback_test	(SRC_ZERO_ORDER_HOLD, 1, target) ;
-	simple_test		(SRC_ZERO_ORDER_HOLD, 2, target) ;
-	process_test	(SRC_ZERO_ORDER_HOLD, 2, target) ;
-	callback_test	(SRC_ZERO_ORDER_HOLD, 2, target) ;
-	simple_test		(SRC_ZERO_ORDER_HOLD, 3, target) ;
-	process_test	(SRC_ZERO_ORDER_HOLD, 3, target) ;
-	callback_test	(SRC_ZERO_ORDER_HOLD, 3, target) ;
-	simple_test		(SRC_ZERO_ORDER_HOLD, 4, target) ;
-	process_test	(SRC_ZERO_ORDER_HOLD, 4, target) ;
-	callback_test	(SRC_ZERO_ORDER_HOLD, 4, target) ;
+	for (k = 1 ; k <= MAX_CHANNELS ; k++)
+	{	simple_test		(SRC_ZERO_ORDER_HOLD, k, target) ;
+		process_test	(SRC_ZERO_ORDER_HOLD, k, target) ;
+		callback_test	(SRC_ZERO_ORDER_HOLD, k, target) ;
+		} ;
 
 	puts ("\n    Linear interpolator :") ;
 	target = 79.0 ;
-	simple_test		(SRC_LINEAR, 1, target) ;
-	process_test	(SRC_LINEAR, 1, target) ;
-	callback_test	(SRC_LINEAR, 1, target) ;
-	simple_test		(SRC_LINEAR, 2, target) ;
-	process_test	(SRC_LINEAR, 2, target) ;
-	callback_test	(SRC_LINEAR, 2, target) ;
-	simple_test		(SRC_LINEAR, 3, target) ;
-	process_test	(SRC_LINEAR, 3, target) ;
-	callback_test	(SRC_LINEAR, 3, target) ;
-	simple_test		(SRC_LINEAR, 4, target) ;
-	process_test	(SRC_LINEAR, 4, target) ;
-	callback_test	(SRC_LINEAR, 4, target) ;
+	for (k = 1 ; k <= MAX_CHANNELS ; k++)
+	{	simple_test		(SRC_LINEAR, k, target) ;
+		process_test	(SRC_LINEAR, k, target) ;
+		callback_test	(SRC_LINEAR, k, target) ;
+		} ;
 
 	puts ("\n    Sinc interpolator :") ;
 	target = 100.0 ;
-	simple_test		(SRC_SINC_FASTEST, 1, target) ;
-	process_test	(SRC_SINC_FASTEST, 1, target) ;
-	callback_test	(SRC_SINC_FASTEST, 1, target) ;
-	simple_test		(SRC_SINC_FASTEST, 2, target) ;
-	process_test	(SRC_SINC_FASTEST, 2, target) ;
-	callback_test	(SRC_SINC_FASTEST, 2, target) ;
-	simple_test		(SRC_SINC_FASTEST, 3, target) ;
-	process_test	(SRC_SINC_FASTEST, 3, target) ;
-	callback_test	(SRC_SINC_FASTEST, 3, target) ;
-	simple_test		(SRC_SINC_FASTEST, 4, target) ;
-	process_test	(SRC_SINC_FASTEST, 4, target) ;
-	callback_test	(SRC_SINC_FASTEST, 4, target) ;
+	for (k = 1 ; k <= MAX_CHANNELS ; k++)
+	{	simple_test		(SRC_SINC_FASTEST, k, target) ;
+		process_test	(SRC_SINC_FASTEST, k, target) ;
+		callback_test	(SRC_SINC_FASTEST, k, target) ;
+		} ;
 
 	puts ("") ;
 
--- a/tests/multichan_throughput_test.c
+++ b/tests/multichan_throughput_test.c
@@ -100,7 +100,8 @@
 
 static void
 single_run (void)
-{	int k ;
+{	const int max_channels = 7 ;
+	int k ;
 
 	printf ("\n    CPU : ") ;
 	print_cpu_name () ;
@@ -111,15 +112,15 @@
 		"    ---------------------------------------------------------------------"
 		) ;
 
-	for (k = 1 ; k <= 5 ; k++)
+	for (k = 1 ; k <= max_channels / 2 ; k++)
 		throughput_test (SRC_SINC_FASTEST, k, 0) ;
 
 	puts ("") ;
-	for (k = 1 ; k <= 5 ; k++)
+	for (k = 1 ; k <= max_channels / 2 ; k++)
 		throughput_test (SRC_SINC_MEDIUM_QUALITY, k, 0) ;
 
 	puts ("") ;
-	for (k = 1 ; k <= 5 ; k++)
+	for (k = 1 ; k <= max_channels ; k++)
 		throughput_test (SRC_SINC_BEST_QUALITY, k, 0) ;
 
 	puts ("") ;