summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-04-09 12:24:52 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2019-04-09 12:24:52 +0300
commitc7cf49dc3cce42a77d32011599780360658b1fc9 (patch)
tree19586291fb9be4f958fc3c3c05af614bbe986af0
parent92e8bdf296c042ad386b2acb764bb4f4cfd2de0f (diff)
parenta63bd877608cc9892c58ca8addbe18f9f7eff468 (diff)
downloadtor-c7cf49dc3cce42a77d32011599780360658b1fc9.tar.gz
tor-c7cf49dc3cce42a77d32011599780360658b1fc9.zip
Merge branch 'tor-github/pr/915' into maint-0.4.0
-rw-r--r--changes/bug299224
-rw-r--r--src/test/test_util.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/changes/bug29922 b/changes/bug29922
new file mode 100644
index 0000000000..dacb951097
--- /dev/null
+++ b/changes/bug29922
@@ -0,0 +1,4 @@
+ o Minor bugfixes (testing, windows):
+ - Fix a test failure caused by an unexpected bug warning in
+ our test for tor_gmtime_r(-1). Fixes bug 29922;
+ bugfix on 0.2.9.3-alpha.
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 7a2708c541..a473ed1e7b 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));