summaryrefslogtreecommitdiffstats
path: root/c++/test/ttypes.cpp
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-02-06 03:24:42 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-02-06 03:24:42 (GMT)
commitff845ed8b156097fd8574be4809f11dbc684e042 (patch)
treef564359ab09ae660be620733d4144f6b78ac7ce5 /c++/test/ttypes.cpp
parent299ac26d98a27cb309c87eafeb0ff7ac53eeb94b (diff)
downloadhdf5-ff845ed8b156097fd8574be4809f11dbc684e042.zip
hdf5-ff845ed8b156097fd8574be4809f11dbc684e042.tar.gz
hdf5-ff845ed8b156097fd8574be4809f11dbc684e042.tar.bz2
[svn-r20052] Description:
Clean up Coverity warnings, and fix some style issues: r19735: Fix for memory leak in test/mf found by valgrind. r19736: Fix memory leak in h5repack. The buffer in copy_objects, when copying the entire dataset at once, was not checked for the presence of a vlen, and vlen storage was never reclaimed. Added check and call to H5D_vlen_reclaim(). r19772: Change H5assert() to if (H5T_VLEN != src->shared->type || H5T_VLEN != dst->shared->type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype") r19774: removed unused priv. r19775: removed unused variables r19778: Fix memory leak comparing for variable length data types. r19834: Fixed memory leaks found by valgrind. Memory errors remain for another day. Tested on: Mac OS X/32 10.6.6 (amazon) w/debug & production (h5committested on branch)
Diffstat (limited to 'c++/test/ttypes.cpp')
-rw-r--r--c++/test/ttypes.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index ef00c08..b1baa29 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -387,6 +387,7 @@ static void test_named ()
static hsize_t ds_size[2] = {10, 20};
hsize_t i;
unsigned attr_data[10][20];
+ DataType *ds_type = NULL;
SUBTEST("Named datatypes");
try {
@@ -462,12 +463,13 @@ now.
// 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);
- DataType *ds_type = new DataType(dset.getDataType());
+ ds_type = new DataType(dset.getDataType());
iscommitted = ds_type->committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "1 Dataset type should be named type!");
dset.close();
ds_type->close();
+ delete ds_type;
// Reopen the dataset and its type, then make sure the type is
// a named type.
@@ -483,6 +485,7 @@ now.
dset = file.createDataSet("dset2", *ds_type, space);
ds_type->close();
dset.close();
+ delete ds_type;
// Reopen the second dataset and make sure the type is shared
dset = file.openDataSet("dset2");
@@ -509,6 +512,9 @@ now.
catch (Exception E) {
issue_fail_msg("test_named", __LINE__, __FILE__, E.getCDetailMsg());
}
+
+ if(ds_type)
+ delete ds_type;
} // test_named