summaryrefslogtreecommitdiffstats
path: root/c++/test/ttypes.cpp
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-05-07 21:05:14 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-05-07 21:05:14 (GMT)
commit984ecb72c2fa62d233383b24047e04061754ae34 (patch)
treea0a1ce905153a08466dae1354e14d426c86b3849 /c++/test/ttypes.cpp
parented599421c5ef01347368d50b1b7dbed3b323c43f (diff)
parent8f82c9b8be875cd28e18402e920f8e162d8f8d38 (diff)
downloadhdf5-984ecb72c2fa62d233383b24047e04061754ae34.zip
hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.gz
hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.bz2
[svn-r27038] Merge of r26393-27031 from the trunk.
Tested on 64-bit linux VM w/ C++ and Fortran 2003
Diffstat (limited to 'c++/test/ttypes.cpp')
-rw-r--r--c++/test/ttypes.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index e9e1427..2e64051 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -109,7 +109,7 @@ static void test_classes()
{
SUBTEST("PredType::getClass()");
try {
- int curr_nerrors = GetTestNumErrs();
+ // maybe later, int curr_nerrors = GetTestNumErrs();
// PredType::NATIVE_INT should be in H5T_INTEGER class
H5T_class_t tcls = PredType::NATIVE_INT.getClass();
@@ -283,10 +283,16 @@ static void test_query()
tid2.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,
+ // the truncating will fail, because the file will not be closed in
+ // the file.close() above.
+ H5File file1(FILENAME[2], H5F_ACC_TRUNC);
+
PASSED();
} // end of try block
catch (Exception E) {
- issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg());
+ issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_query
@@ -467,27 +473,20 @@ static void test_named ()
trans_type.setPrecision(256);
trans_type.close();
- /*
- * Close the committed type and reopen it. It should return a named type.
-* This had something to do with the way IntType was returned and assigned
-and caused itype.committed not working correctly. So, use another_type for
-now.
+ // Close the committed type and reopen it. It should be a named type.
itype.close();
itype = file.openIntType("native-int");
iscommitted = itype.committed();
-*/
- IntType another_type = file.openIntType("native-int");
- iscommitted = another_type.committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "Opened named types should be named types!");
// Create a dataset that uses the named type, then get the dataset's
// datatype and make sure it's a named type.
- DataSet dset = file.createDataSet("dset1", another_type, space);
+ DataSet dset = file.createDataSet("dset1", itype, space);
ds_type = new DataType(dset.getDataType());
iscommitted = ds_type->committed();
if (!iscommitted)
- throw InvalidActionException("IntType::committed()", "1 Dataset type should be named type!");
+ throw InvalidActionException("IntType::committed()", "Dataset type should be named type!");
dset.close();
ds_type->close();
delete ds_type;