gnucash unstable: Bug 790845 - 2.7.3: massive test failures on some architectures (reopened).
John Ralls
jralls at code.gnucash.org
Sun Jan 14 19:32:17 EST 2018
Updated via https://github.com/Gnucash/gnucash/commit/8900b19d (commit)
from https://github.com/Gnucash/gnucash/commit/2257faa0 (commit)
commit 8900b19da3bdd19b9ce64daf31d621aaa10db40e
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jan 14 16:21:34 2018 -0800
Bug 790845 - 2.7.3: massive test failures on some architectures (reopened).
Fix some test failures caused by erroneous size assumptions.
diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index e3c1dd7..fe86958 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -312,11 +312,11 @@ class GncNumeric(GnuCashCoreClass):
raise TypeError('Only two ints allowed: ' + str(args))
elif len(args) == 3:
if type(args[0]) == float \
- and type(args[1]) == type(GNC_DENOM_AUTO) \
+ and type(args[1]) in (int, long) \
and type(args[2]) == type(GNC_HOW_DENOM_FIXED):
return double_to_gnc_numeric(*args)
else:
- raise TypeError('Only (float, GNC_HOW_RND_*, GNC_HOW_RND_*, GNC_HOW_RND_*) allowed: ' + str(args))
+ raise TypeError('Only (float, int/long, GNC_HOW_RND_*) allowed: ' + str(args))
else:
raise TypeError('Required single int/float/str or two ints: ' + str(args))
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
index a2f7c1a..020f730 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
@@ -209,7 +209,7 @@ GncSqlColumnTableEntryImpl<CT_BOOLEAN>::load (const GncSqlBackend* sql_be,
g_return_if_fail (m_gobj_param_name != NULL || get_setter(obj_name) != NULL);
auto val = row.get_int_at_col (m_col_name);
- set_parameter(pObject, val,
+ set_parameter(pObject, static_cast<int>(val),
reinterpret_cast<BooleanSetterFunc>(get_setter(obj_name)),
m_gobj_param_name);
}
diff --git a/libgnucash/engine/test/gtest-gnc-timezone.cpp b/libgnucash/engine/test/gtest-gnc-timezone.cpp
index d499544..5c46b26 100644
--- a/libgnucash/engine/test/gtest-gnc-timezone.cpp
+++ b/libgnucash/engine/test/gtest-gnc-timezone.cpp
@@ -145,6 +145,7 @@ TEST(gnc_timezone_constructors, test_IANA_Perth_tz)
for (int year = 1893; year < 2048; ++year)
{
auto tz = tzp.get(year);
+#ifdef __LP64__
if (year < 1895)
{
EXPECT_EQ(tz->std_zone_abbrev(), "LMT");
@@ -152,6 +153,9 @@ TEST(gnc_timezone_constructors, test_IANA_Perth_tz)
EXPECT_EQ(tz->base_utc_offset().total_seconds(), 27804);
}
else if (year < 1916)
+#else
+ if (year < 1916)
+#endif
{
EXPECT_EQ(tz->std_zone_abbrev(), "AWST");
EXPECT_FALSE(tz->has_dst());
@@ -203,6 +207,7 @@ TEST(gnc_timezone_constructors, test_IANA_Minsk_tz)
for (int year = 1870; year < 2020; ++year)
{
auto tz = tzp.get(year);
+#ifdef __LP64__
if (year < 1879)
{
EXPECT_EQ(tz->std_zone_abbrev(), "LMT");
@@ -210,6 +215,9 @@ TEST(gnc_timezone_constructors, test_IANA_Minsk_tz)
EXPECT_EQ(tz->base_utc_offset().total_seconds(), 6616);
}
else if (year < 1924)
+#else
+ if (year < 1924)
+#endif
{
EXPECT_EQ(tz->std_zone_abbrev(), "MMT");
EXPECT_FALSE(tz->has_dst());
Summary of changes:
bindings/python/gnucash_core.py | 4 ++--
libgnucash/backend/sql/gnc-sql-column-table-entry.cpp | 2 +-
libgnucash/engine/test/gtest-gnc-timezone.cpp | 8 ++++++++
3 files changed, 11 insertions(+), 3 deletions(-)
More information about the gnucash-changes
mailing list