summaryrefslogtreecommitdiffstats
path: root/test/tmisc.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-01-01 06:28:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-01-01 06:28:04 (GMT)
commitf60170dac7c491cc75120a6ebdfe73c13c0bab1d (patch)
tree6adfe7a8ccaa4c7cf6a0ae8aa2b4e7deb0518521 /test/tmisc.c
parent8d8d56d7d1601a88b90524c7bcb78c2515ce770f (diff)
downloadhdf5-f60170dac7c491cc75120a6ebdfe73c13c0bab1d.zip
hdf5-f60170dac7c491cc75120a6ebdfe73c13c0bab1d.tar.gz
hdf5-f60170dac7c491cc75120a6ebdfe73c13c0bab1d.tar.bz2
[svn-r28761] Description:
Clean up many mismatches between malloc/free and H5MM_malloc/H5MM_xfree in the library and tests (and use of H5free_memory and H5Dvlen_reclaim). Also make H5Ocopy use a private version of H5Lexists, which doesn't internally throw (and suppress) errors when an object (or the path to it) isn't found in the destination. Tested on: MacOSX/64 10.11.2 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'test/tmisc.c')
-rw-r--r--test/tmisc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/tmisc.c b/test/tmisc.c
index 1298f6b..011486a 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -462,7 +462,8 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att1, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- HDfree(data_check.string);
+ ret = H5Dvlen_reclaim(type, dataspace, H5P_DEFAULT, &data_check);
+ CHECK(ret, FAIL, "H5Dvlen_reclaim");
ret = H5Aclose(att1);
CHECK(ret, FAIL, "HAclose");
@@ -487,7 +488,8 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att2, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- HDfree(data_check.string);
+ ret = H5Dvlen_reclaim(type, dataspace, H5P_DEFAULT, &data_check);
+ CHECK(ret, FAIL, "H5Dvlen_reclaim");
ret = H5Aclose(att2);
CHECK(ret, FAIL, "HAclose");
@@ -514,6 +516,7 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name
{
hid_t file, root, att;
hid_t type;
+ hid_t space;
herr_t ret;
misc2_struct data_check;
@@ -528,10 +531,17 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name
att = H5Aopen(root, att_name, H5P_DEFAULT);
CHECK(att, FAIL, "H5Aopen");
+ space = H5Aget_space(att);
+ CHECK(space, FAIL, "H5Aget_space");
+
ret = H5Aread(att, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- HDfree(data_check.string);
+ ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &data_check);
+ CHECK(ret, FAIL, "H5Dvlen_reclaim");
+
+ ret = H5Sclose(space);
+ CHECK(ret, FAIL, "H5Sclose");
ret = H5Aclose(att);
CHECK(ret, FAIL, "H5Aclose");