Skip to content

Commit 9225471

Browse files
Flamefireerikd
authored andcommitted
Add corner cases to tests
1 parent a2e6010 commit 9225471

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/float_short_test.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ static void
4545
float_to_short_test (void)
4646
{
4747
static float fpos [] =
48-
{ 0.95, 0.99, 1.0, 1.01, 1.1, 2.0, 11.1, 111.1, 2222.2, 33333.3
48+
{ 0.95, 0.99, 1.0, 1.01, 1.1, 2.0, 11.1, 111.1, 2222.2, 33333.3,
49+
// Some "almost 1" as corner cases
50+
32767./32768., (32767. + 0.4)/32768., (32767. + 0.5)/32768., (32767. + 0.6)/32768., (32767. + 0.9)/32768.,
4951
} ;
5052
static float fneg [] =
51-
{ -0.95, -0.99, -1.0, -1.01, -1.1, -2.0, -11.1, -111.1, -2222.2, -33333.3
53+
{ -0.95, -0.99, -1.0, -1.01, -1.1, -2.0, -11.1, -111.1, -2222.2, -33333.3,
54+
// Some "almost 1" as corner cases
55+
-32767./32768., -(32767. + 0.4)/32768., -(32767. + 0.5)/32768., -(32767. + 0.6)/32768., -(32767. + 0.9)/32768.,
5256
} ;
5357

5458
static short out [MAX (ARRAY_LEN (fpos), ARRAY_LEN (fneg))] ;

0 commit comments

Comments
 (0)