feat(test/strlen): adding strlen tests
This commit is contained in:
parent
e5e343ff58
commit
6ed34984e0
1 changed files with 29 additions and 0 deletions
29
test/main.c
Normal file
29
test/main.c
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
#include "libasm.h"
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
printf("\n\n\n%sTesting '%sstrlen%s'%s\n", CLR_YELLOW, CLR_BLUE, CLR_YELLOW, RESET);
|
||||||
|
printf("%sTesting on: '%sNULL%s'%s\n", CLR_YELLOW, CLR_BLUE, CLR_YELLOW, RESET);
|
||||||
|
printf("%sHomeMade: %s%zu%s\n\n\n", CLR_YELLOW, CLR_BLUE, ft_strlen(NULL), RESET);
|
||||||
|
char *strs[] = {
|
||||||
|
"",
|
||||||
|
"a",
|
||||||
|
"aa",
|
||||||
|
"aaa",
|
||||||
|
"Hello\0 World!",
|
||||||
|
"Hello World!",
|
||||||
|
"Assembly is fun!",
|
||||||
|
LOREM,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
for (int i = 0; strs[i]; i++)
|
||||||
|
{
|
||||||
|
printf("%sTesting on: '%s%s%s'%s\n", CLR_YELLOW, CLR_BLUE, strs[i], CLR_YELLOW, RESET);
|
||||||
|
printf("\n%sOriginal: %s%zu%s\n", CLR_YELLOW, CLR_BLUE, strlen(strs[i]), RESET);
|
||||||
|
printf("%sHomeMade: %s%zu%s\n\n\n", CLR_YELLOW, CLR_BLUE, ft_strlen(strs[i]), RESET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue