Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cxxtools for openSUSE:Factory checked in at 2022-08-15 19:58:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cxxtools (Old) and /work/SRC/openSUSE:Factory/.cxxtools.new.1521 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cxxtools" Mon Aug 15 19:58:35 2022 rev:8 rq:995134 version:3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/cxxtools/cxxtools.changes 2021-08-23 10:08:22.328232245 +0200 +++ /work/SRC/openSUSE:Factory/.cxxtools.new.1521/cxxtools.changes 2022-08-15 20:00:46.945488760 +0200 @@ -1,0 +2,9 @@ +Thu Aug 11 08:51:05 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr> + +- Add upstream changes to fix build and tests: + * 0001-add-missing-header-time.h-to-src-timer.cpp.patch + * 0001-remove-timespan-unittest-which-is-prone-to-rounding-.patch + * 0001-fix-reading-time-zones-on-32-bit-systems.patch + * 0001-remove-range-check-in-serializationinfo.patch + +------------------------------------------------------------------- New: ---- 0001-add-missing-header-time.h-to-src-timer.cpp.patch 0001-fix-reading-time-zones-on-32-bit-systems.patch 0001-remove-range-check-in-serializationinfo.patch 0001-remove-timespan-unittest-which-is-prone-to-rounding-.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cxxtools.spec ++++++ --- /var/tmp/diff_new_pack.4L6ePK/_old 2022-08-15 20:00:47.625490656 +0200 +++ /var/tmp/diff_new_pack.4L6ePK/_new 2022-08-15 20:00:47.637490690 +0200 @@ -27,7 +27,11 @@ URL: http://www.tntnet.org/cxxtools.html Source0: https://github.com/maekitalo/cxxtools/archive/V%{version}.tar.gz#/%{name}-%{version}.tar.gz Source99: cxxtools-rpmlintrc -Patch1: gcc11.patch +Patch0: gcc11.patch +Patch1: 0001-add-missing-header-time.h-to-src-timer.cpp.patch +Patch2: 0001-remove-timespan-unittest-which-is-prone-to-rounding-.patch +Patch3: 0001-fix-reading-time-zones-on-32-bit-systems.patch +Patch4: 0001-remove-range-check-in-serializationinfo.patch BuildRequires: autoconf BuildRequires: gcc-c++ BuildRequires: libtool ++++++ 0001-add-missing-header-time.h-to-src-timer.cpp.patch ++++++ >From 458c9baafbbe81550a2789b9e3d8716fd3c23ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20M=C3=A4kitalo?= <to...@vantaa.tm.maekitalo.de> Date: Sat, 6 Aug 2022 18:47:30 +0200 Subject: [PATCH] add missing header time.h to src/timer.cpp --- src/timer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/timer.cpp b/src/timer.cpp index f0a98b3..3098361 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -28,6 +28,7 @@ #include "cxxtools/selector.h" #include "cxxtools/datetime.h" #include <stdexcept> +#include <time.h> namespace cxxtools { -- 2.37.1 ++++++ 0001-fix-reading-time-zones-on-32-bit-systems.patch ++++++ >From c7dd08ea25a5b54922c28f2665c8027d6f93e101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20M=C3=A4kitalo?= <to...@tntnet.org> Date: Tue, 2 Feb 2021 18:27:27 +0100 Subject: [PATCH] fix reading time zones on 32 bit systems time_t is 32 bit on 32 bit systems but we need 64 bit --- src/tz.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/tz.cpp b/src/tz.cpp index 599d8f5..66f243b 100644 --- a/src/tz.cpp +++ b/src/tz.cpp @@ -52,6 +52,8 @@ log_define("cxxtools.tz") namespace cxxtools { +typedef int64_t TimeValue; + class Tz::Impl : public RefCounted { friend class Tz; @@ -81,13 +83,13 @@ class Tz::Impl : public RefCounted struct LeapInfo { - time_t transitionTime; + TimeValue transitionTime; int32_t corrections; }; struct Transition { - time_t transitionTime; + TimeValue transitionTime; uint8_t ttIndex; }; @@ -337,7 +339,7 @@ const std::string& Tz::name() const TzDateTime Tz::toLocal(const UtcDateTime& dt) const { - time_t t = static_cast<time_t>(dt.msecsSinceEpoch().totalSeconds()); + TimeValue t = static_cast<TimeValue>(dt.msecsSinceEpoch().totalSeconds()); uint8_t ttIndex = 0; for (unsigned i = 0; i < _impl->transitions.size(); ++i) @@ -365,7 +367,7 @@ TzDateTime Tz::toLocal(const UtcDateTime& dt) const return TzDateTime(dt + gmtoff, tzName, gmtoff, isdst, leapSeconds); } -static std::string timeT2s(time_t t) +static std::string timeT2s(TimeValue t) { return cxxtools::DateTime::fromMSecsSinceEpoch(cxxtools::Seconds(t)).toString(); } @@ -377,7 +379,7 @@ UtcDateTime Tz::toUtc(const LocalDateTime& dt) const if (_impl->transitions.empty()) return UtcDateTime(dt); - time_t t = static_cast<time_t>(dt.msecsSinceEpoch().totalSeconds()); + TimeValue t = static_cast<TimeValue>(dt.msecsSinceEpoch().totalSeconds()); unsigned i; for (i = 0; i < _impl->transitions.size() - 1; ++i) { @@ -417,7 +419,7 @@ UtcDateTime Tz::toUtc(const LocalDateTime& dt, bool early) const if (_impl->transitions.empty()) return UtcDateTime(dt); - time_t t = static_cast<time_t>(dt.msecsSinceEpoch().totalSeconds()); + TimeValue t = static_cast<TimeValue>(dt.msecsSinceEpoch().totalSeconds()); unsigned i; for (i = 0; i < _impl->transitions.size() - 1; ++i) { @@ -464,7 +466,7 @@ UtcDateTime Tz::previousChange(const cxxtools::DateTime& dt, bool local) const if (!_impl->transitions.empty()) { - time_t t = static_cast<time_t>(dt.msecsSinceEpoch().totalSeconds()); + TimeValue t = static_cast<TimeValue>(dt.msecsSinceEpoch().totalSeconds()); for (unsigned i = 0; i < _impl->transitions.size() - 1; ++i) { if (_impl->transitions[i + 1].transitionTime > t) @@ -484,7 +486,7 @@ UtcDateTime Tz::nextChange(const cxxtools::DateTime& dt, bool local) const if (!_impl->transitions.empty()) { - time_t t = static_cast<time_t>(dt.msecsSinceEpoch().totalSeconds()); + TimeValue t = static_cast<TimeValue>(dt.msecsSinceEpoch().totalSeconds()); for (unsigned i = 0; i < _impl->transitions.size() - 1; ++i) { if (_impl->transitions[i + 1].transitionTime > t) @@ -500,7 +502,7 @@ UtcDateTime Tz::nextChange(const cxxtools::DateTime& dt, bool local) const cxxtools::Timespan Tz::offset(const UtcDateTime& gmtDt) const { - time_t t = static_cast<time_t>(gmtDt.msecsSinceEpoch().totalSeconds()); + TimeValue t = static_cast<TimeValue>(gmtDt.msecsSinceEpoch().totalSeconds()); uint8_t ttIndex = 0; for (unsigned i = 0; i < _impl->transitions.size(); ++i) -- 2.37.1 ++++++ 0001-remove-range-check-in-serializationinfo.patch ++++++ >From 92ef7c2fd3431ba7c17434e66721d53149d81c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20M=C3=A4kitalo?= <to...@tntnet.org> Date: Mon, 22 Feb 2021 16:13:08 +0100 Subject: [PATCH] remove range check in serializationinfo The test was not really useful and anyway skipped when double and long double are identical. Somehow it did not work on PPC64. --- test/serializationinfo-test.cpp | 44 --------------------------------- 1 file changed, 44 deletions(-) diff --git a/test/serializationinfo-test.cpp b/test/serializationinfo-test.cpp index f33a419..3b81a20 100644 --- a/test/serializationinfo-test.cpp +++ b/test/serializationinfo-test.cpp @@ -70,7 +70,6 @@ class SerializationInfoTest : public cxxtools::unit::TestSuite registerMethod("testMove", *this, &SerializationInfoTest::testMove); #endif registerMethod("testStringToBool", *this, &SerializationInfoTest::testStringToBool); - registerMethod("testRangeCheck", *this, &SerializationInfoTest::testRangeCheck); registerMethod("testMember", *this, &SerializationInfoTest::testMember); } @@ -543,49 +542,6 @@ class SerializationInfoTest : public cxxtools::unit::TestSuite CXXTOOLS_UNIT_ASSERT(siValue<bool>(si)); } - void testRangeCheck() - { - cxxtools::SerializationInfo si; - si.setValue(-1); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<unsigned short>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<unsigned>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<unsigned long>(si), std::range_error); - - si.setValue(static_cast<long>(std::numeric_limits<short>::max()) + 1); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<short>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue<long>(si)); - - if (std::numeric_limits<long double>::max() > static_cast<long double>(std::numeric_limits<double>::max())) - { - si.setValue(static_cast<long double>(std::numeric_limits<double>::max()) * 1.01); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<double>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue<long double>(si)); - - si.setValue(static_cast<long double>(-std::numeric_limits<double>::max()) * 1.01); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<double>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue<long double>(si)); - } - else - { - log_info("range error for double skipped since long double is not larger than double"); - } - - if (std::numeric_limits<long double>::max() > static_cast<long double>(std::numeric_limits<float>::max())) - { - si.setValue(static_cast<long double>(std::numeric_limits<float>::max()) * 1.01); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<float>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue<double>(si)); - - si.setValue(static_cast<long double>(-std::numeric_limits<float>::max()) * 1.01); - CXXTOOLS_UNIT_ASSERT_THROW(siValue<float>(si), std::range_error); - CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue<double>(si)); - } - else - { - log_info("range error for float skipped since long double is not larger than double"); - } - } - void testMember() { cxxtools::SerializationInfo si; -- 2.37.1 ++++++ 0001-remove-timespan-unittest-which-is-prone-to-rounding-.patch ++++++ >From daacbe49c4f2494b23b30318feb4baf0e5dd9ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20M=C3=A4kitalo?= <to...@tntnet.org> Date: Tue, 2 Feb 2021 18:57:16 +0100 Subject: [PATCH] remove timespan unittest which is prone to rounding errors due to binary arithmentic --- test/timespan-test.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/test/timespan-test.cpp b/test/timespan-test.cpp index ee553b7..ffbc951 100644 --- a/test/timespan-test.cpp +++ b/test/timespan-test.cpp @@ -225,26 +225,6 @@ class TimespanTest : public cxxtools::unit::TestSuite CXXTOOLS_UNIT_ASSERT_EQUALS(number, 17.875); } - { - cxxtools::Seconds t(cxxtools::Timespan(14999999)); - cxxtools::SerializationInfo si; - si <<= t; - cxxtools::Timespan t2; - si >>= t2; - CXXTOOLS_UNIT_ASSERT_EQUALS(t.totalUSecs(), t2.totalUSecs()); - CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "seconds"); - } - - { - cxxtools::Seconds t(cxxtools::Timespan(14999998)); - cxxtools::SerializationInfo si; - si <<= t; - cxxtools::Timespan t2; - si >>= t2; - CXXTOOLS_UNIT_ASSERT_EQUALS(t, t2); - CXXTOOLS_UNIT_ASSERT_EQUALS(si.typeName(), "seconds"); - } - { cxxtools::Minutes t(17.875); cxxtools::SerializationInfo si; -- 2.37.1