From 1a7b1f66fe4b86cb642dbcfe5a0192c1b77d0e17 Mon Sep 17 00:00:00 2001 From: Karl Fleischmann Date: Fri, 10 Jun 2022 15:44:52 +0200 Subject: [PATCH] lib-index/test-mail-index-transaction-update.c: Fix timzone offset check The extern timezone variable is not standardized. This commit introduces a more portable way of determining the UTC-offset by using the local time. --- src/lib-index/test-mail-index-transaction-update.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib-index/test-mail-index-transaction-update.c b/src/lib-index/test-mail-index-transaction-update.c index cdfa951115..632265025a 100644 --- a/src/lib-index/test-mail-index-transaction-update.c +++ b/src/lib-index/test-mail-index-transaction-update.c @@ -6,6 +6,7 @@ #include "test-common.h" #include "mail-index-private.h" #include "mail-index-transaction-private.h" +#include "utc-offset.h" #include @@ -630,7 +631,9 @@ static void test_mail_index_update_day_first_uid(void) /* daylight savings times were confusing these tests, so we'll now just assume that TZ=UTC */ - test_assert(timezone == 0); + time_t now = time(NULL); + struct tm *local_time = localtime(&now); + test_assert(utc_offset(local_time, now) == 0); hdr.messages_count = 10; t = mail_index_transaction_new(); -- 2.47.3