added bgoulard lib + made lib sources in their own directory in build/ for readability
This commit is contained in:
parent
83cc8419a0
commit
0a390934d6
457 changed files with 21807 additions and 61 deletions
35
libft_personal/tests/ft_string/ft_mem/tests_memcmp.c
Normal file
35
libft_personal/tests/ft_string/ft_mem/tests_memcmp.c
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* tests_memcmp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/25 12:22:12 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/06/02 00:46:20 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
|
||||
int test_memcmp(void)
|
||||
{
|
||||
const char str[] = "1234567\0009";
|
||||
const char str2[] = "1234567\0009";
|
||||
const char str3[] = "1234567\000a";
|
||||
const char str4[] = "1234567\0009";
|
||||
|
||||
if (ft_memcmp(str, str2, 10) != 0)
|
||||
return (1);
|
||||
if (ft_memcmp(str, str3, 10) >= 0)
|
||||
return (2);
|
||||
if (ft_memcmp(str3, str, 10) <= 0)
|
||||
return (3);
|
||||
if (ft_memcmp(str, str2, 0) != 0)
|
||||
return (4);
|
||||
if (ft_memcmp(str, str4, 10) != 0)
|
||||
return (5);
|
||||
if (ft_memcmp(str, str, 999) != 0)
|
||||
return (6);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue