summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2013-03-13 22:34:23 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2013-03-13 22:34:23 (GMT)
commit08359be858ae9e4595dab1f4a7718017d9af7663 (patch)
treebbe033fd134cfda5943dff96ef2a7f5f10d743e9 /test
parent55822485c64197a6c2c4a623824fcdcd10a57d31 (diff)
downloadhdf5-08359be858ae9e4595dab1f4a7718017d9af7663.zip
hdf5-08359be858ae9e4595dab1f4a7718017d9af7663.tar.gz
hdf5-08359be858ae9e4595dab1f4a7718017d9af7663.tar.bz2
[svn-r23347] ported revision 23248:23346 from the trunk
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt20
-rw-r--r--test/Makefile.in2
-rw-r--r--test/testframe.c4
-rw-r--r--test/testhdf5.h2
-rw-r--r--test/testlibinfo.sh.in5
-rw-r--r--test/tfile.c11
-rw-r--r--test/th5o.c4
-rw-r--r--test/th5s.c11
-rw-r--r--test/tsohm.c14
9 files changed, 59 insertions, 14 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index aa92371..6af1e94 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -223,8 +223,24 @@ ADD_TEST (
tsohm_dst.h5
tsohm_src.h5
)
-ADD_TEST (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>)
-SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
+
+IF (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select)
+ SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
+ SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600)
+ ADD_TEST (NAME testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap)
+ SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
+ SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600)
+ ADD_TEST (NAME testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file)
+ SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
+ SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600)
+ ADD_TEST (NAME testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select)
+ SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
+ SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600)
+ELSE (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>)
+ SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects)
+ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
##############################################################################
##############################################################################
diff --git a/test/Makefile.in b/test/Makefile.in
index 458ede6..81681ef 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -598,6 +598,7 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
+HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
HDF_CXX = @HDF_CXX@
@@ -649,7 +650,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
-PTHREAD = @PTHREAD@
RANLIB = @RANLIB@
ROOT = @ROOT@
RUNPARALLEL = @RUNPARALLEL@
diff --git a/test/testframe.c b/test/testframe.c
index 5835b73..8ab7a5b 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -155,8 +155,8 @@ void TestUsage(void)
print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n",
TestProgName, (TestPrivateUsage ? "<extra options>" : ""));
- print_func(" [-[e]x[clude] name+] \n");
- print_func(" [-o[nly] name+] \n");
+ print_func(" [-[e]x[clude] name]+ \n");
+ print_func(" [-o[nly] name]+ \n");
print_func(" [-b[egin] name] \n");
print_func(" [-s[ummary]] \n");
print_func(" [-c[leanoff]] \n");
diff --git a/test/testhdf5.h b/test/testhdf5.h
index c92c0f0..907fce9 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -142,7 +142,7 @@
if(VERBOSE_HI) \
print_func(" Call to routine: %15s at line %4d in %s returned " \
"invalid result\n", where, (int)__LINE__, __FILE__); \
- TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n" \
+ TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \
where, (int)__LINE__, __FILE__); \
} while(0)
diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in
index fba1794..b7aa6c4 100644
--- a/test/testlibinfo.sh.in
+++ b/test/testlibinfo.sh.in
@@ -53,7 +53,10 @@ SKIP() {
# Function definitions
CHECK_LIBINFO(){
LINEMSG $1
- if strings $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then
+ # Some systems, like Mac, the strings command inspects library files. Older
+ # versions of strings may not know newer library format, resulting in
+ # command errors. Make it read the file as stdin to avoid the problem.
+ if strings < $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then
echo " PASSED"
else
echo " FAILED"
diff --git a/test/tfile.c b/test/tfile.c
index 8ee0b64..e669bd0 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -526,6 +526,9 @@ test_file_open(void)
/* Close dataset from first open */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Pclose(fapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
} /* test_file_open() */
/****************************************************************
@@ -1060,6 +1063,9 @@ test_get_file_id(void)
VERIFY(fid2, FAIL, "H5Iget_file_id");
/* Close objects */
+ ret = H5Pclose(plist);
+ CHECK(ret, FAIL, "H5Pclose");
+
ret = H5Tclose(datatype_id);
CHECK(ret, FAIL, "H5Tclose");
@@ -2855,7 +2861,7 @@ test_filespace_sects(void)
test_free_sections(fapl_stdio, filename);
/* close fapl and remove the file */
- h5_cleanup(FILENAME, fapl_split);
+ h5_cleanup(FILENAME, fapl_stdio);
/* CORE */
MESSAGE(5, ("Testing File free space information for a core file\n"));
@@ -3223,6 +3229,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
+
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
} /* end test_libver_bounds_real() */
/****************************************************************
diff --git a/test/th5o.c b/test/th5o.c
index c46751e..a470f4c 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -111,6 +111,8 @@ test_h5o_open(void)
CHECK(dspace, FAIL, "H5Dget_space");
/* Close the IDs */
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
ret = H5Gclose(grp);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Tclose(dtype);
@@ -324,6 +326,8 @@ test_h5o_open_by_addr(void)
CHECK(dspace, FAIL, "H5Dget_space");
/* Close the IDs */
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
ret = H5Gclose(grp);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Tclose(dtype);
diff --git a/test/th5s.c b/test/th5s.c
index a026545..ebbaa37 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -182,14 +182,13 @@ test_h5s_basic(void)
fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK_I(fid1, "H5Fopen");
if (fid1 >= 0){
- dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT);
- VERIFY(dset1, FAIL, "H5Dopen2");
- ret = H5Fclose(fid1);
- CHECK_I(ret, "H5Fclose");
+ dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT);
+ VERIFY(dset1, FAIL, "H5Dopen2");
+ ret = H5Fclose(fid1);
+ CHECK_I(ret, "H5Fclose");
}
else
- printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n",
- testfile);
+ printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile);
}
/* Verify that incorrect dimensions don't work */
diff --git a/test/tsohm.c b/test/tsohm.c
index fddb552..eb5f7c5 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -1280,6 +1280,9 @@ static void size2_verify_plist1(hid_t plist)
ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
VERIFY(ret, 0, memcmp);
+
+ ret = H5Tclose(dtype1_id);
+ CHECK_I(ret, "H5Tclose");
}
/*-------------------------------------------------------------------------
@@ -1348,6 +1351,9 @@ static void size2_verify_plist2(hid_t plist)
ret = HDmemcmp(&fill2, &fill2_correct, (size_t)DTYPE2_SIZE);
VERIFY(ret, 0, memcmp);
+
+ ret = H5Tclose(dtype2_id);
+ CHECK_I(ret, "H5Tclose");
}
#ifdef NOT_NOW
@@ -3138,6 +3144,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id)
/* Close the dataset and both files to make sure everything gets flushed
* out of memory
*/
+ ret = H5Sclose(space_id);
+ CHECK_I(ret, "H5Sclose");
ret = H5Dclose(dset_id);
CHECK_I(ret, "H5Dclose");
ret = H5Fclose(src_file_id);
@@ -3195,6 +3203,9 @@ test_sohm_extlink(void)
test_sohm_extlink_helper(fcpl_id, H5P_DEFAULT);
test_sohm_extlink_helper(H5P_DEFAULT, fcpl_id);
test_sohm_extlink_helper(fcpl_id, fcpl_id);
+
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
}
@@ -3782,6 +3793,9 @@ test_sohm_extend_dset(void)
CHECK_I(ret, "test_sohm_extend_dset_helper");
ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
CHECK_I(ret, "test_sohm_extend_dset_helper");
+
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
}