summaryrefslogtreecommitdiff
blob: ec0e83a80bf57cade926211770da032209c65b0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 3a0d2009741cdf825492020acab7c85867a60589 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@gentoo.org>
Date: Thu, 22 Feb 2018 12:27:36 +0100
Subject: [PATCH] tests: Skip tests for dates on 32-bit platforms which cannot
 be representated

Tests "test_IANA_Perth_tz" and "test_IANA_Minsk_tz" are failing on 32-bit
platforms because the earliest timestamp which can be representated on a
32-bit platform is "1901-12-13 20:45:52" but the test ranges start before
that date.

To be safe, this commit will add code to skip tests before year 1902 on
32-bit platforms.

Bug: https://bugs.gentoo.org/647596
---
 libgnucash/engine/test/gtest-gnc-timezone.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libgnucash/engine/test/gtest-gnc-timezone.cpp b/libgnucash/engine/test/gtest-gnc-timezone.cpp
index 5c46b2618..298220f6e 100644
--- a/libgnucash/engine/test/gtest-gnc-timezone.cpp
+++ b/libgnucash/engine/test/gtest-gnc-timezone.cpp
@@ -154,6 +154,14 @@ TEST(gnc_timezone_constructors, test_IANA_Perth_tz)
         }
         else if (year < 1916)
 #else
+        if (year < 1902)
+        {
+            // Earliest timestamp which can be represented on a 32-bit
+            // system is "1901-12-13 20:45:52" -- so skip tests until we
+            // reach a year >1901 to be safe
+            continue;
+        }
+
         if (year < 1916)
 #endif
         {
@@ -216,6 +224,14 @@ TEST(gnc_timezone_constructors, test_IANA_Minsk_tz)
         }
         else if (year < 1924)
 #else
+        if (year < 1902)
+        {
+            // Earliest timestamp which can be represented on a 32-bit
+            // system is "1901-12-13 20:45:52" -- so skip tests until we
+            // reach a year >1901 to be safe
+            continue;
+        }
+
         if (year < 1924)
 #endif
         {
-- 
2.16.2