test: adding the strcpy tests

This commit is contained in:
Raphael 2025-12-13 13:35:18 +01:00
parent b4196550be
commit 091dd32dc0
No known key found for this signature in database

View file

@ -65,6 +65,7 @@ static void _test_strlen()
printf("%s✔%s", CLR_GREEN, RESET);
else
dprintf(2, "\t%s✘%s", CLR_RED, RESET);
putchar(' ');
}
putchar('\n');
}
@ -88,6 +89,7 @@ static void _test_strcmp()
printf("%s✔%s", CLR_GREEN, RESET);
else
dprintf(2, "\t%s✘%s", CLR_RED, RESET);
putchar(' ');
}
}
putchar('\n');
@ -124,8 +126,7 @@ static void _test_write(void)
int original, homemade;
int err_original, err_homemade, test_file;
printf("\n%sTesting '%sft_write%s'%s\n",
CLR_YELLOW, CLR_BLUE, CLR_YELLOW, RESET);
printf("\n%sTesting '%sft_write%s'%s\n", CLR_YELLOW, CLR_BLUE, CLR_YELLOW, RESET);
errno = 0;
original = write(1, NULL, 5);
err_original = errno;
@ -136,7 +137,6 @@ static void _test_write(void)
printf("%s✔%s ", CLR_GREEN, RESET);
else
printf("%s✘%s ", CLR_RED, RESET);
for (int i = 0; strs[i]; i++)
{
errno = 0;
@ -151,6 +151,7 @@ static void _test_write(void)
else
dprintf(2, "\t%s✘%s", CLR_RED, RESET);
close(test_file);
putchar(' ');
}
errno = 0;
original = write(-1, "A", 1);
@ -198,6 +199,7 @@ static void _test_read(void)
else
dprintf(2, "\t%s✘%s", CLR_RED, RESET);
close(test_file);
putchar(' ');
}
errno = 0;
original = read(-1, buf_orig, 10);