diff --git a/include/highfive/bits/H5Node_traits.hpp b/include/highfive/bits/H5Node_traits.hpp index f585ae6c6..d53d3f048 100644 --- a/include/highfive/bits/H5Node_traits.hpp +++ b/include/highfive/bits/H5Node_traits.hpp @@ -129,6 +129,10 @@ class NodeTraits { /// \return the group object Group getGroup(const std::string& group_name) const; + /// + /// \brief open a commited datatype with the name type_name + /// \param type_name + /// \return the datatype object DataType getDataType( const std::string& type_name, const DataTypeAccessProps& accessProps = DataTypeAccessProps::Default()) const; diff --git a/tests/unit/tests_high_five_base.cpp b/tests/unit/tests_high_five_base.cpp index 047beb706..6b4c8fb0c 100644 --- a/tests/unit/tests_high_five_base.cpp +++ b/tests/unit/tests_high_five_base.cpp @@ -2870,16 +2870,22 @@ TEST_CASE("HighFiveEnum") { TEST_CASE("HighFiveReadType") { const std::string file_name("readtype_test.h5"); const std::string datatype_name1("my_type"); + const std::string datatype_name2("position"); File file(file_name, File::ReadWrite | File::Create | File::Truncate); - auto t3 = AtomicType(); CompoundType t1 = create_compound_csl1(); t1.commit(file, datatype_name1); CompoundType t2 = file.getDataType(datatype_name1); + auto t3 = create_enum_position(); + t3.commit(file, datatype_name2); + + DataType t4 = file.getDataType(datatype_name2); + CHECK(t2 == t1); + CHECK(t4 == t3); } TEST_CASE("HighFiveFixedString") {