Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Enhanced atoi tester with extended range checks #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/libft/fsoares/test_atoi.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ int test_atoi(void)
res = single_test_atoi(13, "1209") && res;
res = single_test_atoi(14, "12/3") && res;
res = single_test_atoi(15, "12;3") && res;
res = single_test_atoi(16, "92233720368547758070") && res;
res = single_test_atoi(17, "-92233720368547758080") && res;
res = single_test_atoi(18, "9223372036854775806") && res;
res = single_test_atoi(19, "-9223372036854775806") && res;
sprintf(buffer, "%i", INT_MAX);
res = single_test_atoi(16, buffer) && res;
res = single_test_atoi(20, buffer) && res;
sprintf(buffer, "%i", INT_MIN);
res = single_test_atoi(17, buffer) && res;
res = single_test_atoi(21, buffer) && res;

for (int i = 0; i <= 0xFF; i++) {
sprintf(buffer, "%c %i", i, i + 1);
Expand Down