summaryrefslogtreecommitdiff
path: root/src/test/test_consdiff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_consdiff.c')
-rw-r--r--src/test/test_consdiff.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/test/test_consdiff.c b/src/test/test_consdiff.c
index 7cf8d6ba2b..fda3a7f186 100644
--- a/src/test/test_consdiff.c
+++ b/src/test/test_consdiff.c
@@ -19,28 +19,29 @@ test_consdiff_smartlist_slice(void *arg)
{
smartlist_t *sl = smartlist_new();
smartlist_slice_t *sls;
+ int items[6] = {0,0,0,0,0,0};
/* Create a regular smartlist. */
(void)arg;
- smartlist_add(sl, (void*)1);
- smartlist_add(sl, (void*)2);
- smartlist_add(sl, (void*)3);
- smartlist_add(sl, (void*)4);
- smartlist_add(sl, (void*)5);
+ smartlist_add(sl, &items[1]);
+ smartlist_add(sl, &items[2]);
+ smartlist_add(sl, &items[3]);
+ smartlist_add(sl, &items[4]);
+ smartlist_add(sl, &items[5]);
/* See if the slice was done correctly. */
sls = smartlist_slice(sl, 2, 5);
tt_ptr_op(sl, OP_EQ, sls->list);
- tt_ptr_op((void*)3, OP_EQ, smartlist_get(sls->list, sls->offset));
- tt_ptr_op((void*)5, OP_EQ,
+ tt_ptr_op(&items[3], OP_EQ, smartlist_get(sls->list, sls->offset));
+ tt_ptr_op(&items[5], OP_EQ,
smartlist_get(sls->list, sls->offset + (sls->len-1)));
tor_free(sls);
/* See that using -1 as the end does get to the last element. */
sls = smartlist_slice(sl, 2, -1);
tt_ptr_op(sl, OP_EQ, sls->list);
- tt_ptr_op((void*)3, OP_EQ, smartlist_get(sls->list, sls->offset));
- tt_ptr_op((void*)5, OP_EQ,
+ tt_ptr_op(&items[3], OP_EQ, smartlist_get(sls->list, sls->offset));
+ tt_ptr_op(&items[5], OP_EQ,
smartlist_get(sls->list, sls->offset + (sls->len-1)));
done:
@@ -1107,7 +1108,7 @@ test_consdiff_apply_diff(void *arg)
tt_ptr_op(NULL, OP_EQ, cons2);
expect_log_msg_containing("Could not compute digests of the consensus "
"resulting from applying a consensus diff.");
-#endif
+#endif /* 0 */
/* Very simple test, only to see that nothing errors. */
smartlist_clear(diff);