]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Allow mocking rep_hist_bandwidth_assess
authorjuga0 <juga@riseup.net>
Sat, 9 Jun 2018 12:54:08 +0000 (12:54 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 1 Sep 2018 22:47:20 +0000 (18:47 -0400)
src/or/rephist.c
src/or/rephist.h

index f0bac578980693fb3326610b7d0dc2bf5d60e34c..2844c4d74ea9810393542b5d26e0781e718f139d 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2016, The Tor Project, Inc. */
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 /**
@@ -1427,8 +1427,8 @@ find_largest_max(bw_array_t *b)
  *
  * Return the smaller of these sums, divided by NUM_SECS_ROLLING_MEASURE.
  */
-int
-rep_hist_bandwidth_assess(void)
+MOCK_IMPL(int,
+rep_hist_bandwidth_assess,(void))
 {
   uint64_t w,r;
   r = find_largest_max(read_array);
index ff4810a56d85499deb581b0c5b9d1cfeaafafcb1..6d35ac67f6d244c3bcf7572f708c17ed1ea70b95 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (c) 2001 Matej Pfajfar.
  * Copyright (c) 2001-2004, Roger Dingledine.
  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2016, The Tor Project, Inc. */
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
 /**
@@ -29,7 +29,7 @@ void rep_hist_make_router_pessimal(const char *id, time_t when);
 void rep_hist_note_dir_bytes_read(size_t num_bytes, time_t when);
 void rep_hist_note_dir_bytes_written(size_t num_bytes, time_t when);
 
-int rep_hist_bandwidth_assess(void);
+MOCK_DECL(int, rep_hist_bandwidth_assess, (void));
 char *rep_hist_get_bandwidth_lines(void);
 void rep_hist_update_state(or_state_t *state);
 int rep_hist_load_state(or_state_t *state, char **err);