From 92f6b1361939c4e0881768a93dc4358b26372379 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Wed, 22 Jan 2025 13:01:13 +0100 Subject: [PATCH] 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") {