Skip to content

Commit 8f8a962

Browse files
authored
Issue 650: add Custom to DriverID enum (#665)
* add Custom to DriverID enum * add tests * remove DLL_EXPORT
1 parent 481be76 commit 8f8a962

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/h5cpp/file/driver.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ namespace file
4848
//!
4949
enum class DriverID : unsigned
5050
{
51+
Custom = 0,
5152
Posix = 1,
5253
Direct = 2,
5354
Memory = 3,

test/file/driver_test.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@
3434

3535
using namespace hdf5;
3636

37+
38+
class MyPosixDriver : public hdf5::file::PosixDriver
39+
{
40+
public:
41+
MyPosixDriver() {}
42+
43+
virtual hdf5::file::DriverID id() const noexcept override{
44+
return hdf5::file::DriverID::Custom;
45+
}
46+
};
47+
48+
3749
SCENARIO("Construction of a memory driver instance", "[file,h5cpp,driver]") {
3850
GIVEN("a default constructed instance") {
3951
file::MemoryDriver m;
@@ -99,6 +111,11 @@ SECTION("the posix driver") {
99111
REQUIRE(m.id() == file::DriverID::Posix);
100112
}
101113

114+
SECTION("the custom driver") {
115+
MyPosixDriver m;
116+
REQUIRE(m.id() == file::DriverID::Custom);
117+
}
118+
102119
#ifdef H5CPP_WITH_MPI
103120

104121
SECTION("the MPI driver") {

0 commit comments

Comments
 (0)