mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Make scheduler_compare_channels() mockable
This commit is contained in:
parent
f8ceb0f028
commit
dc3af04ba8
2 changed files with 4 additions and 3 deletions
|
@ -167,8 +167,8 @@ scheduler_free_all(void)
|
||||||
* Comparison function to use when sorting pending channels
|
* Comparison function to use when sorting pending channels
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC int
|
MOCK_IMPL(STATIC int,
|
||||||
scheduler_compare_channels(const void *c1_v, const void *c2_v)
|
scheduler_compare_channels, (const void *c1_v, const void *c2_v))
|
||||||
{
|
{
|
||||||
channel_t *c1 = NULL, *c2 = NULL;
|
channel_t *c1 = NULL, *c2 = NULL;
|
||||||
/* These are a workaround for -Wbad-function-cast throwing a fit */
|
/* These are a workaround for -Wbad-function-cast throwing a fit */
|
||||||
|
|
|
@ -37,7 +37,8 @@ void scheduler_touch_channel(channel_t *chan);
|
||||||
/* Things only scheduler.c and its test suite should see */
|
/* Things only scheduler.c and its test suite should see */
|
||||||
|
|
||||||
#ifdef SCHEDULER_PRIVATE_
|
#ifdef SCHEDULER_PRIVATE_
|
||||||
STATIC int scheduler_compare_channels(const void *c1_v, const void *c2_v);
|
MOCK_DECL(STATIC int, scheduler_compare_channels,
|
||||||
|
(const void *c1_v, const void *c2_v));
|
||||||
STATIC uint64_t scheduler_get_queue_heuristic(void);
|
STATIC uint64_t scheduler_get_queue_heuristic(void);
|
||||||
STATIC void scheduler_update_queue_heuristic(time_t now);
|
STATIC void scheduler_update_queue_heuristic(time_t now);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue