Skip to content

Commit a706ad6

Browse files
committed
Force test suffixes to be strictly sequential
1 parent 34043e3 commit a706ad6

3 files changed

Lines changed: 50 additions & 50 deletions

File tree

test/pico_float_test/custom_double_funcs_test.c

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,18 @@ int test() {
224224
test_checku(double2ufix(3.24999, 2), 12, "double2ufix6");
225225
test_checku(double2ufix(3.25, 2), 13, "double2ufix7");
226226
test_checku(double2ufix(3.0, -1), 1, "double2ufix8"); // not very useful
227-
test_checku(double2ufix(0.0, 16), 0, "double2ufix12");
228-
test_checku(double2ufix(-0.0, 16), 0, "double2ufix13");
229-
test_checku(double2ufix(0.0, -16), 0, "double2ufix14");
230-
test_checku(double2ufix(-0.0, -16), 0, "double2ufix15");
227+
test_checku(double2ufix(0.0, 16), 0, "double2ufix9");
228+
test_checku(double2ufix(-0.0, 16), 0, "double2ufix10");
229+
test_checku(double2ufix(0.0, -16), 0, "double2ufix11");
230+
test_checku(double2ufix(-0.0, -16), 0, "double2ufix12");
231231
u64d.u = 0x7fe0000000012345ull;
232-
test_checku(double2ufix(u64d.d, 0), UINT32_MAX, "double2ufix16a");
233-
test_checku(double2ufix(u64d.d, 1), UINT32_MAX, "double2ufix16b");
234-
test_checku(double2ufix(u64d.d, 2), UINT32_MAX, "double2ufix16c");
232+
test_checku(double2ufix(u64d.d, 0), UINT32_MAX, "double2ufix13a");
233+
test_checku(double2ufix(u64d.d, 1), UINT32_MAX, "double2ufix13b");
234+
test_checku(double2ufix(u64d.d, 2), UINT32_MAX, "double2ufix13c");
235235
u64d.u = 0xffe0000000012345ull;
236-
test_checku(double2ufix(u64d.d, 0), 0, "double2ufix17a");
237-
test_checku(double2ufix(u64d.d, 1), 0, "double2ufix17b");
238-
test_checku(double2ufix(u64d.d, 2), 0, "double2ufix17c");
236+
test_checku(double2ufix(u64d.d, 0), 0, "double2ufix14a");
237+
test_checku(double2ufix(u64d.d, 1), 0, "double2ufix14b");
238+
test_checku(double2ufix(u64d.d, 2), 0, "double2ufix14c");
239239
#endif
240240

241241
#if PICO_DOUBLE_HAS_DOUBLE_TO_FIX64_M_CONVERSIONS
@@ -259,38 +259,38 @@ int test() {
259259
test_checki64(double2fix64(-3.0, -1), -2, "double2fix6410"); // not very useful
260260
test_checki64(double2fix64(2147483648.0 * 2147483648.0, 16), INT64_MAX, "double2fix6411");
261261
test_checki64(double2fix64(0.0, 16), 0, "double2fix6412");
262-
test_checki64(double2fix64(-0.0, 16), 0, "double2fix6413");
263262
test_checki64(double2fix64(0.0, -16), 0, "double2fix6412b");
263+
test_checki64(double2fix64(-0.0, 16), 0, "double2fix6413");
264264
test_checki64(double2fix64(-0.0, -16), 0, "double2fix6413b");
265265
test_checki64(double2fix64(-3.25, 40), -13ll * (1ll << 38), "double2fix6414");
266266
u64d.u = 0xc00a000000000001;
267267
test_checki64(double2fix64(u64d.d, 40), -13ll * (1ll << 38) - 1ll, "double2fix6414b");
268268

269269
u64d.u = 0xc00a000080000001;
270-
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18) - 2ll, "double2fix6415c");
270+
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18) - 2ll, "double2fix6414c");
271271
u64d.u = 0xc00a000080000000;
272-
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18) - 1ll, "double2fix6415d");
272+
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18) - 1ll, "double2fix6414d");
273273
u64d.u = 0xc00a000000000001;
274-
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18) - 1ll, "double2fix6415e");
274+
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18) - 1ll, "double2fix6414e");
275275
u64d.u = 0xc00a000000000000;
276-
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18), "double2fix6415g");
276+
test_checki64(double2fix64(u64d.d, 20), -13ll * (1ll << 18), "double2fix6414f");
277277

278278
u64d.u = 0xc00a000080000001;
279-
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17) - 1ll, "double2fix6415h");
279+
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17) - 1ll, "double2fix6414g");
280280
u64d.u = 0xc00a000080000000;
281-
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17) - 1ll, "double2fix6415i");
281+
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17) - 1ll, "double2fix6414h");
282282
u64d.u = 0xc00a000000000001;
283-
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17) - 1ll, "double2fix6415j");
283+
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17) - 1ll, "double2fix6414i");
284284
u64d.u = 0xc00a000000000000;
285-
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17), "double2fix6415k");
285+
test_checki64(double2fix64(u64d.d, 19), -13ll * (1ll << 17), "double2fix6414j");
286286
u64d.u = 0x7fe0000000012345ull;
287-
test_checki64(double2fix64(u64d.d, 0), INT64_MAX, "double2fix6416a");
288-
test_checki64(double2fix64(u64d.d, 1), INT64_MAX, "double2fix6416b");
289-
test_checki64(double2fix64(u64d.d, 2), INT64_MAX, "double2fix6416c");
287+
test_checki64(double2fix64(u64d.d, 0), INT64_MAX, "double2fix6415a");
288+
test_checki64(double2fix64(u64d.d, 1), INT64_MAX, "double2fix6415b");
289+
test_checki64(double2fix64(u64d.d, 2), INT64_MAX, "double2fix6415c");
290290
u64d.u = 0xffe0000000012345ull;
291-
test_checki64(double2fix64(u64d.d, 0), INT64_MIN, "double2fix6417a");
292-
test_checki64(double2fix64(u64d.d, 1), INT64_MIN, "double2fix6417b");
293-
test_checki64(double2fix64(u64d.d, 2), INT64_MIN, "double2fix6417c");
291+
test_checki64(double2fix64(u64d.d, 0), INT64_MIN, "double2fix6416a");
292+
test_checki64(double2fix64(u64d.d, 1), INT64_MIN, "double2fix6416b");
293+
test_checki64(double2fix64(u64d.d, 2), INT64_MIN, "double2fix6416c");
294294

295295
printf("double2ufix64\n");
296296
test_checku64(double2ufix64(3.5, 8), 0x380, "double2ufix641");
@@ -338,8 +338,8 @@ int test() {
338338
test_checki(double2fix_z(-0.75, 1), -1, "double2fix_z10");
339339
test_checki(double2fix_z(-3.0, -1), -1, "double2fix_z11"); // not very useful
340340
test_checki(double2fix_z(0.0, 16), 0, "double2fix_z12");
341-
test_checki(double2fix_z(-0.0, 16), 0, "double2fix_z13");
342341
test_checki(double2fix_z(0.0, -16), 0, "double2fix_z12b");
342+
test_checki(double2fix_z(-0.0, 16), 0, "double2fix_z13");
343343
test_checki(double2fix_z(-0.0, -16), 0, "double2fix_z13b");
344344
u64d.u = 0x7fe0000000012345ull;
345345
test_checki(double2fix_z(u64d.d, 0), INT32_MAX, "double2fix_z14a");
@@ -411,16 +411,16 @@ int test() {
411411
u64d.u = 0xc00a000000000001;
412412
test_checki64(double2fix64_z(u64d.d, 20), -13ll * (1ll << 18), "double2fix64_z15e");
413413
u64d.u = 0xc00a000000000000;
414-
test_checki64(double2fix64_z(u64d.d, 20), -13ll * (1ll << 18), "double2fix64_z15g");
414+
test_checki64(double2fix64_z(u64d.d, 20), -13ll * (1ll << 18), "double2fix64_z15f");
415415

416416
u64d.u = 0xc00a000080000001;
417-
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15h");
417+
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15g");
418418
u64d.u = 0xc00a000080000000;
419-
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15i");
419+
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15h");
420420
u64d.u = 0xc00a000000000001;
421-
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15j");
421+
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15i");
422422
u64d.u = 0xc00a000000000000;
423-
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15k");
423+
test_checki64(double2fix64_z(u64d.d, 19), -13ll * (1ll << 17), "double2fix64_z15j");
424424
u64d.u = 0x7fe0000000012345ull;
425425
test_checki64(double2fix64_z(u64d.d, 0), INT64_MAX, "double2fix64_z16a");
426426
test_checki64(double2fix64_z(u64d.d, 1), INT64_MAX, "double2fix64_z16b");
@@ -466,8 +466,8 @@ int test() {
466466
test_checki(double2int(0.5), 0, "double2int2");
467467
test_checki(double2int(0.75), 0, "double2int2b");
468468
test_checki(double2int(1.0), 1, "double2int3");
469-
test_checki(double2int(-10.0), -10, "double2int3a");
470-
test_checki(double2int(-0.0), 0, "double2int3b");
469+
test_checki(double2int(-10.0), -10, "double2int3b");
470+
test_checki(double2int(-0.0), 0, "double2int3c");
471471
test_checki(double2int(-0.25), -1, "double2int4");
472472
test_checki(double2int(-0.5), -1, "double2int4b");
473473
test_checki(double2int(-0.75), -1, "double2int5");
@@ -523,8 +523,8 @@ int test() {
523523
test_checki64(double2int64(0.5), 0, "double2int642");
524524
test_checki64(double2int64(0.75), 0, "double2int642b");
525525
test_checki64(double2int64(1.0), 1, "double2int643");
526-
test_checki64(double2int64(-10.0), -10, "double2int643a");
527-
test_checki64(double2int64(-0.0), 0, "double2int643b");
526+
test_checki64(double2int64(-10.0), -10, "double2int643b");
527+
test_checki64(double2int64(-0.0), 0, "double2int643c");
528528
test_checki64(double2int64(-0.25), -1, "double2int644");
529529
test_checki64(double2int64(-0.5), -1, "double2int644b");
530530
test_checki64(double2int64(-0.75), -1, "double2int645");
@@ -575,8 +575,8 @@ int test() {
575575
test_checki(double2int_z(0.5), 0, "double2int_z2");
576576
test_checki(double2int_z(0.75), 0, "double2int_z2b");
577577
test_checki(double2int_z(1.0), 1, "double2int_z3");
578-
test_checki(double2int_z(-10.0), -10, "double2int_z3a");
579-
test_checki(double2int_z(-0.0), 0, "double2int_z3b");
578+
test_checki(double2int_z(-10.0), -10, "double2int_z3b");
579+
test_checki(double2int_z(-0.0), 0, "double2int_z3c");
580580
test_checki(double2int_z(-0.25), 0, "double2int_z4");
581581
test_checki(double2int_z(-0.5), 0, "double2int_z4b");
582582
test_checki(double2int_z(-0.75), 0, "double2int_z5");
@@ -626,8 +626,8 @@ int test() {
626626
test_checki64(double2int64_z(0.5), 0, "double2int64_z2");
627627
test_checki64(double2int64_z(0.75), 0, "double2int64_z2b");
628628
test_checki64(double2int64_z(1.0), 1, "double2int64_z3");
629-
test_checki64(double2int64_z(-10.0), -10, "double2int64_z3a");
630-
test_checki64(double2int64_z(-0.0), 0, "double2int64_z3b");
629+
test_checki64(double2int64_z(-10.0), -10, "double2int64_z3b");
630+
test_checki64(double2int64_z(-0.0), 0, "double2int64_z3c");
631631
test_checki64(double2int64_z(-0.25), 0, "double2int64_z4");
632632
test_checki64(double2int64_z(-0.5), 0, "double2int64_z4b");
633633
test_checki64(double2int64_z(-0.75), 0, "double2int64_z5");

test/pico_float_test/custom_float_funcs_test.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ int test() {
622622
test_checki(float2int(0.5f), 0, "float2int2");
623623
test_checki(float2int(0.75f), 0, "float2int2b");
624624
test_checki(float2int(1.0f), 1, "float2int3");
625-
test_checki(float2int(-10.0f), -10, "float2int3a");
626-
test_checki(float2int(-0.0f), 0, "float2int3b");
625+
test_checki(float2int(-10.0f), -10, "float2int3b");
626+
test_checki(float2int(-0.0f), 0, "float2int3c");
627627
test_checki(float2int(-0.25f), -1, "float2int4");
628628
test_checki(float2int(-0.5f), -1, "float2int4b");
629629
test_checki(float2int(-0.75f), -1, "float2int5");
@@ -662,8 +662,8 @@ int test() {
662662
test_checki64(float2int64(0.5f), 0, "float2int642");
663663
test_checki64(float2int64(0.75f), 0, "float2int642b");
664664
test_checki64(float2int64(1.0f), 1, "float2int643");
665-
test_checki64(float2int64(-10.0f), -10, "float2int643a");
666-
test_checki64(float2int64(-0.0f), 0, "float2int643b");
665+
test_checki64(float2int64(-10.0f), -10, "float2int643b");
666+
test_checki64(float2int64(-0.0f), 0, "float2int643c");
667667
test_checki64(float2int64(-0.25f), -1, "float2int644");
668668
test_checki64(float2int64(-0.5f), -1, "float2int644b");
669669
test_checki64(float2int64(-0.75f), -1, "float2int645");
@@ -702,8 +702,8 @@ int test() {
702702
test_checki(float2int_z(0.5f), 0, "float2int_z2");
703703
test_checki(float2int_z(0.75f), 0, "float2int_z2b");
704704
test_checki(float2int_z(1.0f), 1, "float2int_z3");
705-
test_checki(float2int_z(-10.0f), -10, "float2int_z3a");
706-
test_checki(float2int_z(-0.0f), 0, "float2int_z3b");
705+
test_checki(float2int_z(-10.0f), -10, "float2int_z3b");
706+
test_checki(float2int_z(-0.0f), 0, "float2int_z3c");
707707
test_checki(float2int_z(-0.25f), 0, "float2int_z4");
708708
test_checki(float2int_z(-0.5f), 0, "float2int_z4b");
709709
test_checki(float2int_z(-0.75f), 0, "float2int_z5");
@@ -729,8 +729,8 @@ int test() {
729729
test_checki(call_float2int_z(0.5f), 0, "call_float2int_z2");
730730
test_checki(call_float2int_z(0.75f), 0, "call_float2int_z2b");
731731
test_checki(call_float2int_z(1.0f), 1, "call_float2int_z3");
732-
test_checki(call_float2int_z(-10.0f), -10, "call_float2int_z3a");
733-
test_checki(call_float2int_z(-0.0f), 0, "call_float2int_z3b");
732+
test_checki(call_float2int_z(-10.0f), -10, "call_float2int_z3b");
733+
test_checki(call_float2int_z(-0.0f), 0, "call_float2int_z3c");
734734
test_checki(call_float2int_z(-0.25f), 0, "call_float2int_z4");
735735
test_checki(call_float2int_z(-0.5f), 0, "call_float2int_z4b");
736736
test_checki(call_float2int_z(-0.75f), 0, "call_float2int_z5");
@@ -790,8 +790,8 @@ int test() {
790790
test_checki64(float2int64_z(0.5f), 0, "float2int64_z2");
791791
test_checki64(float2int64_z(0.75f), 0, "float2int64_z2b");
792792
test_checki64(float2int64_z(1.0f), 1, "float2int64_z3");
793-
test_checki64(float2int64_z(-10.0f), -10, "float2int64_z3a");
794-
test_checki64(float2int64_z(-0.0f), 0, "float2int64_z3b");
793+
test_checki64(float2int64_z(-10.0f), -10, "float2int64_z3b");
794+
test_checki64(float2int64_z(-0.0f), 0, "float2int64_z3c");
795795
test_checki64(float2int64_z(-0.25f), 0, "float2int64_z4");
796796
test_checki64(float2int64_z(-0.5f), 0, "float2int64_z4b");
797797
test_checki64(float2int64_z(-0.75f), 0, "float2int64_z5");

tools/check_float_test_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections import namedtuple
77
from dataclasses import dataclass
88

9-
ENFORCE_SEQUENTIAL_SUFFIXES = False # if False, allow "double2ufix8" to be followed by "double2ufix12"
9+
ENFORCE_SEQUENTIAL_SUFFIXES = True # if False, allow "double2ufix8" to be followed by "double2ufix12"
1010
ENFORCE_UNDERSCORE_IN_SUFFIX_IF_FUNCTION_ENDS_WITH_NUMBER = False # if False, allow "float2fix641"
1111
ALLOW_TEST_SUFFIXES_TO_START_AT_ZERO = True # if False, don't allow "float2fix0"
1212
ALLOW_TEST_SUFFIXES_TO_SKIP_A = True # if False, don't allow "float2int1b" to follow "float2int1"

0 commit comments

Comments
 (0)