diff options
author | juga0 <juga@riseup.net> | 2018-06-09 12:54:08 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-01 18:47:20 -0400 |
commit | e13ddee1665bc83442be04820b51b425fa98e848 (patch) | |
tree | 008727c33df5c06df34d6d77f67bef411f43be5b /src/or | |
parent | 842b18ab26ac12da7e63c38413d193905b8fbed5 (diff) | |
download | tor-e13ddee1665bc83442be04820b51b425fa98e848.tar.gz tor-e13ddee1665bc83442be04820b51b425fa98e848.zip |
Allow mocking rep_hist_bandwidth_assess
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/rephist.c | 6 | ||||
-rw-r--r-- | src/or/rephist.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index f0bac57898..2844c4d74e 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -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); diff --git a/src/or/rephist.h b/src/or/rephist.h index ff4810a56d..6d35ac67f6 100644 --- a/src/or/rephist.h +++ b/src/or/rephist.h @@ -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); |