gnucash unstable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Mar 6 12:56:29 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/5520fae8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/36d72965 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d95eb0f7 (commit)



commit 5520fae838bfddc92385c85706e741a753458c5d
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Mar 6 09:56:13 2018 -0800

    Bug 793941 - 2.7.4: test failure on i686: 59 - test-gnc-timezone
    
    Don't test before 1916, that's not a common GnuCash use-case.

diff --git a/libgnucash/engine/test/gtest-gnc-timezone.cpp b/libgnucash/engine/test/gtest-gnc-timezone.cpp
index 5c46b26..963466c 100644
--- a/libgnucash/engine/test/gtest-gnc-timezone.cpp
+++ b/libgnucash/engine/test/gtest-gnc-timezone.cpp
@@ -142,26 +142,10 @@ TEST(gnc_timezone_constructors, test_IANA_Belize_tz)
 TEST(gnc_timezone_constructors, test_IANA_Perth_tz)
 {
     TimeZoneProvider tzp("Australia/Perth");
-    for (int year = 1893; year < 2048; ++year)
+    for (int year = 1916; year < 2048; ++year)
     {
         auto tz = tzp.get(year);
-#ifdef __LP64__
-        if (year < 1895)
-        {
-            EXPECT_EQ(tz->std_zone_abbrev(), "LMT");
-            EXPECT_FALSE(tz->has_dst());
-            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());
-            EXPECT_EQ(tz->base_utc_offset().total_seconds(), 28800);
-        }
-        else if (year < 1917)
+        if (year < 1917)
         {
             EXPECT_EQ(tz->std_zone_abbrev(), "AWST");
             EXPECT_TRUE(tz->has_dst());
@@ -204,20 +188,10 @@ TEST(gnc_timezone_constructors, test_IANA_Perth_tz)
 TEST(gnc_timezone_constructors, test_IANA_Minsk_tz)
 {
     TimeZoneProvider tzp("Europe/Minsk");
-    for (int year = 1870; year < 2020; ++year)
+    for (int year = 1916; year < 2020; ++year)
     {
         auto tz = tzp.get(year);
-#ifdef __LP64__
-        if (year < 1879)
-        {
-            EXPECT_EQ(tz->std_zone_abbrev(), "LMT");
-            EXPECT_FALSE(tz->has_dst());
-            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());

commit 36d729652b2bc456cf04b92d3f7588e8bf25266d
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Mar 6 09:48:22 2018 -0800

    Speed up GUID equality comparison.

diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp
index 43b32fb..c58b49a 100644
--- a/libgnucash/engine/guid.cpp
+++ b/libgnucash/engine/guid.cpp
@@ -412,9 +412,7 @@ GUID::operator < (GUID const & other) noexcept
 
 bool operator == (GUID const & lhs, GncGUID const & rhs) noexcept
 {
-    auto ret = std::mismatch (lhs.begin (), lhs.end (), rhs.reserved);
-    return ret.first == lhs.end ();
-
+    return lhs.implementation == GUID(rhs).implementation;
 }
 
 bool
diff --git a/libgnucash/engine/guid.hpp b/libgnucash/engine/guid.hpp
index 837d509..3a79852 100644
--- a/libgnucash/engine/guid.hpp
+++ b/libgnucash/engine/guid.hpp
@@ -55,6 +55,7 @@ struct GUID
     auto begin () const noexcept -> decltype (implementation.begin ());
     auto end () const noexcept -> decltype (implementation.end ());
     bool operator < (GUID const &) noexcept;
+    friend bool operator == (GUID const &, GncGUID const &) noexcept;
     friend bool operator != (GUID const &, GUID const &) noexcept;
 };
 



Summary of changes:
 libgnucash/engine/guid.cpp                    |  4 +---
 libgnucash/engine/guid.hpp                    |  1 +
 libgnucash/engine/test/gtest-gnc-timezone.cpp | 32 +++------------------------
 3 files changed, 5 insertions(+), 32 deletions(-)



More information about the gnucash-changes mailing list