From 2f4d64e1880e6bd5da2b0d4c3263f632756f1e95 Mon Sep 17 00:00:00 2001 From: Jonas Nilsson Date: Thu, 19 May 2022 15:57:52 +0200 Subject: [PATCH 1/2] array adapter unit test with potential fix. --- src/h5cpp/utilities/array_adapter.hpp | 6 ++---- test/utilities/array_adapter_test.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/h5cpp/utilities/array_adapter.hpp b/src/h5cpp/utilities/array_adapter.hpp index 12561578df..4c2d2b0983 100644 --- a/src/h5cpp/utilities/array_adapter.hpp +++ b/src/h5cpp/utilities/array_adapter.hpp @@ -235,10 +235,8 @@ class TypeTrait> return Simple(adapter_dimensions,adapter_dimensions); } - const static DataspaceType & get(const ArrayAdapter &adapter, dataspace::DataspacePool &) { - Dimensions adapter_dimensions = get_dimensions(adapter); - const static DataspaceType & cref_ = Simple(adapter_dimensions,adapter_dimensions); - return cref_; + const static DataspaceType & get(const ArrayAdapter &adapter, dataspace::DataspacePool &pool) { + return pool.getSimple(get_dimensions(adapter)); } static void* ptr(ArrayAdapter &adapter) diff --git a/test/utilities/array_adapter_test.cpp b/test/utilities/array_adapter_test.cpp index 2d49c5b88b..92db67a3ab 100644 --- a/test/utilities/array_adapter_test.cpp +++ b/test/utilities/array_adapter_test.cpp @@ -170,6 +170,15 @@ SCENARIO("writing and reading data using an ArrayAdapter") { } } } + THEN("we do multiple writes to the dataset") { + size_t b_size_2 = 3; + double w_buffer_2[] = {3.14, 1.2345, 5.4321}; + auto another_dataset = node::Dataset(root, "data2", datatype::create(), dataspace::Simple(Dimensions{b_size_2 + 1})); + auto write_adapter1 = ArrayAdapter(w_buffer_2, 1); + auto write_adapter2 = ArrayAdapter(w_buffer_2, b_size_2); + dataset.write(write_adapter1, hdf5::dataspace::Hyperslab{{0}, {1}}); + dataset.write(write_adapter2, hdf5::dataspace::Hyperslab{{1}, {b_size_2}}); + } } GIVEN("an attribute in the file") { auto attribute = root.attributes.create("data", type, space); From dc0a0759e6d3b6baf34b9f018fb82f235f2d5826 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 23 May 2022 11:27:30 +0200 Subject: [PATCH 2/2] fix conan github tests --- .github/workflows/cmake-build.yml | 8 ++------ conanfile.py | 5 +---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index f3000d3671..08be5775e6 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -89,9 +89,7 @@ jobs: strategy: matrix: shared: ["shared", "static"] - boost: [ - # "boost", - "stdfs"] + boost: ["boost", "stdfs"] runs-on: windows-2019 steps: - uses: actions/checkout@v2 @@ -141,9 +139,7 @@ jobs: strategy: matrix: shared: ["shared", "static"] - boost: [ - # "boost", - "stdfs"] + boost: ["boost", "stdfs"] mpi: ["serial", "mpi"] runs-on: macos-10.15 steps: diff --git a/conanfile.py b/conanfile.py index b25ebeaba1..5a3f6de1ca 100644 --- a/conanfile.py +++ b/conanfile.py @@ -26,9 +26,6 @@ def build_requirements(self): def config_options(self): if self.settings.os == "Windows": del self.options.with_mpi - del self.options.with_boost - if self.settings.os == "Macos": - del self.options.with_boost def configure(self): if self.options.get_safe("with_mpi", False): @@ -42,7 +39,7 @@ def requirements(self): elif self.settings.os == "Macos": self.requires("boost/1.77.0") else: - self.requires("boost/1.77.0@#35c2c19753eaadacfb846c7198919da7") + self.requires("boost/1.77.0") if self.options.get_safe("with_mpi", False): self.requires("openmpi/4.1.0")