2023-11-30 17:36:48 +00:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* ex02.c :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2023/11/30 19:58:12 by achubuko #+# #+# */
|
2023-11-30 17:58:36 +00:00
|
|
|
/* Updated: 2023/11/30 21:51:37 by achubuko ### ########.fr */
|
2023-11-30 17:36:48 +00:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
#include <tests.h>
|
2023-11-30 17:58:36 +00:00
|
|
|
#define TEST_RETURN_PRINTF "%p"
|
2023-11-30 17:36:48 +00:00
|
|
|
|
|
|
|
char *ft_strncat(char *dest, char *src, unsigned int nb);
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2023-11-30 17:58:36 +00:00
|
|
|
TEST_SEED(char);
|
2023-11-30 17:36:48 +00:00
|
|
|
|
|
|
|
printf("initial strings:\n");
|
|
|
|
dump(s, TEST_SOURCE_LENGHT);
|
|
|
|
dump(d, TEST_DESTINATION_LENGHT);
|
|
|
|
|
|
|
|
r1 = strncat(d1, s1, 6);
|
|
|
|
r2 = ft_strncat(d2, s2, 6);
|
2023-11-30 17:58:36 +00:00
|
|
|
TEST_SYNOPSIS("strncat(d, s, 6)", s, d, s1, d1, s2, d2);
|
2023-11-30 17:36:48 +00:00
|
|
|
|
|
|
|
r1 = strncat(d1, s1, 20);
|
|
|
|
r2 = ft_strncat(d2, s2, 20);
|
2023-11-30 17:58:36 +00:00
|
|
|
TEST_SYNOPSIS("strncat(d, s, 20)", s, d, s1, d1, s2, d2);
|
2023-11-30 17:36:48 +00:00
|
|
|
|
|
|
|
r1 = strncat(s1, d1, 5);
|
|
|
|
r2 = ft_strncat(s2, d2, 5);
|
2023-11-30 17:58:36 +00:00
|
|
|
TEST_SYNOPSIS("strncat(s, d, 5)", s, d, s1, d1, s2, d2);
|
2023-11-30 17:36:48 +00:00
|
|
|
}
|