shithub: libsamplerate

Download patch

ref: 71776af87ffbf28779b4164adc27224b24e5c8b3
parent: 98d1963b5690158945125e4392416aace66eaa67
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Mon Feb 16 16:43:33 EST 2009

tests/callback_test.c : Work around rounding error in termination test on x86_64.

--- a/tests/callback_test.c
+++ b/tests/callback_test.c
@@ -137,11 +137,11 @@
 
 	src_state = src_delete (src_state) ;
 
-	if (fabs (read_total - src_ratio * ARRAY_LEN (test_callback_data.data)) > src_ratio)
+	if (fabs (read_total / src_ratio - ARRAY_LEN (test_callback_data.data)) > 2.0)
 	{	printf ("\n\nLine %d : input / output length mismatch.\n\n", __LINE__) ;
 		printf ("    input len  : %d\n", ARRAY_LEN (test_callback_data.data)) ;
-		printf ("    output len : %ld (should be %g +/- %g)\n\n", read_total,
-					floor (0.5 + src_ratio * ARRAY_LEN (test_callback_data.data)), ceil (src_ratio)) ;
+		printf ("    output len : %ld (should be %g +/- 2)\n\n", read_total,
+					floor (0.5 + src_ratio * ARRAY_LEN (test_callback_data.data))) ;
 		exit (1) ;
 		} ;