diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-04-14 19:23:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-04-24 10:59:25 -0400 |
commit | fe584f40127c5a8fc5b6f03b0d7901c5d443824a (patch) | |
tree | 71e8a293ac57336b53ee4e8a32df6f65b745df9e /src | |
parent | bc91808c477ac05dc634ab10811b354b22da1ef5 (diff) | |
download | tor-fe584f40127c5a8fc5b6f03b0d7901c5d443824a.tar.gz tor-fe584f40127c5a8fc5b6f03b0d7901c5d443824a.zip |
Make cpuworker_queue_work function mockable.
I'll be using this in the unit tests for consdiffmgr.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/cpuworker.c | 8 | ||||
-rw-r--r-- | src/or/cpuworker.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index f79cd067cb..af79fafaa6 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -480,10 +480,10 @@ queue_pending_tasks(void) } /** DOCDOC */ -workqueue_entry_t * -cpuworker_queue_work(workqueue_reply_t (*fn)(void *, void *), - void (*reply_fn)(void *), - void *arg) +MOCK_IMPL(workqueue_entry_t *, +cpuworker_queue_work,(workqueue_reply_t (*fn)(void *, void *), + void (*reply_fn)(void *), + void *arg)) { tor_assert(threadpool); diff --git a/src/or/cpuworker.h b/src/or/cpuworker.h index 9bc5d962dd..aedf2fae32 100644 --- a/src/or/cpuworker.h +++ b/src/or/cpuworker.h @@ -16,10 +16,10 @@ void cpu_init(void); void cpuworkers_rotate_keyinfo(void); struct workqueue_entry_s; enum workqueue_reply_t; -struct workqueue_entry_s *cpuworker_queue_work( +MOCK_DECL(struct workqueue_entry_s *, cpuworker_queue_work, ( enum workqueue_reply_t (*fn)(void *, void *), void (*reply_fn)(void *), - void *arg); + void *arg)); struct create_cell_t; int assign_onionskin_to_cpuworker(or_circuit_t *circ, |