tests: add test_ft_strlen

This commit is contained in:
Aleksei Chubukov 2023-12-02 23:51:56 +04:00
parent bdf52892a0
commit 688ae7cb29

View File

@ -6,11 +6,12 @@
/* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */ /* By: achubuko <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/02 22:12:42 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 "unity.h"
#include "ft_utils.h" #include "ft_utils.h"
#include "string.h"
void setUp(void) 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) void test_ft_atoui32_42(void)
{ {
TEST_ASSERT_EQUAL_UINT32(42, ft_atoui32("42")); TEST_ASSERT_EQUAL_UINT32(42, ft_atoui32("42"));
@ -28,6 +37,7 @@ void test_ft_atoui32_42(void)
int main(void) int main(void)
{ {
UNITY_BEGIN(); UNITY_BEGIN();
RUN_TEST(test_ft_strlen);
RUN_TEST(test_ft_atoui32_42); RUN_TEST(test_ft_atoui32_42);
return (UNITY_END()); return (UNITY_END());
} }