shithub: libsamplerate

Download patch

ref: 9225471ff240746d1e764845c5e6a97e76ee7486
parent: a2e60106af2e1b327680ea0fa837795f7f687ba3
author: Alexander Grund <[email protected]>
date: Fri Aug 9 15:05:24 EDT 2019

Add corner cases to tests

--- a/tests/float_short_test.c
+++ b/tests/float_short_test.c
@@ -45,10 +45,14 @@
 float_to_short_test (void)
 {
 	static float fpos [] =
-	{	0.95, 0.99, 1.0, 1.01, 1.1, 2.0, 11.1, 111.1, 2222.2, 33333.3
+	{	0.95, 0.99, 1.0, 1.01, 1.1, 2.0, 11.1, 111.1, 2222.2, 33333.3,
+	 	// Some "almost 1" as corner cases
+		32767./32768., (32767. + 0.4)/32768., (32767. + 0.5)/32768., (32767. + 0.6)/32768., (32767. + 0.9)/32768.,
 		} ;
 	static float fneg [] =
-	{	-0.95, -0.99, -1.0, -1.01, -1.1, -2.0, -11.1, -111.1, -2222.2, -33333.3
+	{	-0.95, -0.99, -1.0, -1.01, -1.1, -2.0, -11.1, -111.1, -2222.2, -33333.3,
+	 	// Some "almost 1" as corner cases
+		-32767./32768., -(32767. + 0.4)/32768., -(32767. + 0.5)/32768., -(32767. + 0.6)/32768., -(32767. + 0.9)/32768.,
 		} ;
 
 	static short out [MAX (ARRAY_LEN (fpos), ARRAY_LEN (fneg))] ;