forked from Lephenixnoir/FxLibcTest
inttypes: add brief tests for strtoimax and strtoumax
All the tests are done in strtol/strtoll and strtoul/strtoull, the only important thing is to check that the correct size type is used.
This commit is contained in:
parent
e8c2e8dae6
commit
b8c83ce9b4
|
@ -33,6 +33,12 @@ static void _ft_inttypes_functions(ft_test *t)
|
|||
ft_assert(t, imd.quot == -9ll && imd.rem == 1ll);
|
||||
imd = imaxdiv(-73ll, -8ll);
|
||||
ft_assert(t, imd.quot == 9ll && imd.rem == -1ll);
|
||||
|
||||
ft_log(t, "\nstrtoimax and strtoumax:\n");
|
||||
ft_assert_eval(t, strtoimax("-281474976710656", NULL, 0),
|
||||
-281474976710656ll, "%" PRIdMAX);
|
||||
ft_assert_eval(t, strtoumax("281474976710656", NULL, 0),
|
||||
281474976710656ll, "%" PRIuMAX);
|
||||
}
|
||||
|
||||
ft_test ft_inttypes_functions = {
|
||||
|
|
Loading…
Reference in New Issue