ADD: strncmp unit test
This commit is contained in:
@@ -6,7 +6,7 @@ int strncmp_launcher(void)
|
||||
size_t res;
|
||||
|
||||
testlist = NULL;
|
||||
load_test(&testlist, "OK test", &atoi_ok_test);
|
||||
load_test(&testlist, "OK test", &strncmp_ok_test);
|
||||
res = launch_tests(testlist, "ft_strncmp");
|
||||
clear_tests(&testlist);
|
||||
return (res);
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "../tests.h"
|
||||
|
||||
int strncmp_ok_test(void)
|
||||
{
|
||||
return (ft_strncmp("test", "test", 4));
|
||||
}
|
||||
|
||||
6
real_tests/ft_strncmp/02_ko_test.c
Normal file
6
real_tests/ft_strncmp/02_ko_test.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "../tests.h"
|
||||
|
||||
int strncmp_ko_test(void)
|
||||
{
|
||||
return (ft_strncmp("blabla", "test", 4));
|
||||
}
|
||||
@@ -25,5 +25,8 @@ int atoi_ko_test(void);
|
||||
int atoi_sigsegv_test(void);
|
||||
int atoi_sigbus_test(void);
|
||||
|
||||
//strncmp
|
||||
int strncmp_ok_test(void);
|
||||
|
||||
|
||||
#endif // !TESTS_H
|
||||
|
||||
Reference in New Issue
Block a user