From 688ae7cb29373548406a0b8f30d669adae6c23b8 Mon Sep 17 00:00:00 2001 From: Aleksei Chubukov Date: Sat, 2 Dec 2023 23:51:56 +0400 Subject: [PATCH] tests: add test_ft_strlen --- tests/test_ft_utils.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_ft_utils.c b/tests/test_ft_utils.c index 445b460..8ceb9a7 100644 --- a/tests/test_ft_utils.c +++ b/tests/test_ft_utils.c @@ -6,11 +6,12 @@ /* By: achubuko +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/02 22:12:42 by achubuko #+# #+# */ -/* Updated: 2023/12/02 23:09:10 by achubuko ### ########.fr */ +/* Updated: 2023/12/02 23:51:18 by achubuko ### ########.fr */ /* */ /* ************************************************************************** */ #include "unity.h" #include "ft_utils.h" +#include "string.h" void setUp(void) { @@ -20,6 +21,14 @@ void tearDown(void) { } +void test_ft_strlen(void) +{ + char *f; + + f = "foobar baz\0test"; + TEST_ASSERT_EQUAL_INT(strlen(f), ft_strlen(f)); +} + void test_ft_atoui32_42(void) { TEST_ASSERT_EQUAL_UINT32(42, ft_atoui32("42")); @@ -28,6 +37,7 @@ void test_ft_atoui32_42(void) int main(void) { UNITY_BEGIN(); + RUN_TEST(test_ft_strlen); RUN_TEST(test_ft_atoui32_42); return (UNITY_END()); }