diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-20 15:31:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-20 15:31:25 -0400 |
commit | a5fe84b5a6a2adb78ea917ad46a77b1793518cc1 (patch) | |
tree | fb702c84ae2b6513015047abd0c4ff3bd6d22fb5 /src | |
parent | 8b539cc27684534a6a71cef92f9a6782040f6ca9 (diff) | |
download | tor-a5fe84b5a6a2adb78ea917ad46a77b1793518cc1.tar.gz tor-a5fe84b5a6a2adb78ea917ad46a77b1793518cc1.zip |
Small cleanups to test_entry_is_time_to_retry
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test_entrynodes.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index 5fee0336da..bf014f1a9d 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -541,16 +541,14 @@ test_entry_guards_set_from_config(void *arg) static void test_entry_is_time_to_retry(void *arg) { - (void)arg; - entry_guard_t *test_guard; time_t now; int retval; + (void)arg; now = time(NULL); - test_guard = tor_malloc(sizeof(entry_guard_t)); - memset(test_guard,0,sizeof(entry_guard_t)); + test_guard = tor_malloc_zero(sizeof(entry_guard_t)); test_guard->last_attempted = now - 10; test_guard->unreachable_since = now - 1; @@ -610,9 +608,8 @@ test_entry_is_time_to_retry(void *arg) retval = entry_is_time_to_retry(test_guard,now); tt_int_op(retval,==,1); - done: + done: tor_free(test_guard); - return; } /** XXX Do some tests that entry_is_live() */ |