Make cpuworker_queue_work function mockable.

I'll be using this in the unit tests for consdiffmgr.
This commit is contained in:
Nick Mathewson 2017-04-14 19:23:21 -04:00
parent bc91808c47
commit fe584f4012
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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,