changeset 21703:f17b7e5e532a

lib: Fix t_strf*time() unit tests Timezone isn't part of the standard struct tm, so %z doesn't necessarily expand as expected outside Linux.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 26 Feb 2017 15:37:36 +0200
parents 23398ba09ac2
children 312b8a2b09df
files src/lib/test-time-util.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/test-time-util.c	Sun Feb 26 15:21:13 2017 +0200
+++ b/src/lib/test-time-util.c	Sun Feb 26 15:37:36 2017 +0200
@@ -113,13 +113,13 @@
 	test_end();
 }
 
-#define RFC2822_FMT "%a, %d %b %Y %T %z"
+#define RFC2822_FMT "%a, %d %b %Y %T"
 static void test_strftime_fixed(void)
 {
 	test_begin("t_strftime and variants fixed timestamp");
 
 	time_t ts = 1481222536;
-	const char *exp = "Thu, 08 Dec 2016 18:42:16 +0000";
+	const char *exp = "Thu, 08 Dec 2016 18:42:16";
 	test_assert(strcmp(t_strftime(RFC2822_FMT, gmtime(&ts)), exp) == 0);
 	test_assert(strcmp(t_strfgmtime(RFC2822_FMT, ts), exp) == 0);