aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-01-12 10:11:45 -0500
committerNick Mathewson <nickm@torproject.org>2016-01-12 10:11:45 -0500
commit91b3fa3636eecc15688263e32133e97fcce36c93 (patch)
tree2108230e7320a2a5c711bfb10505730ce986f803
parent1c139f60d201a574fc30d8f53786b6727bef762c (diff)
parent9e5a6f02937912fbb2a1582aae99186310192fa1 (diff)
downloadtor-91b3fa3636eecc15688263e32133e97fcce36c93.tar.gz
tor-91b3fa3636eecc15688263e32133e97fcce36c93.zip
Merge remote-tracking branch 'fergus-dall/log_heartbeat_test'
-rw-r--r--changes/log_heartbeat_test5
-rw-r--r--src/test/test_status.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/changes/log_heartbeat_test b/changes/log_heartbeat_test
new file mode 100644
index 0000000000..f0d143b6de
--- /dev/null
+++ b/changes/log_heartbeat_test
@@ -0,0 +1,5 @@
+ o Minor bugfix (testing):
+ - The test for log_heartbeat was incorrectly failing in timezones
+ with non-integer offsets. Instead of comparing the end of the
+ time string against a constant, compare it to the output of
+ format_local_iso_time when given the correct input.
diff --git a/src/test/test_status.c b/src/test/test_status.c
index 57d69b1cc3..84a0f6c024 100644
--- a/src/test/test_status.c
+++ b/src/test/test_status.c
@@ -714,9 +714,11 @@ NS(logv)(int severity, log_domain_mask_t domain,
tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_used */
tt_str_op(va_arg(ap, char *), OP_EQ, "0 kB"); /* acc_max */
tt_str_op(va_arg(ap, char *), OP_EQ, "max"); /* acc_rule */
- /* format_local_iso_time uses local tz, just check mins and secs. */
- tt_ptr_op(strstr(va_arg(ap, char *), ":01:00"),
- OP_NE, NULL); /* end_buf */
+ /* format_local_iso_time uses local tz, so we can't just compare
+ * the string against a constant */
+ char datetime[ISO_TIME_LEN+1];
+ format_local_iso_time(datetime, 60);
+ tt_str_op(va_arg(ap, char *), OP_EQ, datetime); /* end_buf */
tt_str_op(va_arg(ap, char *), OP_EQ, "0:01 hours"); /* remaining */
break;
case 2: