[libosmium] 01/02: Add upstream patches which should help with test failures on hurd & mips.

Bas Couwenberg sebastic at debian.org
Tue Aug 22 06:18:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository libosmium.

commit 374359d1fc5df249914bbefe3ad189223b02ba02
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Tue Aug 22 07:52:38 2017 +0200

    Add upstream patches which should help with test failures on hurd & mips.
---
 debian/changelog                                   |  6 +++
 ...ber-of-threads-allowed-for-the-Pool-to-32.patch | 30 +++++++++++++
 ...to-compare-floating-point-values-in-tests.patch | 49 ++++++++++++++++++++++
 debian/patches/series                              |  2 +
 4 files changed, 87 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 390422b..f399fd0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libosmium (2.13.0-4) UNRELEASED; urgency=medium
+
+  * Add upstream patches which should help with test failures on hurd & mips.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 22 Aug 2017 07:52:03 +0200
+
 libosmium (2.13.0-3) unstable; urgency=medium
 
   * Ignore test failures on mips & mipsel.
diff --git a/debian/patches/Reduce-the-max-number-of-threads-allowed-for-the-Pool-to-32.patch b/debian/patches/Reduce-the-max-number-of-threads-allowed-for-the-Pool-to-32.patch
new file mode 100644
index 0000000..f5a527d
--- /dev/null
+++ b/debian/patches/Reduce-the-max-number-of-threads-allowed-for-the-Pool-to-32.patch
@@ -0,0 +1,30 @@
+Description: Reduce the max number of threads allowed for the Pool to 32.
+ This should still be plenty and might help with test failures on
+ mips architectures.
+Author: Jochen Topf <jochen at topf.org>
+Origin: https://github.com/osmcode/libosmium/commit/aa5bb5b0b272cdaa5bb2db7b79a5b69116951999
+
+--- a/include/osmium/thread/pool.hpp
++++ b/include/osmium/thread/pool.hpp
+@@ -56,7 +56,7 @@ namespace osmium {
+ 
+             // Maximum number of allowed pool threads (just to keep the user
+             // from setting something silly).
+-            constexpr const int max_pool_threads = 256;
++            constexpr const int max_pool_threads = 32;
+ 
+             inline int get_pool_size(int num_threads, int user_setting, unsigned hardware_concurrency) {
+                 if (num_threads == 0) {
+--- a/test/t/thread/test_pool.cpp
++++ b/test/t/thread/test_pool.cpp
+@@ -43,8 +43,8 @@ TEST_CASE("number of threads in pool") {
+     REQUIRE(osmium::thread::detail::get_pool_size( 0,  8, 16) ==  8);
+ 
+     // outliers
+-    REQUIRE(osmium::thread::detail::get_pool_size(-100, 0, 16) ==   1);
+-    REQUIRE(osmium::thread::detail::get_pool_size(1000, 0, 16) == 256);
++    REQUIRE(osmium::thread::detail::get_pool_size(-100, 0, 16) ==  1);
++    REQUIRE(osmium::thread::detail::get_pool_size(1000, 0, 16) == 32);
+ 
+ }
+ 
diff --git a/debian/patches/Use-Approx-to-compare-floating-point-values-in-tests.patch b/debian/patches/Use-Approx-to-compare-floating-point-values-in-tests.patch
new file mode 100644
index 0000000..c980ef9
--- /dev/null
+++ b/debian/patches/Use-Approx-to-compare-floating-point-values-in-tests.patch
@@ -0,0 +1,49 @@
+Description: Use Approx() to compare floating point values in tests.
+Author: Jochen Topf <jochen at topf.org>
+Origin: https://github.com/osmcode/libosmium/commit/2bb33036204da860b1acd52951c91b708ebfce1c
+
+--- a/test/t/osm/test_location.cpp
++++ b/test/t/osm/test_location.cpp
+@@ -25,32 +25,32 @@ TEST_CASE("Location instantiation with d
+     REQUIRE_FALSE(loc1.is_undefined());
+     REQUIRE(12000000 == loc1.x());
+     REQUIRE(45000000 == loc1.y());
+-    REQUIRE(1.2 == loc1.lon());
+-    REQUIRE(4.5 == loc1.lat());
++    REQUIRE(1.2 == Approx(loc1.lon()));
++    REQUIRE(4.5 == Approx(loc1.lat()));
+ 
+     const osmium::Location loc2{loc1};
+-    REQUIRE(4.5 == loc2.lat());
++    REQUIRE(4.5 == Approx(loc2.lat()));
+ 
+     const osmium::Location loc3 = loc1;
+-    REQUIRE(4.5 == loc3.lat());
++    REQUIRE(4.5 == Approx(loc3.lat()));
+ }
+ 
+ TEST_CASE("Location instantiation with double parameters constructor with universal initializer") {
+     const osmium::Location loc{2.2, 3.3};
+-    REQUIRE(2.2 == loc.lon());
+-    REQUIRE(3.3 == loc.lat());
++    REQUIRE(2.2 == Approx(loc.lon()));
++    REQUIRE(3.3 == Approx(loc.lat()));
+ }
+ 
+ TEST_CASE("Location instantiation with double parameters constructor with initializer list") {
+     const osmium::Location loc({4.4, 5.5});
+-    REQUIRE(4.4 == loc.lon());
+-    REQUIRE(5.5 == loc.lat());
++    REQUIRE(4.4 == Approx(loc.lon()));
++    REQUIRE(5.5 == Approx(loc.lat()));
+ }
+ 
+ TEST_CASE("Location instantiation with double parameters operator equal") {
+     const osmium::Location loc = {5.5, 6.6};
+-    REQUIRE(5.5 == loc.lon());
+-    REQUIRE(6.6 == loc.lat());
++    REQUIRE(5.5 == Approx(loc.lon()));
++    REQUIRE(6.6 == Approx(loc.lat()));
+ }
+ 
+ TEST_CASE("Location equality") {
diff --git a/debian/patches/series b/debian/patches/series
index 3b49a2a..d19e3b1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 0001-Fix-broken-test-on-32-bit-platforms.patch
+Reduce-the-max-number-of-threads-allowed-for-the-Pool-to-32.patch
+Use-Approx-to-compare-floating-point-values-in-tests.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/libosmium.git



More information about the Pkg-grass-devel mailing list