[libosmium] 01/02: Add upstream patch to fix broken test on 32 bit platforms. (closes: #872292)

Bas Couwenberg sebastic at debian.org
Wed Aug 16 17:58:06 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 1cd04d858c91d32a03b49af45b3a981b2720b465
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Aug 16 19:34:34 2017 +0200

    Add upstream patch to fix broken test on 32 bit platforms. (closes: #872292)
---
 debian/changelog                                   |  7 +++++
 .../0001-Fix-broken-test-on-32-bit-platforms.patch | 31 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 39 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 754f31d..83bcf22 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libosmium (2.13.0-2) UNRELEASED; urgency=medium
+
+  * Add upstream patch to fix broken test on 32 bit platforms.
+    (closes: #872292)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 16 Aug 2017 19:34:09 +0200
+
 libosmium (2.13.0-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/0001-Fix-broken-test-on-32-bit-platforms.patch b/debian/patches/0001-Fix-broken-test-on-32-bit-platforms.patch
new file mode 100644
index 0000000..db0812b
--- /dev/null
+++ b/debian/patches/0001-Fix-broken-test-on-32-bit-platforms.patch
@@ -0,0 +1,31 @@
+Description: Fix broken test on 32 bit platforms.
+Author: Jochen Topf <jochen at topf.org>
+Origin: https://github.com/osmcode/libosmium/commit/07cf3c70eb4ad8255cc9f44e4f0368a3ab95240a
+Bug: https://github.com/osmcode/libosmium/issues/222
+Bug-Debian: https://bugs.debian.org/872292
+
+--- a/test/t/memory/test_item.cpp
++++ b/test/t/memory/test_item.cpp
+@@ -14,12 +14,16 @@ TEST_CASE("padded length") {
+     REQUIRE(osmium::memory::padded_length(2147483648) == 2147483648);
+     REQUIRE(osmium::memory::padded_length(2147483650) == 2147483656);
+ 
+-    REQUIRE(osmium::memory::padded_length(4294967295) == 4294967296);
+-    REQUIRE(osmium::memory::padded_length(4294967296) == 4294967296);
+-    REQUIRE(osmium::memory::padded_length(4294967297) == 4294967304);
++    // The following checks only make sense on a 64 bit system (with
++    // sizeof(size_t) == 8), because the numbers are too large for 32 bit.
++    // The casts to size_t do nothing on a 64 bit system, on a 32 bit system
++    // they bring the numbers into the right range and everything still works.
++    REQUIRE(osmium::memory::padded_length(static_cast<std::size_t>(4294967295)) == static_cast<std::size_t>(4294967296));
++    REQUIRE(osmium::memory::padded_length(static_cast<std::size_t>(4294967296)) == static_cast<std::size_t>(4294967296));
++    REQUIRE(osmium::memory::padded_length(static_cast<std::size_t>(4294967297)) == static_cast<std::size_t>(4294967304));
+ 
+-    REQUIRE(osmium::memory::padded_length(7999999999) == 8000000000);
+-    REQUIRE(osmium::memory::padded_length(8000000000) == 8000000000);
+-    REQUIRE(osmium::memory::padded_length(8000000001) == 8000000008);
++    REQUIRE(osmium::memory::padded_length(static_cast<std::size_t>(7999999999)) == static_cast<std::size_t>(8000000000));
++    REQUIRE(osmium::memory::padded_length(static_cast<std::size_t>(8000000000)) == static_cast<std::size_t>(8000000000));
++    REQUIRE(osmium::memory::padded_length(static_cast<std::size_t>(8000000001)) == static_cast<std::size_t>(8000000008));
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..3b49a2a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Fix-broken-test-on-32-bit-platforms.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