Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/gnucash/files/, app-office/gnucash/
Date: Thu, 22 Feb 2018 11:45:59
Message-Id: 1519299840.432f3f5e66e510ae29429064071ce83465ad6bb5.whissi@gentoo
1 commit: 432f3f5e66e510ae29429064071ce83465ad6bb5
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 22 11:44:00 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 22 11:44:00 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=432f3f5e
7
8 app-office/gnucash: Add patch to address test failures on 32-bit platforms
9
10 Bug: https://bugs.gentoo.org/647596
11 Package-Manager: Portage-2.3.24, Repoman-2.3.6
12
13 ...ucash-2.7.4-fix-tests-for-32bit-platforms.patch | 56 ++++++++++++++++++++++
14 app-office/gnucash/gnucash-2.7.4-r1.ebuild | 5 +-
15 2 files changed, 60 insertions(+), 1 deletion(-)
16
17 diff --git a/app-office/gnucash/files/gnucash-2.7.4-fix-tests-for-32bit-platforms.patch b/app-office/gnucash/files/gnucash-2.7.4-fix-tests-for-32bit-platforms.patch
18 new file mode 100644
19 index 00000000000..ec0e83a80bf
20 --- /dev/null
21 +++ b/app-office/gnucash/files/gnucash-2.7.4-fix-tests-for-32bit-platforms.patch
22 @@ -0,0 +1,56 @@
23 +From 3a0d2009741cdf825492020acab7c85867a60589 Mon Sep 17 00:00:00 2001
24 +From: Thomas Deutschmann <whissi@g.o>
25 +Date: Thu, 22 Feb 2018 12:27:36 +0100
26 +Subject: [PATCH] tests: Skip tests for dates on 32-bit platforms which cannot
27 + be representated
28 +
29 +Tests "test_IANA_Perth_tz" and "test_IANA_Minsk_tz" are failing on 32-bit
30 +platforms because the earliest timestamp which can be representated on a
31 +32-bit platform is "1901-12-13 20:45:52" but the test ranges start before
32 +that date.
33 +
34 +To be safe, this commit will add code to skip tests before year 1902 on
35 +32-bit platforms.
36 +
37 +Bug: https://bugs.gentoo.org/647596
38 +---
39 + libgnucash/engine/test/gtest-gnc-timezone.cpp | 16 ++++++++++++++++
40 + 1 file changed, 16 insertions(+)
41 +
42 +diff --git a/libgnucash/engine/test/gtest-gnc-timezone.cpp b/libgnucash/engine/test/gtest-gnc-timezone.cpp
43 +index 5c46b2618..298220f6e 100644
44 +--- a/libgnucash/engine/test/gtest-gnc-timezone.cpp
45 ++++ b/libgnucash/engine/test/gtest-gnc-timezone.cpp
46 +@@ -154,6 +154,14 @@ TEST(gnc_timezone_constructors, test_IANA_Perth_tz)
47 + }
48 + else if (year < 1916)
49 + #else
50 ++ if (year < 1902)
51 ++ {
52 ++ // Earliest timestamp which can be represented on a 32-bit
53 ++ // system is "1901-12-13 20:45:52" -- so skip tests until we
54 ++ // reach a year >1901 to be safe
55 ++ continue;
56 ++ }
57 ++
58 + if (year < 1916)
59 + #endif
60 + {
61 +@@ -216,6 +224,14 @@ TEST(gnc_timezone_constructors, test_IANA_Minsk_tz)
62 + }
63 + else if (year < 1924)
64 + #else
65 ++ if (year < 1902)
66 ++ {
67 ++ // Earliest timestamp which can be represented on a 32-bit
68 ++ // system is "1901-12-13 20:45:52" -- so skip tests until we
69 ++ // reach a year >1901 to be safe
70 ++ continue;
71 ++ }
72 ++
73 + if (year < 1924)
74 + #endif
75 + {
76 +--
77 +2.16.2
78 +
79
80 diff --git a/app-office/gnucash/gnucash-2.7.4-r1.ebuild b/app-office/gnucash/gnucash-2.7.4-r1.ebuild
81 index b51571b500e..3e3690ce231 100644
82 --- a/app-office/gnucash/gnucash-2.7.4-r1.ebuild
83 +++ b/app-office/gnucash/gnucash-2.7.4-r1.ebuild
84 @@ -82,7 +82,10 @@ DEPEND="${RDEPEND}
85 # gnome-extra/yelp
86 # )"
87
88 -PATCHES=( "${FILESDIR}"/gnucash-2.7.4-double_free.patch )
89 +PATCHES=(
90 + "${FILESDIR}"/${P}-double_free.patch
91 + "${FILESDIR}"/${P}-fix-tests-for-32bit-platforms.patch
92 +)
93
94 pkg_setup() {
95 use python && python-single-r1_pkg_setup