aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2013-10-28 10:48:18 +0100
committerKarsten Loesing <karsten.loesing@gmx.net>2013-10-28 10:48:18 +0100
commite46de82c97e694d3bfa399af48b9de9365e264bd (patch)
tree5c2b79c90ac119f7e09fe5edd6a34ce8bac41971 /src/test
parentb43a37bc5b6813224b9ac727e98a96d6ce2c5f2b (diff)
downloadtor-e46de82c97e694d3bfa399af48b9de9365e264bd.tar
tor-e46de82c97e694d3bfa399af48b9de9365e264bd.tar.gz
squash! Pass const uint64_t pointers, document array length.
Don't cast uint64_t * to const uint64_t * explicitly. The cast is always safe, so C does it for us. Doing the cast explitictly can hide bugs if the input is secretly the wrong type. Suggested by Nick.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_controller_events.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/test_controller_events.c b/src/test/test_controller_events.c
index 0b5434cd3..04a04de5b 100644
--- a/src/test/test_controller_events.c
+++ b/src/test/test_controller_events.c
@@ -159,31 +159,31 @@ test_cntev_append_cell_stats(void *arg)
/* All array entries empty. */
append_cell_stats_by_command(event_parts, key,
- (const uint64_t *) include_if_non_zero,
- (const uint64_t *) number_to_include);
+ include_if_non_zero,
+ number_to_include);
tt_int_op(0, ==, smartlist_len(event_parts));
/* There's a RELAY cell to include, but the corresponding field in
* include_if_non_zero is still zero. */
number_to_include[CELL_RELAY] = 1;
append_cell_stats_by_command(event_parts, key,
- (const uint64_t *) include_if_non_zero,
- (const uint64_t *) number_to_include);
+ include_if_non_zero,
+ number_to_include);
tt_int_op(0, ==, smartlist_len(event_parts));
/* Now include single RELAY cell. */
include_if_non_zero[CELL_RELAY] = 2;
append_cell_stats_by_command(event_parts, key,
- (const uint64_t *) include_if_non_zero,
- (const uint64_t *) number_to_include);
+ include_if_non_zero,
+ number_to_include);
tt_str_op("Z=relay:1", ==, smartlist_pop_last(event_parts));
/* Add four CREATE cells. */
include_if_non_zero[CELL_CREATE] = 3;
number_to_include[CELL_CREATE] = 4;
append_cell_stats_by_command(event_parts, key,
- (const uint64_t *) include_if_non_zero,
- (const uint64_t *) number_to_include);
+ include_if_non_zero,
+ number_to_include);
tt_str_op("Z=create:4,relay:1", ==, smartlist_pop_last(event_parts));
done: