Added
Link Here
|
1 |
--- src/lib-index/test-mail-index-transaction-update.c.orig 2022-06-14 06:55:03 UTC |
2 |
+++ src/lib-index/test-mail-index-transaction-update.c |
3 |
@@ -6,6 +6,7 @@ |
4 |
#include "test-common.h" |
5 |
#include "mail-index-private.h" |
6 |
#include "mail-index-transaction-private.h" |
7 |
+#include "utc-offset.h" |
8 |
|
9 |
#include <time.h> |
10 |
|
11 |
@@ -630,7 +631,9 @@ static void test_mail_index_update_day_first_uid(void) |
12 |
|
13 |
/* daylight savings times were confusing these tests, so we'll now |
14 |
just assume that TZ=UTC */ |
15 |
- test_assert(timezone == 0); |
16 |
+ time_t now = time(NULL); |
17 |
+ struct tm *local_time = localtime(&now); |
18 |
+ test_assert(utc_offset(local_time, now) == 0); |
19 |
|
20 |
hdr.messages_count = 10; |
21 |
t = mail_index_transaction_new(); |
22 |
@@ -645,13 +648,13 @@ static void test_mail_index_update_day_first_uid(void) |
23 |
i_zero(&hdr); |
24 |
for (j = 0; j < N_ELEMENTS(hdr.day_first_uid); j++) |
25 |
hdr.day_first_uid[j] = 8-j; |
26 |
- hdr.day_stamp = tests[i].old_day_stamp + timezone; |
27 |
+ hdr.day_stamp = tests[i].old_day_stamp; |
28 |
memcpy(t->post_hdr_change, &hdr, sizeof(hdr)); |
29 |
- mail_index_update_day_headers(t, tests[i].now + timezone); |
30 |
+ mail_index_update_day_headers(t, tests[i].now); |
31 |
|
32 |
struct mail_index_header new_hdr; |
33 |
memcpy(&new_hdr, t->post_hdr_change, sizeof(new_hdr)); |
34 |
- test_assert_idx(new_hdr.day_stamp == tests[i].new_day_stamp + timezone, i); |
35 |
+ test_assert_idx(new_hdr.day_stamp == tests[i].new_day_stamp, i); |
36 |
test_assert_idx(memcmp(new_hdr.day_first_uid, |
37 |
tests[i].new_day_first_uid, |
38 |
sizeof(uint32_t) * 8) == 0, i); |