Skip to content

Commit

Permalink
Merge pull request #11 from tdameros/7-use-streq-instead-eq-in-tests
Browse files Browse the repository at this point in the history
fix: use streq instead eq in tests
  • Loading branch information
tdameros authored Aug 3, 2024
2 parents 52f035c + f1668b9 commit 628a842
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions test/ft_create_elem.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ UTEST(ft_create_elem, null_data) {
UTEST(ft_create_elem, non_null_data) {
char *data = strdup("Hello, World!");
t_list *elem = ft_create_elem(data);
ASSERT_EQ(elem->data, data);
ASSERT_STREQ(elem->data, data);
ASSERT_EQ(elem->next, NULL);
free(data);
free(elem);
Expand All @@ -37,9 +37,9 @@ UTEST(ft_create_elem, multiple_elems) {
t_list *elem1 = ft_create_elem(data1);
t_list *elem2 = ft_create_elem(data2);
elem1->next = elem2;
ASSERT_EQ(elem1->data, data1);
ASSERT_STREQ(elem1->data, data1);
ASSERT_EQ(elem1->next, elem2);
ASSERT_EQ(elem2->data, data2);
ASSERT_STREQ(elem2->data, data2);
ASSERT_EQ(elem2->next, NULL);
free(data1);
free(data2);
Expand Down
12 changes: 6 additions & 6 deletions test/ft_list_push_front.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UTEST(ft_list_push_front, null_list) {
t_list *list = NULL;
char *data = strdup("Hello, World!");
ft_list_push_front(&list, data);
ASSERT_EQ(list->data, data);
ASSERT_STREQ(list->data, data);
ASSERT_EQ(list->next, NULL);
free(data);
free(list);
Expand All @@ -31,8 +31,8 @@ UTEST(ft_list_push_front, non_null_list) {
char *data2 = strdup("Hello, 42!");
t_list *list = ft_create_elem(data1);
ft_list_push_front(&list, data2);
ASSERT_EQ(list->data, data2);
ASSERT_EQ(list->next->data, data1);
ASSERT_STREQ(list->data, data2);
ASSERT_STREQ(list->next->data, data1);
ASSERT_EQ(list->next->next, NULL);
free(data1);
free(data2);
Expand All @@ -47,9 +47,9 @@ UTEST(ft_list_push_front, multiple_elems) {
t_list *list = ft_create_elem(data1);
ft_list_push_front(&list, data2);
ft_list_push_front(&list, data3);
ASSERT_EQ(list->data, data3);
ASSERT_EQ(list->next->data, data2);
ASSERT_EQ(list->next->next->data, data1);
ASSERT_STREQ(list->data, data3);
ASSERT_STREQ(list->next->data, data2);
ASSERT_STREQ(list->next->next->data, data1);
ASSERT_EQ(list->next->next->next, NULL);
free(data1);
free(data2);
Expand Down
2 changes: 1 addition & 1 deletion test/ft_list_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ UTEST(ft_list_sort, empty_list) {
UTEST(ft_list_sort, null_cmp) {
t_list *list = ft_create_elem("Hello, World!");
ft_list_sort(&list, NULL);
ASSERT_EQ(list->data, "Hello, World!");
ASSERT_STREQ(list->data, "Hello, World!");
ASSERT_EQ(list->next, NULL);
free_list(list);
}
Expand Down

0 comments on commit 628a842

Please sign in to comment.