From: Karl Fleischmann Date: Fri, 10 Jun 2022 13:44:52 +0000 (+0200) Subject: lib-index/test-mail-index-transaction-update.c: Fix timzone offset check X-Git-Tag: 2.4.0~3820 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a7b1f66fe;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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();