summaryrefslogtreecommitdiffstats
path: root/c++/test/ttypes.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-01-03 13:53:54 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-01-03 13:53:54 (GMT)
commit565aa10d8dcef5fc52aa14b2b16e4fc5e00b711f (patch)
treec9acf1fa5f01dccfbd2d3fbc0a8e4fb1956b9645 /c++/test/ttypes.cpp
parentcd3bd5576f048ce1ca413921c76dcacf137d2110 (diff)
downloadhdf5-565aa10d8dcef5fc52aa14b2b16e4fc5e00b711f.zip
hdf5-565aa10d8dcef5fc52aa14b2b16e4fc5e00b711f.tar.gz
hdf5-565aa10d8dcef5fc52aa14b2b16e4fc5e00b711f.tar.bz2
Purpose: Add more tests
Description: Added more tests for the new constructors that replaced openXxxType() Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/test/ttypes.cpp')
-rw-r--r--c++/test/ttypes.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index 1ef7bdd..6605c03 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -257,28 +257,35 @@ static void test_query()
tid2.close();
// Open the datatypes for query
+
+ // Deprecated functions
tid1 = file.openCompType(CompT_NAME);
+ tid1.close();
tid2 = file.openEnumType(EnumT_NAME);
+ tid2.close();
+
+ CompType comptype(file, CompT_NAME);
+ EnumType enumtype(file, EnumT_NAME);
// Query member number and member index by name, for compound type
- nmembs = tid1.getNmembers();
+ nmembs = comptype.getNmembers();
verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__);
- index = tid1.getMemberIndex("c");
+ index = comptype.getMemberIndex("c");
verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__);
// Query member number and member index by name, for enumeration type
- nmembs = tid2.getNmembers();
+ nmembs = enumtype.getNmembers();
verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__);
- index = tid2.getMemberIndex("ORANGE");
+ index = enumtype.getMemberIndex("ORANGE");
verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__);
// Close datatypes and file
- tid1.close();
- tid2.close();
+ comptype.close();
+ enumtype.close();
file.close();
// Try truncating the file to make sure reference counting is good.
- // If any references to ids of tid1 and tid2 are left unterminated,
+ // If any references to ids of the accessed types are left unterminated,
// the truncating will fail, because the file will not be closed in
// the file.close() above.
H5File file1(FILENAME[2], H5F_ACC_TRUNC);