Commit 3d720ba38106047b8e19470c4eb9c0cc76bf1313

Pierre Wendling 2022-05-10T21:05:05

Test: Refactor math suites edge cases. Split infinity and zero checks in their own functions. The result of NAN tests is now logged. The SDL_TestCaseReference structure were renamed to be more explicit.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
diff --git a/test/testautomation_math.c b/test/testautomation_math.c
index b8fd3f4..9e3c713 100644
--- a/test/testautomation_math.c
+++ b/test/testautomation_math.c
@@ -32,26 +32,41 @@ typedef struct
 /* SDL_floor tests functions */
 
 /**
- * \brief Checks edge cases (0 and infinity) for themselves.
+ * \brief Checks positive and negative infinity.
  */
 static int
-floor_edgeCases(void *args)
+floor_infCases(void *args)
 {
     double result;
 
     result = SDL_floor(INFINITY);
-    SDLTest_AssertCheck(INFINITY == result, "Floor(%f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Floor(%f), expected %f, got %f",
                         INFINITY, INFINITY, result);
+
     result = SDL_floor(-INFINITY);
-    SDLTest_AssertCheck(-INFINITY == result, "Floor(%f), expected %f, got %f",
+    SDLTest_AssertCheck(-INFINITY == result,
+                        "Floor(%f), expected %f, got %f",
                         -INFINITY, -INFINITY, result);
 
-    result = SDL_floor(0.0);
-    SDLTest_AssertCheck(0.0 == result, "Floor(%.1f), expected %.1f, got %.1f",
-                        0.0, 0.0, result);
-    result = SDL_floor(-0.0);
-    SDLTest_AssertCheck(-0.0 == result, "Floor(%.1f), expected %.1f, got %.1f",
-                        -0.0, -0.0, result);
+    return TEST_COMPLETED;
+}
+
+/**
+ * \brief Checks positive and negative zero.
+ */
+static int
+floor_zeroCases(void *args)
+{
+    Uint32 i;
+    const double zero_cases[] = { 0.0, -0.0 };
+
+    for (i = 0; i < SDL_arraysize(zero_cases); i++) {
+        const double result = SDL_floor(zero_cases[i]);
+        SDLTest_AssertCheck(result == zero_cases[i],
+                            "Floor(%.1f), expected %.1f, got %.1f",
+                            zero_cases[i], zero_cases[i], result);
+    }
 
     return TEST_COMPLETED;
 }
@@ -62,7 +77,10 @@ floor_edgeCases(void *args)
 static int
 floor_nanCase(void *args)
 {
-    SDLTest_AssertCheck(isnan(SDL_floor(NAN)), "Floor(nan), expected nan");
+    const double result = SDL_floor(NAN);
+    SDLTest_AssertCheck(isnan(result),
+                        "Floor(nan), expected nan, got %f",
+                        result);
     return TEST_COMPLETED;
 }
 
@@ -154,25 +172,42 @@ floor_rangeTest(void *args)
 /* SDL_ceil tests functions */
 
 /**
- * \brief Checks edge cases (0 and infinity) for themselves.
+ * \brief Checks positive and negative infinity.
  */
 static int
-ceil_edgeCases(void *args)
+ceil_infCases(void *args)
 {
     double result;
 
     result = SDL_ceil(INFINITY);
-    SDLTest_AssertCheck(INFINITY == result, "Ceil(%f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Ceil(%f), expected %f, got %f",
                         INFINITY, INFINITY, result);
+
     result = SDL_ceil(-INFINITY);
-    SDLTest_AssertCheck(-INFINITY == result, "Ceil(%f), expected %f, got %f",
+    SDLTest_AssertCheck(-INFINITY == result,
+                        "Ceil(%f), expected %f, got %f",
                         -INFINITY, -INFINITY, result);
 
+    return TEST_COMPLETED;
+}
+
+/**
+ * \brief Checks positive and negative zero.
+ */
+static int
+ceil_zeroCases(void *args)
+{
+    double result;
+
     result = SDL_ceil(0.0);
-    SDLTest_AssertCheck(0.0 == result, "Ceil(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(0.0 == result,
+                        "Ceil(%.1f), expected %.1f, got %.1f",
                         0.0, 0.0, result);
+
     result = SDL_ceil(-0.0);
-    SDLTest_AssertCheck(-0.0 == result, "Ceil(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(-0.0 == result,
+                        "Ceil(%.1f), expected %.1f, got %.1f",
                         -0.0, -0.0, result);
 
     return TEST_COMPLETED;
@@ -184,7 +219,10 @@ ceil_edgeCases(void *args)
 static int
 ceil_nanCase(void *args)
 {
-    SDLTest_AssertCheck(isnan(SDL_ceil(NAN)), "Ceil(nan), expected nan");
+    const double result = SDL_ceil(NAN);
+    SDLTest_AssertCheck(isnan(result),
+                        "Ceil(nan), expected nan, got %f",
+                        result);
     return TEST_COMPLETED;
 }
 
@@ -276,25 +314,42 @@ ceil_rangeTest(void *args)
 /* SDL_trunc tests functions */
 
 /**
- * \brief Checks edge cases (0 and infinity) for themselves.
+ * \brief Checks positive and negative infinity.
  */
 static int
-trunc_edgeCases(void *args)
+trunc_infCases(void *args)
 {
     double result;
 
     result = SDL_trunc(INFINITY);
-    SDLTest_AssertCheck(INFINITY == result, "Trunc(%f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Trunc(%f), expected %f, got %f",
                         INFINITY, INFINITY, result);
+
     result = SDL_trunc(-INFINITY);
-    SDLTest_AssertCheck(-INFINITY == result, "Trunc(%f), expected %f, got %f",
+    SDLTest_AssertCheck(-INFINITY == result,
+                        "Trunc(%f), expected %f, got %f",
                         -INFINITY, -INFINITY, result);
 
+    return TEST_COMPLETED;
+}
+
+/**
+ * \brief Checks positive and negative zero.
+ */
+static int
+trunc_zeroCases(void *args)
+{
+    double result;
+
     result = SDL_trunc(0.0);
-    SDLTest_AssertCheck(0.0 == result, "Trunc(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(0.0 == result,
+                        "Trunc(%.1f), expected %.1f, got %.1f",
                         0.0, 0.0, result);
+
     result = SDL_trunc(-0.0);
-    SDLTest_AssertCheck(-0.0 == result, "Trunc(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(-0.0 == result,
+                        "Trunc(%.1f), expected %.1f, got %.1f",
                         -0.0, -0.0, result);
 
     return TEST_COMPLETED;
@@ -306,7 +361,10 @@ trunc_edgeCases(void *args)
 static int
 trunc_nanCase(void *args)
 {
-    SDLTest_AssertCheck(isnan(SDL_trunc(NAN)), "Trunc(nan), expected nan");
+    const double result = SDL_trunc(NAN);
+    SDLTest_AssertCheck(isnan(result),
+                        "Trunc(nan), expected nan, got %f",
+                        result);
     return TEST_COMPLETED;
 }
 
@@ -398,25 +456,42 @@ trunc_rangeTest(void *args)
 /* SDL_round tests functions */
 
 /**
- * \brief Checks edge cases (0 and infinity) for themselves.
+ * \brief Checks positive and negative infinity.
  */
 static int
-round_edgeCases(void *args)
+round_infCases(void *args)
 {
     double result;
 
     result = SDL_round(INFINITY);
-    SDLTest_AssertCheck(INFINITY == result, "Round(%f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Round(%f), expected %f, got %f",
                         INFINITY, INFINITY, result);
+
     result = SDL_round(-INFINITY);
-    SDLTest_AssertCheck(-INFINITY == result, "Round(%f), expected %f, got %f",
+    SDLTest_AssertCheck(-INFINITY == result,
+                        "Round(%f), expected %f, got %f",
                         -INFINITY, -INFINITY, result);
 
+    return TEST_COMPLETED;
+}
+
+/**
+ * \brief Checks positive and negative zero.
+ */
+static int
+round_zeroCases(void *args)
+{
+    double result;
+
     result = SDL_round(0.0);
-    SDLTest_AssertCheck(0.0 == result, "Round(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(0.0 == result,
+                        "Round(%.1f), expected %.1f, got %.1f",
                         0.0, 0.0, result);
+
     result = SDL_round(-0.0);
-    SDLTest_AssertCheck(-0.0 == result, "Round(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(-0.0 == result,
+                        "Round(%.1f), expected %.1f, got %.1f",
                         -0.0, -0.0, result);
 
     return TEST_COMPLETED;
@@ -428,7 +503,10 @@ round_edgeCases(void *args)
 static int
 round_nanCase(void *args)
 {
-    SDLTest_AssertCheck(isnan(SDL_round(NAN)), "Round(nan), expected nan");
+    const double result = SDL_round(NAN);
+    SDLTest_AssertCheck(isnan(result),
+                        "Round(nan), expected nan, got %f",
+                        result);
     return TEST_COMPLETED;
 }
 
@@ -520,25 +598,42 @@ round_rangeTest(void *args)
 /* SDL_fabs tests functions */
 
 /**
- * \brief Checks edge cases (0 and infinity).
+ * \brief Checks positive and negative infinity.
  */
 static int
-fabs_edgeCases(void *args)
+fabs_infCases(void *args)
 {
     double result;
 
     result = SDL_fabs(INFINITY);
-    SDLTest_AssertCheck(INFINITY == result, "Fabs(%f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Fabs(%f), expected %f, got %f",
                         INFINITY, INFINITY, result);
+
     result = SDL_fabs(-INFINITY);
-    SDLTest_AssertCheck(INFINITY == result, "Fabs(%f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Fabs(%f), expected %f, got %f",
                         -INFINITY, INFINITY, result);
 
+    return TEST_COMPLETED;
+}
+
+/**
+ * \brief Checks positive and negative zero
+ */
+static int
+fabs_zeroCases(void *args)
+{
+    double result;
+
     result = SDL_fabs(0.0);
-    SDLTest_AssertCheck(0.0 == result, "Fabs(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(0.0 == result,
+                        "Fabs(%.1f), expected %.1f, got %.1f",
                         0.0, 0.0, result);
+
     result = SDL_fabs(-0.0);
-    SDLTest_AssertCheck(0.0 == result, "Fabs(%.1f), expected %.1f, got %.1f",
+    SDLTest_AssertCheck(0.0 == result,
+                        "Fabs(%.1f), expected %.1f, got %.1f",
                         -0.0, 0.0, result);
 
     return TEST_COMPLETED;
@@ -550,7 +645,10 @@ fabs_edgeCases(void *args)
 static int
 fabs_nanCase(void *args)
 {
-    SDLTest_AssertCheck(isnan(SDL_fabs(NAN)), "Fabs(nan), expected nan");
+    const double result = SDL_fabs(NAN);
+    SDLTest_AssertCheck(isnan(result),
+                        "Fabs(nan), expected nan, got %f",
+                        result);
     return TEST_COMPLETED;
 }
 
@@ -588,25 +686,62 @@ fabs_rangeTest(void *args)
 /* SDL_copysign tests functions */
 
 /**
- * \brief Checks edge cases (0 and infinity).
+ * \brief Checks positive and negative inifnity.
  */
 static int
-copysign_edgeCases(void *args)
+copysign_infCases(void *args)
 {
     double result;
 
     result = SDL_copysign(INFINITY, -1.0);
-    SDLTest_AssertCheck(-INFINITY == result, "Copysign(%f,%.1f), expected %f, got %f",
+    SDLTest_AssertCheck(-INFINITY == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
                         INFINITY, -1.0, -INFINITY, result);
+
+    result = SDL_copysign(INFINITY, 1.0);
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
+                        INFINITY, 1.0, INFINITY, result);
+
+    result = SDL_copysign(-INFINITY, -1.0);
+    SDLTest_AssertCheck(-INFINITY == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
+                        -INFINITY, -1.0, -INFINITY, result);
+
     result = SDL_copysign(-INFINITY, 1.0);
-    SDLTest_AssertCheck(INFINITY == result, "Copysign(%f,%.1f), expected %f, got %f",
+    SDLTest_AssertCheck(INFINITY == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
                         -INFINITY, 1.0, INFINITY, result);
 
+    return TEST_COMPLETED;
+}
+
+/**
+ * \brief Checks positive and negative zero.
+ */
+static int
+copysign_zeroCases(void *args)
+{
+    double result;
+
     result = SDL_copysign(0.0, -1.0);
-    SDLTest_AssertCheck(0.0 == result, "Copysign(%f,%.1f), expected %f, got %f",
-                        0.0, -1.0, 0.0, result);
+    SDLTest_AssertCheck(-0.0 == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
+                        0.0, -1.0, -0.0, result);
+
+    result = SDL_copysign(0.0, 1.0);
+    SDLTest_AssertCheck(0.0 == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
+                        0.0, 1.0, 0.0, result);
+
+    result = SDL_copysign(-0.0, -1.0);
+    SDLTest_AssertCheck(-0.0 == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
+                        -0.0, -1.0, -0.0, result);
+
     result = SDL_copysign(-0.0, 1.0);
-    SDLTest_AssertCheck(0.0 == result, "Copysign(%f,%.1f), expected %f, got %f",
+    SDLTest_AssertCheck(0.0 == result,
+                        "Copysign(%f,%.1f), expected %f, got %f",
                         -0.0, 1.0, 0.0, result);
 
     return TEST_COMPLETED;
@@ -616,10 +751,19 @@ copysign_edgeCases(void *args)
  * \brief Checks the NaN cases.
  */
 static int
-copysign_nanCase(void *args)
+copysign_nanCases(void *args)
 {
-    SDLTest_AssertCheck(isnan(SDL_copysign(NAN, 1.0)), "Copysign(nan,1.0), expected nan");
-    SDLTest_AssertCheck(isnan(SDL_copysign(NAN, -1.0)), "Copysign(nan,-1.0), expected nan");
+    double result;
+
+    result = SDL_copysign(NAN, 1.0);
+    SDLTest_AssertCheck(isnan(result),
+                        "Copysign(nan,1.0), expected nan, got %f",
+                        result);
+
+    result = SDL_copysign(NAN, -1.0);
+    SDLTest_AssertCheck(isnan(result),
+                        "Copysign(nan,-1.0), expected nan, got %f",
+                        result);
     return TEST_COMPLETED;
 }
 
@@ -668,133 +812,166 @@ copysign_rangeTest(void *args)
 
 /* SDL_floor test cases */
 
-static const SDLTest_TestCaseReference floorTest1 = {
-    (SDLTest_TestCaseFp) floor_edgeCases, "floor_edgeCases",
-    "Check positive and negative infinity and 0", TEST_ENABLED
+static const SDLTest_TestCaseReference floorTestInf = {
+    (SDLTest_TestCaseFp) floor_infCases, "floor_infCases",
+    "Check positive and negative infinity", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference floorTest2 = {
+static const SDLTest_TestCaseReference floorTestZero = {
+    (SDLTest_TestCaseFp) floor_zeroCases, "floor_zeroCases",
+    "Check positive and negative zero", TEST_ENABLED
+};
+static const SDLTest_TestCaseReference floorTestNan = {
     (SDLTest_TestCaseFp) floor_nanCase, "floor_nanCase",
     "Check the NaN special case", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference floorTest3 = {
+static const SDLTest_TestCaseReference floorTestRound = {
     (SDLTest_TestCaseFp) floor_roundNumbersCases, "floor_roundNumberCases",
     "Check a set of round numbers", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference floorTest4 = {
+static const SDLTest_TestCaseReference floorTestFraction = {
     (SDLTest_TestCaseFp) floor_fractionCases, "floor_fractionCases",
     "Check a set of fractions", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference floorTest5 = {
+static const SDLTest_TestCaseReference floorTestRange = {
     (SDLTest_TestCaseFp) floor_rangeTest, "floor_rangeTest",
     "Check a range of positive integer", TEST_ENABLED
 };
 
 /* SDL_ceil test cases */
 
-static const SDLTest_TestCaseReference ceilTest1 = {
-    (SDLTest_TestCaseFp) ceil_edgeCases, "ceil_edgeCases",
-    "Check positive and negative infinity and 0", TEST_ENABLED
+static const SDLTest_TestCaseReference ceilTestInf = {
+    (SDLTest_TestCaseFp) ceil_infCases, "ceil_infCases",
+    "Check positive and negative infinity", TEST_ENABLED
+};
+static const SDLTest_TestCaseReference ceilTestZero = {
+    (SDLTest_TestCaseFp) ceil_zeroCases, "ceil_zeroCases",
+    "Check positive and negative zero", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference ceilTest2 = {
+static const SDLTest_TestCaseReference ceilTestNan = {
     (SDLTest_TestCaseFp) ceil_nanCase, "ceil_nanCase",
     "Check the NaN special case", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference ceilTest3 = {
+static const SDLTest_TestCaseReference ceilTestRound = {
     (SDLTest_TestCaseFp) ceil_roundNumbersCases, "ceil_roundNumberCases",
     "Check a set of round numbers", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference ceilTest4 = {
+static const SDLTest_TestCaseReference ceilTestFraction = {
     (SDLTest_TestCaseFp) ceil_fractionCases, "ceil_fractionCases",
     "Check a set of fractions", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference ceilTest5 = {
+static const SDLTest_TestCaseReference ceilTestRange = {
     (SDLTest_TestCaseFp) ceil_rangeTest, "ceil_rangeTest",
     "Check a range of positive integer", TEST_ENABLED
 };
 
 /* SDL_trunc test cases */
 
-static const SDLTest_TestCaseReference truncTest1 = {
-    (SDLTest_TestCaseFp) trunc_edgeCases, "trunc_edgeCases",
-    "Check positive and negative infinity and 0", TEST_ENABLED
+static const SDLTest_TestCaseReference truncTestInf = {
+    (SDLTest_TestCaseFp) trunc_infCases, "trunc_infCases",
+    "Check positive and negative infinity", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference truncTest2 = {
+static const SDLTest_TestCaseReference truncTestZero = {
+    (SDLTest_TestCaseFp) trunc_zeroCases, "trunc_zeroCases",
+    "Check positive and negative zero", TEST_ENABLED
+};
+static const SDLTest_TestCaseReference truncTestNan = {
     (SDLTest_TestCaseFp) trunc_nanCase, "trunc_nanCase",
     "Check the NaN special case", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference truncTest3 = {
+static const SDLTest_TestCaseReference truncTestRound = {
     (SDLTest_TestCaseFp) trunc_roundNumbersCases, "trunc_roundNumberCases",
     "Check a set of round numbers", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference truncTest4 = {
+static const SDLTest_TestCaseReference truncTestFraction = {
     (SDLTest_TestCaseFp) trunc_fractionCases, "trunc_fractionCases",
     "Check a set of fractions", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference truncTest5 = {
+static const SDLTest_TestCaseReference truncTestRange = {
     (SDLTest_TestCaseFp) trunc_rangeTest, "trunc_rangeTest",
     "Check a range of positive integer", TEST_ENABLED
 };
 
 /* SDL_round test cases */
 
-static const SDLTest_TestCaseReference roundTest1 = {
-    (SDLTest_TestCaseFp) round_edgeCases, "round_edgeCases",
-    "Check positive and negative infinity and 0", TEST_ENABLED
+static const SDLTest_TestCaseReference roundTestInf = {
+    (SDLTest_TestCaseFp) round_infCases, "round_infCases",
+    "Check positive and negative infinity", TEST_ENABLED
+};
+static const SDLTest_TestCaseReference roundTestZero = {
+    (SDLTest_TestCaseFp) round_zeroCases, "round_zeroCases",
+    "Check positive and negative zero", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference roundTest2 = {
+static const SDLTest_TestCaseReference roundTestNan = {
     (SDLTest_TestCaseFp) round_nanCase, "round_nanCase",
     "Check the NaN special case", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference roundTest3 = {
+static const SDLTest_TestCaseReference roundTestRound = {
     (SDLTest_TestCaseFp) round_roundNumbersCases, "round_roundNumberCases",
     "Check a set of round numbers", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference roundTest4 = {
+static const SDLTest_TestCaseReference roundTestFraction = {
     (SDLTest_TestCaseFp) round_fractionCases, "round_fractionCases",
     "Check a set of fractions", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference roundTest5 = {
+static const SDLTest_TestCaseReference roundTestRange = {
     (SDLTest_TestCaseFp) round_rangeTest, "round_rangeTest",
     "Check a range of positive integer", TEST_ENABLED
 };
 
 /* SDL_fabs test cases */
 
-static const SDLTest_TestCaseReference fabsTest1 = {
-    (SDLTest_TestCaseFp) fabs_edgeCases, "fabs_edgeCases",
-    "Check positive and negative infinity and 0", TEST_ENABLED
+static const SDLTest_TestCaseReference fabsTestInf = {
+    (SDLTest_TestCaseFp) fabs_infCases, "fabs_infCases",
+    "Check positive and negative infinity", TEST_ENABLED
+};
+static const SDLTest_TestCaseReference fabsTestZero = {
+    (SDLTest_TestCaseFp) fabs_zeroCases, "fabs_zeroCases",
+    "Check positive and negative zero", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference fabsTest2 = {
+static const SDLTest_TestCaseReference fabsTestNan = {
     (SDLTest_TestCaseFp) fabs_nanCase, "fabs_nanCase",
     "Check the NaN special case", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference fabsTest3 = {
+static const SDLTest_TestCaseReference fabsTestRange = {
     (SDLTest_TestCaseFp) fabs_rangeTest, "fabs_rangeTest",
     "Check a range of positive integer", TEST_ENABLED
 };
 
 /* SDL_copysign test cases */
 
-static const SDLTest_TestCaseReference copysignTest1 = {
-    (SDLTest_TestCaseFp) copysign_edgeCases, "copysign_edgeCases",
-    "Check positive and negative infinity and 0", TEST_ENABLED
+static const SDLTest_TestCaseReference copysignTestInf = {
+    (SDLTest_TestCaseFp) copysign_infCases, "copysign_infCases",
+    "Check positive and negative infinity", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference copysignTest2 = {
-    (SDLTest_TestCaseFp) copysign_nanCase, "copysign_nanCase",
-    "Check the NaN special case", TEST_ENABLED
+static const SDLTest_TestCaseReference copysignTestZero = {
+    (SDLTest_TestCaseFp) copysign_zeroCases, "copysign_zeroCases",
+    "Check positive and negative zero", TEST_ENABLED
+};
+static const SDLTest_TestCaseReference copysignTestNan = {
+    (SDLTest_TestCaseFp) copysign_nanCases, "copysign_nanCase",
+    "Check the NaN special cases", TEST_ENABLED
 };
-static const SDLTest_TestCaseReference copysignTest3 = {
+static const SDLTest_TestCaseReference copysignTestRange = {
     (SDLTest_TestCaseFp) copysign_rangeTest, "copysign_rangeTest",
     "Check a range of positive integer", TEST_ENABLED
 };
 
 static const SDLTest_TestCaseReference *mathTests[] = {
-    &floorTest1, &floorTest2, &floorTest3, &floorTest4, &floorTest5,
-    &ceilTest1, &ceilTest2, &ceilTest3, &ceilTest4, &ceilTest5,
-    &truncTest1, &truncTest2, &truncTest3, &truncTest4, &truncTest5,
-    &roundTest1, &roundTest2, &roundTest3, &roundTest4, &roundTest5,
-    &fabsTest1, &fabsTest2, &fabsTest3,
-    &copysignTest1, &copysignTest2, &copysignTest3,
+    &floorTestInf, &floorTestZero, &floorTestNan,
+    &floorTestRound, &floorTestFraction, &floorTestRange,
+
+    &ceilTestInf, &ceilTestZero, &ceilTestNan,
+    &ceilTestRound, &ceilTestFraction, &ceilTestRange,
+
+    &truncTestInf, &truncTestZero, &truncTestNan,
+    &truncTestRound, &truncTestFraction, &truncTestRange,
+
+    &roundTestInf, &roundTestZero, &roundTestNan,
+    &roundTestRound, &roundTestFraction, &roundTestRange,
+
+    &fabsTestInf, &fabsTestZero, &fabsTestNan, &fabsTestRange,
+
+    &copysignTestInf, &copysignTestZero, &copysignTestNan, &copysignTestRange,
     NULL
 };