From 7d626e7e9638d7e85c3dacce8a4aee009850a1a2 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 13 Feb 2020 21:05:15 +0100 Subject: Filled mem* tests --- test/src/mem/test_ft_memset_pattern4.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'test/src/mem/test_ft_memset_pattern4.c') diff --git a/test/src/mem/test_ft_memset_pattern4.c b/test/src/mem/test_ft_memset_pattern4.c index 9a0f109..0e2806a 100644 --- a/test/src/mem/test_ft_memset_pattern4.c +++ b/test/src/mem/test_ft_memset_pattern4.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/13 03:32:43 by cacharle #+# #+# */ -/* Updated: 2020/02/13 03:41:36 by cacharle ### ########.fr */ +/* Updated: 2020/02/13 19:57:48 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,5 +22,21 @@ TEST_TEAR_DOWN(ft_memset_pattern4) TEST(ft_memset_pattern4, basic) { + char buf[17] = {0}; + char *pattern4 = "1234"; + ft_memset_pattern4(buf, pattern4, 16); + TEST_ASSERT_EQUAL_STRING("1234123412341234", buf); + + char buf1[10] = {0}; + ft_memset_pattern4(buf1, "1234", 9); + TEST_ASSERT_EQUAL_STRING("123412341", buf1); + + char buf2[11] = {0}; + ft_memset_pattern4(buf2, "1234", 10); + TEST_ASSERT_EQUAL_STRING("1234123412", buf2); + + char buf3[12] = {0}; + ft_memset_pattern4(buf3, "1234", 11); + TEST_ASSERT_EQUAL_STRING("12341234123", buf3); } -- cgit