test/test_list.c

changeset 453
bb144d08cd44
parent 449
68ad5750ba6b
child 455
8168e16cd1e9
--- a/test/test_list.c	Sun Oct 03 13:07:48 2021 +0200
+++ b/test/test_list.c	Sun Oct 03 14:06:57 2021 +0200
@@ -112,16 +112,13 @@
     ptrdiff_t loc_prev = offsetof(struct node, prev);
     ptrdiff_t loc_next = offsetof(struct node, next);
 
-    int ret;
-    ret = cx_linked_list_add(&begin, &end, loc_prev, loc_next, &nodes[0]);
-    CU_ASSERT_EQUAL(ret, 0)
+    cx_linked_list_add(&begin, &end, loc_prev, loc_next, &nodes[0]);
     CU_ASSERT_PTR_EQUAL(begin, &nodes[0])
     CU_ASSERT_PTR_EQUAL(end, &nodes[0])
     CU_ASSERT_PTR_EQUAL(nodes[0].prev, NULL)
     CU_ASSERT_PTR_EQUAL(nodes[0].next, NULL)
 
-    ret = cx_linked_list_add(&begin, &end, loc_prev, loc_next, &nodes[1]);
-    CU_ASSERT_EQUAL(ret, 0)
+    cx_linked_list_add(&begin, &end, loc_prev, loc_next, &nodes[1]);
     CU_ASSERT_PTR_EQUAL(begin, &nodes[0])
     CU_ASSERT_PTR_EQUAL(end, &nodes[1])
     CU_ASSERT_PTR_EQUAL(nodes[0].next, &nodes[1])
@@ -132,16 +129,14 @@
     begin = NULL;
     end = NULL;
 
-    ret = cx_linked_list_add(&begin, NULL, loc_prev, loc_next, &nodes[0]);
-    CU_ASSERT_EQUAL(ret, 0)
+    cx_linked_list_add(&begin, NULL, loc_prev, loc_next, &nodes[0]);
     CU_ASSERT_PTR_EQUAL(begin, &nodes[0])
-    ret = cx_linked_list_add(&begin, NULL, loc_prev, loc_next, &nodes[1]);
-    CU_ASSERT_EQUAL(ret, 0)
+    cx_linked_list_add(&begin, NULL, loc_prev, loc_next, &nodes[1]);
     CU_ASSERT_PTR_EQUAL(begin, &nodes[0])
     CU_ASSERT_PTR_EQUAL(nodes[0].next, &nodes[1])
     CU_ASSERT_PTR_EQUAL(nodes[1].prev, &nodes[0])
 
-    ret = cx_linked_list_add(&begin, NULL, loc_prev, loc_next, &nodes[2]);
+    cx_linked_list_add(&begin, NULL, loc_prev, loc_next, &nodes[2]);
     CU_ASSERT_PTR_EQUAL(nodes[1].next, &nodes[2])
     CU_ASSERT_PTR_EQUAL(nodes[2].prev, &nodes[1])
 
@@ -150,12 +145,10 @@
     begin = NULL;
     end = NULL;
 
-    ret = cx_linked_list_add(&begin, &end, -1, loc_next, &nodes[0]);
-    CU_ASSERT_EQUAL(ret, 0)
+    cx_linked_list_add(&begin, &end, -1, loc_next, &nodes[0]);
     CU_ASSERT_PTR_EQUAL(begin, &nodes[0])
     CU_ASSERT_PTR_EQUAL(end, &nodes[0])
-    ret = cx_linked_list_add(&begin, &end, -1, loc_next, &nodes[1]);
-    CU_ASSERT_EQUAL(ret, 0)
+    cx_linked_list_add(&begin, &end, -1, loc_next, &nodes[1]);
     CU_ASSERT_PTR_EQUAL(end, &nodes[1])
     CU_ASSERT_PTR_EQUAL(nodes[0].next, &nodes[1])
     CU_ASSERT_PTR_NULL(nodes[1].prev)

mercurial