]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a pair of errors in bug23512
authorNick Mathewson <nickm@torproject.org>
Thu, 20 Sep 2018 18:18:09 +0000 (14:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 20 Sep 2018 18:18:09 +0000 (14:18 -0400)
src/or/rephist.c
src/test/test_relay.c

index 211480284af47734b011d377a96a192b3956c46e..20f9148f03ce8b6ca4ad8cf555ef544bfd81834c 100644 (file)
@@ -1211,7 +1211,7 @@ rep_hist_load_mtbf_data(time_t now)
 /** Structure to track bandwidth use, and remember the maxima for a given
  * time period.
  */
-typedef struct bw_array_t {
+struct bw_array_t {
   /** Observation array: Total number of bytes transferred in each of the last
    * NUM_SECS_ROLLING_MEASURE seconds. This is used as a circular array. */
   uint64_t obs[NUM_SECS_ROLLING_MEASURE];
@@ -1238,7 +1238,7 @@ typedef struct bw_array_t {
   /** Circular array of the total bandwidth usage for the last NUM_TOTALS
    * periods */
   uint64_t totals[NUM_TOTALS];
-} bw_array_t;
+};
 
 /** Shift the current period of b forward by one. */
 STATIC void
@@ -3297,4 +3297,3 @@ rep_hist_free_all(void)
   tor_assert_nonfatal(rephist_total_alloc == 0);
   tor_assert_nonfatal_once(rephist_total_num == 0);
 }
-
index 1ec538395bf4b0b3d3cc66642c6d96d76c4157b1..57dcb2406a182a172b969d5af6039d900e8c9e02 100644 (file)
@@ -111,7 +111,7 @@ test_relay_close_circuit(void *arg)
   tt_int_op(new_count, OP_EQ, old_count + 1);
 
   /* Ensure our write totals are 0 */
-  tt_int_op(find_largest_max(write_array), OP_EQ, 0);
+  tt_u64_op(find_largest_max(write_array), OP_EQ, 0);
 
   /* Mark the circuit for close */
   circuit_mark_for_close(TO_CIRCUIT(orcirc), 0);
@@ -120,7 +120,7 @@ test_relay_close_circuit(void *arg)
   advance_obs(write_array);
   commit_max(write_array);
   /* Check for two cells plus overhead */
-  tt_int_op(find_largest_max(write_array), OP_EQ,
+  tt_u64_op(find_largest_max(write_array), OP_EQ,
                              2*(get_cell_network_size(nchan->wide_circ_ids)
                                 +TLS_PER_CELL_OVERHEAD));
 
@@ -233,4 +233,3 @@ struct testcase_t relay_tests[] = {
     TT_FORK, NULL, NULL },
   END_OF_TESTCASES
 };
-