diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-04-09 12:25:18 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-04-09 12:25:18 +0300 |
commit | 16041d791873dc063a625e09fb62206d8ab2e6f4 (patch) | |
tree | 41712a80bf6ba5c5e0cb417c6b643e9a8c360f53 /src/test/test_util.c | |
parent | 3d45079c27b94f073442f80b203f9787857c2d01 (diff) | |
parent | c7cf49dc3cce42a77d32011599780360658b1fc9 (diff) | |
download | tor-16041d791873dc063a625e09fb62206d8ab2e6f4.tar.gz tor-16041d791873dc063a625e09fb62206d8ab2e6f4.zip |
Merge branch 'maint-0.4.0'
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index da55fcac30..fbb8ca2bf1 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -728,6 +728,13 @@ test_util_time(void *arg) #define CHECK_TIMEGM_ARG_OUT_OF_RANGE(msg) \ CHECK_TIMEGM_WARNING("Out-of-range argument to tor_timegm") +#define CHECK_POSSIBLE_TIMEGM_ARG_OUT_OF_RANGE(msg) \ + do { \ + if (mock_saved_log_n_entries()) { \ + expect_single_log_msg_containing("Out-of-range argument");\ + } \ + teardown_capture_of_logs(); \ + } while (0) /* year */ @@ -914,7 +921,9 @@ test_util_time(void *arg) * depending on whether the implementation of the system gmtime(_r) * sets struct tm (1) or not (1970) */ t_res = -1; + CAPTURE(); tor_gmtime_r(&t_res, &b_time); + CHECK_POSSIBLE_TIMEGM_ARG_OUT_OF_RANGE(); tt_assert(b_time.tm_year == (1970-1900) || b_time.tm_year == (1969-1900)); |