summaryrefslogtreecommitdiffstats
path: root/c++/test/tattr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/test/tattr.cpp')
-rw-r--r--c++/test/tattr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index c6225229..ca0516a 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -1061,6 +1061,12 @@ static void test_attr_dtype_shared()
// Create dataspace for dataset
DataSpace dspace;
+ // Enclose the following so that all temporary objects can be
+ // destroyed before testing reference count - this is to overcome
+ // the different time when the temporary objects are to be destroyed
+ // by different compilers.
+ {
+
// Create dataset
DataSet dset = fid1.createDataSet(DSET1_NAME, dtype, dspace);
@@ -1126,6 +1132,8 @@ static void test_attr_dtype_shared()
// Unlink the dataset
fid1.unlink(DSET1_NAME);
+ } // end of enclosing to test reference counts
+
// Check reference count on named datatype
fid1.getObjinfo(TYPE1_NAME, statbuf);
verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__);