Skip to content
Snippets Groups Projects
Commit 464cda65 authored by Sascha Brawer's avatar Sascha Brawer Committed by alice
Browse files

testing/libosmium: new aport

parent 8239f89e
No related branches found
No related tags found
2 merge requests!39304[3.16] main/expat: security upgrade to 2.4.9,!37391testing/libosmium: new aport
Pipeline #131741 passed
# Contributor: Sascha Brawer <sascha@brawer.ch>
# Maintainer: Sascha Brawer <sascha@brawer.ch>
pkgname=libosmium
pkgver=2.18.0
pkgrel=0
pkgdesc="Fast and flexible C++ library for working with OpenStreetMap data"
url="https://github.com/osmcode/libosmium"
arch="noarch"
license="BSL-1.0"
checkdepends="boost-dev bzip2-dev gdal-dev geos-dev expat-dev lz4-dev protozero-dev zlib-dev"
makedepends="cmake samurai"
subpackages="$pkgname-dev"
source="libosmium-$pkgver.tar.gz::https://github.com/osmcode/libosmium/archive/refs/tags/v$pkgver.tar.gz
fix-bzip2-test.patch"
build() {
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_TESTING="$(want_check && echo ON || echo OFF)"
cmake --build build
}
check() {
ctest -output-on-failure --test-dir build
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
bfe4d5b08e284abb21280205437c62d260948c8585cc8d10f0c3496fd29df1ff6c6bc436283207f292d6a8af911835ebef64403c3fde2a262b55fde5296c13ce libosmium-2.18.0.tar.gz
844f523403a94f1e3acad9a923686b989b6490e55b1698038695a4eaf55cdf1d48f3e6870977c7b687b3a2000924d6154d84a210c1ead45c5beac84552134e2e fix-bzip2-test.patch
"
Make bzip2 unit tests pass on musl-based systems
https://github.com/osmcode/libosmium/issues/353
https://github.com/osmcode/libosmium/commit/dcb34b53e34d449edb5578f070a3da9975d7534b
Committed to upstream main branch, but not yet in any release.
In future releases after libosmum 2.18.0, this patch can be removed.
--- libosmium-2.18.0/test/t/io/test_bzip2.cpp.orig
+++ libosmium-2.18.0/test/t/io/test_bzip2.cpp
@@ -7,13 +7,19 @@
#include <string>
+static void read_from_decompressor(int fd) {
+ osmium::io::Bzip2Decompressor decomp{fd};
+ decomp.read();
+ decomp.close();
+}
+
TEST_CASE("Invalid file descriptor of bzip2-compressed file") {
- REQUIRE_THROWS_AS(osmium::io::Bzip2Decompressor{-1}, std::system_error);
+ REQUIRE_THROWS(read_from_decompressor(-1));
}
TEST_CASE("Non-open file descriptor of bzip2-compressed file") {
// 12345 is just a random file descriptor that should not be open
- REQUIRE_THROWS_AS(osmium::io::Bzip2Decompressor{12345}, std::system_error);
+ REQUIRE_THROWS(read_from_decompressor(12345));
}
TEST_CASE("Empty bzip2-compressed file") {
@@ -93,13 +99,19 @@
REQUIRE(count == count_fds());
}
+static void write_to_compressor(int fd) {
+ osmium::io::Bzip2Compressor comp{fd, osmium::io::fsync::yes};
+ comp.write("foo");
+ comp.close();
+}
+
TEST_CASE("Compressor: Invalid file descriptor for bzip2-compressed file") {
- REQUIRE_THROWS_AS(osmium::io::Bzip2Compressor(-1, osmium::io::fsync::yes), std::system_error);
+ REQUIRE_THROWS(write_to_compressor(-1));
}
TEST_CASE("Compressor: Non-open file descriptor for bzip2-compressed file") {
// 12345 is just a random file descriptor that should not be open
- REQUIRE_THROWS_AS(osmium::io::Bzip2Compressor(12345, osmium::io::fsync::yes), std::system_error);
+ REQUIRE_THROWS(write_to_compressor(12345));
}
TEST_CASE("Write bzip2-compressed file with explicit close") {
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment