diff options
author | George Kadianakis <desnacked@riseup.net> | 2015-01-29 15:09:53 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-02-18 09:09:34 -0500 |
commit | c2b13e22e7c03f6e318b516ae1faf76f8ba30e83 (patch) | |
tree | 283bb57a22e7d7da3bd21432e78cec9fceae36ea /src/test/test_entrynodes.c | |
parent | b941f109ac037b270da6f07ffb4947ee237e468a (diff) | |
download | tor-c2b13e22e7c03f6e318b516ae1faf76f8ba30e83.tar.gz tor-c2b13e22e7c03f6e318b516ae1faf76f8ba30e83.zip |
Unittest prep: Move get_yesterday_date_str() to helper file.
We want to use this function in our guardfraction unittests, so make a
test_helpers module and move it there.
Diffstat (limited to 'src/test/test_entrynodes.c')
-rw-r--r-- | src/test/test_entrynodes.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index 19071a1550..b60b2331db 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -19,6 +19,7 @@ #include "config.h" #include "test_descriptors.inc" +#include "test_helpers.h" /* TODO: * choose_random_entry() test with state set. @@ -326,19 +327,6 @@ state_lines_free(smartlist_t *entry_guard_lines) smartlist_free(entry_guard_lines); } -/* Return a statically allocated string representing yesterday's date - * in ISO format. We use it so that state file items are not found to - * be outdated. */ -static const char * -get_yesterday_date_str(void) -{ - static char buf[ISO_TIME_LEN+1]; - - time_t yesterday = time(NULL) - 24*60*60; - format_iso_time(buf, yesterday); - return buf; -} - /* Tests entry_guards_parse_state(). It creates a fake Tor state with a saved entry guard and makes sure that Tor can parse it and creates the right entry node out of it. |