From 63cdf8874b18a8bc2663dc76bdfcfac14a65b6e0 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Mon, 20 Jan 2025 13:54:43 +0100 Subject: [PATCH 1/3] add Custom to DriverID enum --- src/h5cpp/file/driver.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/h5cpp/file/driver.hpp b/src/h5cpp/file/driver.hpp index 4bf0624921..828f2b0a63 100644 --- a/src/h5cpp/file/driver.hpp +++ b/src/h5cpp/file/driver.hpp @@ -48,6 +48,7 @@ namespace file //! enum class DriverID : unsigned { + Custom = 0, Posix = 1, Direct = 2, Memory = 3, From 92f6b1361939c4e0881768a93dc4358b26372379 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Wed, 22 Jan 2025 13:01:13 +0100 Subject: [PATCH 2/3] add tests --- test/file/driver_test.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/file/driver_test.cpp b/test/file/driver_test.cpp index f07b4f9370..cf888e83b1 100644 --- a/test/file/driver_test.cpp +++ b/test/file/driver_test.cpp @@ -34,6 +34,18 @@ using namespace hdf5; + +class DLL_EXPORT MyPosixDriver : public hdf5::file::PosixDriver +{ + public: + MyPosixDriver() {} + + virtual hdf5::file::DriverID id() const noexcept override{ + return hdf5::file::DriverID::Custom; + } +}; + + SCENARIO("Construction of a memory driver instance", "[file,h5cpp,driver]") { GIVEN("a default constructed instance") { file::MemoryDriver m; @@ -99,6 +111,11 @@ SECTION("the posix driver") { REQUIRE(m.id() == file::DriverID::Posix); } + SECTION("the custom driver") { + MyPosixDriver m; + REQUIRE(m.id() == file::DriverID::Custom); +} + #ifdef H5CPP_WITH_MPI SECTION("the MPI driver") { From 215ee8078f8b67efb5b3da769a88242bf8782979 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Wed, 22 Jan 2025 14:10:40 +0100 Subject: [PATCH 3/3] remove DLL_EXPORT --- test/file/driver_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/file/driver_test.cpp b/test/file/driver_test.cpp index cf888e83b1..1299ceb286 100644 --- a/test/file/driver_test.cpp +++ b/test/file/driver_test.cpp @@ -35,7 +35,7 @@ using namespace hdf5; -class DLL_EXPORT MyPosixDriver : public hdf5::file::PosixDriver +class MyPosixDriver : public hdf5::file::PosixDriver { public: MyPosixDriver() {}