Make tor_gettimeofday() mockable
This commit is contained in:
parent
e72742d693
commit
ce84de39ef
|
@ -71,8 +71,8 @@ tor_sleep_msec(int msec)
|
|||
/** Set *timeval to the current time of day. On error, log and terminate.
|
||||
* (Same as gettimeofday(timeval,NULL), but never returns -1.)
|
||||
*/
|
||||
void
|
||||
tor_gettimeofday(struct timeval *timeval)
|
||||
MOCK_IMPL(void,
|
||||
tor_gettimeofday, (struct timeval *timeval))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
/* Epoch bias copied from perl: number of units between windows epoch and
|
||||
|
|
|
@ -173,7 +173,7 @@ void monotime_coarse_add_msec(monotime_coarse_t *out,
|
|||
#define monotime_coarse_add_msec monotime_add_msec
|
||||
#endif /* defined(MONOTIME_COARSE_TYPE_IS_DIFFERENT) */
|
||||
|
||||
void tor_gettimeofday(struct timeval *timeval);
|
||||
MOCK_DECL(void, tor_gettimeofday, (struct timeval *timeval));
|
||||
|
||||
#ifdef TOR_UNIT_TESTS
|
||||
void tor_sleep_msec(int msec);
|
||||
|
|
Loading…
Reference in New Issue