diff options
Diffstat (limited to 'c++/test/tarray.cpp')
-rw-r--r-- | c++/test/tarray.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index c07ba42..218e4e5 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -22,19 +22,17 @@ #else #include <iostream> #endif -#include <string> - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include <string> #include "H5Cpp.h" // C++ API header file using namespace H5; #include "h5cpputil.h" // C++ utilility header file const H5std_string FILENAME("tarray.h5"); +const H5std_string ARRAYTYPE_NAME("/Array type 1"); const int SPACE1_RANK = 1; const hsize_t SPACE1_DIM1 = 4; const int ARRAY1_RANK = 1; @@ -60,8 +58,6 @@ typedef enum int_t { * Programmer: Binh-Minh Ribler (using C version) * January, 2016 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_compound_array() @@ -131,9 +127,22 @@ static void test_array_compound_array() // Write dataset to disk dataset.write(wdata, arrtype); + // Test opening ArrayType with opening constructor (Dec 2016) + + // Commit the arrtype to give it a name + arrtype.commit(file1, ARRAYTYPE_NAME); + + // Close it, then re-open with the opening constructor + arrtype.close(); + ArrayType named_type(file1, ARRAYTYPE_NAME); + + // Get and verify the type's name + H5std_string type_name = named_type.getObjName(); + verify_val(type_name, ARRAYTYPE_NAME, "DataType::getObjName tests constructor", __LINE__, __FILE__); + named_type.close(); + // Close all dataset.close(); - arrtype.close(); space.close(); file1.close(); @@ -282,8 +291,6 @@ static void test_array_compound_array() * Description: * Used user's sample code in HDFFV-9562 * - * Modifications: - * *------------------------------------------------------------------------- */ /* @@ -353,8 +360,6 @@ static void test_array_assignment() * Programmer: Binh-Minh Ribler * April, 2016 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_info() @@ -499,8 +504,6 @@ void test_array() * Programmer: Binh-Minh Ribler (using C version) * January, 2016 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" |