tests/test_string.c

changeset 1410
be4071f5e9aa
parent 1304
57e062a4bb05
equal deleted inserted replaced
1409:6856869e29f1 1410:be4071f5e9aa
1063 test_strtoint_rollout_signed(0xABC5, 16); 1063 test_strtoint_rollout_signed(0xABC5, 16);
1064 test_strtoint_rollout_signed(0xFBC5, 16); 1064 test_strtoint_rollout_signed(0xFBC5, 16);
1065 test_strtoint_rollout_signed(0x6df9CE03, 16); 1065 test_strtoint_rollout_signed(0x6df9CE03, 16);
1066 test_strtoint_rollout_signed(0xFdf9CE03, 16); 1066 test_strtoint_rollout_signed(0xFdf9CE03, 16);
1067 test_strtoint_rollout_signed(0x6df9CE03AbC90815, 16); 1067 test_strtoint_rollout_signed(0x6df9CE03AbC90815, 16);
1068 // TODO: roll out base 2 tests, but that needs C23 1068 #if __STDC_VERSION__ >= 202300L
1069 test_strtoint_rollout_signed(0b01000010100100101110101001110101, 2);
1070 test_strtoint_rollout_signed(0b00011010101100001111111001010100, 2);
1071 test_strtoint_rollout_signed(0b10110001001001010001010111010011, 2);
1072 #endif
1069 1073
1070 // do some special case tests 1074 // do some special case tests
1071 // -------------------------- 1075 // --------------------------
1072 1076
1073 // can fit only in unsigned long long 1077 // can fit only in unsigned long long
1152 test_strtoint_rollout(0xFBC5, 16); 1156 test_strtoint_rollout(0xFBC5, 16);
1153 test_strtoint_rollout(0x6df9CE03, 16); 1157 test_strtoint_rollout(0x6df9CE03, 16);
1154 test_strtoint_rollout(0xFdf9CE03, 16); 1158 test_strtoint_rollout(0xFdf9CE03, 16);
1155 test_strtoint_rollout(0x6df9CE03AbC90815, 16); 1159 test_strtoint_rollout(0x6df9CE03AbC90815, 16);
1156 test_strtoint_rollout(0xfdf9CE03AbC90815, 16); 1160 test_strtoint_rollout(0xfdf9CE03AbC90815, 16);
1157 // TODO: roll out base 2 tests, but that needs C23 1161 #if __STDC_VERSION__ >= 202300L
1162 test_strtoint_rollout(0b01000010100100101110101001110101, 2);
1163 test_strtoint_rollout(0b00011010101100001111111001010100, 2);
1164 test_strtoint_rollout(0b10110001001001010001010111010011, 2);
1165 #endif
1158 1166
1159 // do some special case tests 1167 // do some special case tests
1160 // -------------------------- 1168 // --------------------------
1161 1169
1162 // leading plus 1170 // leading plus

mercurial