mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
Merge pull request #435 in HDFFV/hdf5 from ~VCHOI/my_hdf5_fork:develop to develop
* commit '43e03c548ae2c405b92f95833251683d3eeb1440': Modifications based on review comments from pull request. Made changes according to review comments and discussion with Allen. Fix for DAILYTEST-259 h5clear test failure Deposit the test files in test/misc/testfiles for testh5clear.sh to use instead of depending on h5clear_gentest. Tested on kituo, osx1010test, quail, platypus and ostrich.
This commit is contained in:
commit
784e3599a7
10
MANIFEST
10
MANIFEST
@ -1471,10 +1471,14 @@
|
||||
./tools/test/misc/testfiles/h5clear_no_mdc_image.ddl
|
||||
./tools/test/misc/testfiles/h5clear_open_fail.ddl
|
||||
./tools/test/misc/testfiles/h5clear_usage.ddl
|
||||
./tools/test/misc/testfiles/h5clear_log_v3.h5
|
||||
./tools/test/misc/testfiles/h5clear_mdc_image.h5
|
||||
./tools/test/misc/testfiles/h5clear_sec2_v0.h5
|
||||
./tools/test/misc/testfiles/h5clear_sec2_v2.h5
|
||||
./tools/test/misc/testfiles/h5clear_sec2_v3.h5
|
||||
./tools/test/misc/testfiles/latest_h5clear_log_v3.h5
|
||||
./tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5
|
||||
./tools/test/misc/testfiles/mod_h5clear_mdc_image.h5
|
||||
./tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5
|
||||
./tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5
|
||||
./tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5
|
||||
./tools/test/misc/testfiles/h5mkgrp_help.txt
|
||||
./tools/test/misc/testfiles/h5mkgrp_version.txt.in
|
||||
./tools/test/misc/h5perf_gentest.c
|
||||
|
@ -142,7 +142,7 @@ error:
|
||||
* status_flags properly so users can open the files afterwards.
|
||||
*
|
||||
* Return: Success: 0
|
||||
* Failure: 1
|
||||
* Failure: 1
|
||||
*
|
||||
* Programmer: Vailin Choi; July 2013
|
||||
*
|
||||
@ -167,65 +167,65 @@ main(void)
|
||||
|
||||
/* Create a copy of the file access property list */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
/* Copy the file access property list */
|
||||
if((new_fapl = H5Pcopy(fapl)) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
/* Set to latest library format */
|
||||
if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
/* Files created within this for loop will have v3 superblock and nonzero status_flags */
|
||||
for(new_format = FALSE; new_format <= TRUE; new_format++) {
|
||||
hid_t fapl2, my_fapl; /* File access property lists */
|
||||
hid_t fapl2, my_fapl; /* File access property lists */
|
||||
|
||||
/* Set to use the appropriate file access property list */
|
||||
if(new_format)
|
||||
fapl2 = new_fapl;
|
||||
else
|
||||
fapl2 = fapl;
|
||||
/*
|
||||
* Create a sec2 file
|
||||
*/
|
||||
if((my_fapl = H5Pcopy(fapl2)) < 0)
|
||||
goto error;
|
||||
/* Create the file */
|
||||
sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
|
||||
if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
|
||||
goto error;
|
||||
/* Set to use the appropriate file access property list */
|
||||
if(new_format)
|
||||
fapl2 = new_fapl;
|
||||
else
|
||||
fapl2 = fapl;
|
||||
/*
|
||||
* Create a sec2 file
|
||||
*/
|
||||
if((my_fapl = H5Pcopy(fapl2)) < 0)
|
||||
goto error;
|
||||
/* Create the file */
|
||||
sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
|
||||
if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
|
||||
goto error;
|
||||
|
||||
/* Flush the file */
|
||||
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
|
||||
goto error;
|
||||
/* Flush the file */
|
||||
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
|
||||
goto error;
|
||||
|
||||
/* Close the property list */
|
||||
if(H5Pclose(my_fapl) < 0)
|
||||
goto error;
|
||||
/* Close the property list */
|
||||
if(H5Pclose(my_fapl) < 0)
|
||||
goto error;
|
||||
|
||||
/*
|
||||
* Create a log file
|
||||
*/
|
||||
/* Create a copy of file access property list */
|
||||
if((my_fapl = H5Pcopy(fapl2)) < 0)
|
||||
goto error;
|
||||
/*
|
||||
* Create a log file
|
||||
*/
|
||||
/* Create a copy of file access property list */
|
||||
if((my_fapl = H5Pcopy(fapl2)) < 0)
|
||||
goto error;
|
||||
|
||||
/* Setup the fapl for the log driver */
|
||||
if(H5Pset_fapl_log(my_fapl, "append.log", (unsigned long long)H5FD_LOG_ALL, (size_t)(4 * KB)) < 0)
|
||||
goto error;
|
||||
/* Setup the fapl for the log driver */
|
||||
if(H5Pset_fapl_log(my_fapl, "append.log", (unsigned long long)H5FD_LOG_ALL, (size_t)(4 * KB)) < 0)
|
||||
goto error;
|
||||
|
||||
/* Create the file */
|
||||
sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
|
||||
if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
|
||||
goto error;
|
||||
/* Create the file */
|
||||
sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
|
||||
if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
|
||||
goto error;
|
||||
|
||||
/* Flush the file */
|
||||
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
|
||||
goto error;
|
||||
/* Flush the file */
|
||||
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
|
||||
goto error;
|
||||
|
||||
/* Close the property list */
|
||||
if(H5Pclose(my_fapl) < 0)
|
||||
goto error;
|
||||
/* Close the property list */
|
||||
if(H5Pclose(my_fapl) < 0)
|
||||
goto error;
|
||||
|
||||
} /* end for */
|
||||
|
||||
@ -233,38 +233,38 @@ main(void)
|
||||
* Create a sec2 file with v0 superblock but nonzero status_flags
|
||||
*/
|
||||
if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
/* Flush the file */
|
||||
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
|
||||
/*
|
||||
* Create a sec2 file with v2 superblock but nonzero status_flags
|
||||
*/
|
||||
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
if(H5Pset_shared_mesg_nindexes(fcpl, 1) < 0)
|
||||
goto error;
|
||||
if(H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 50) < 0)
|
||||
goto error;
|
||||
|
||||
if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
/* Flush the file */
|
||||
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
|
||||
/* Close the property lists */
|
||||
if(H5Pclose(fapl) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
if(H5Pclose(new_fapl) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
if(H5Pclose(fcpl) < 0)
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
BIN
tools/test/misc/testfiles/h5clear_log_v3.h5
Normal file
BIN
tools/test/misc/testfiles/h5clear_log_v3.h5
Normal file
Binary file not shown.
BIN
tools/test/misc/testfiles/h5clear_mdc_image.h5
Normal file
BIN
tools/test/misc/testfiles/h5clear_mdc_image.h5
Normal file
Binary file not shown.
BIN
tools/test/misc/testfiles/latest_h5clear_log_v3.h5
Normal file
BIN
tools/test/misc/testfiles/latest_h5clear_log_v3.h5
Normal file
Binary file not shown.
BIN
tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5
Normal file
BIN
tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5
Normal file
Binary file not shown.
@ -68,9 +68,13 @@ $SRC_H5CLEAR_TESTFILES/h5clear_usage.ddl
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_open_fail.ddl
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_missing_file.ddl
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_no_mdc_image.ddl
|
||||
$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v0.h5
|
||||
$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v2.h5
|
||||
$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v3.h5
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v0.h5
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v2.h5
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v3.h5
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_log_v3.h5
|
||||
$SRC_H5CLEAR_TESTFILES/latest_h5clear_log_v3.h5
|
||||
$SRC_H5CLEAR_TESTFILES/latest_h5clear_sec2_v3.h5
|
||||
$SRC_H5CLEAR_TESTFILES/h5clear_mdc_image.h5
|
||||
$SRC_H5CLEAR_TESTFILES/mod_h5clear_mdc_image.h5
|
||||
"
|
||||
|
||||
@ -161,6 +165,7 @@ TOOLTEST_OUT() {
|
||||
# Run test.
|
||||
TESTING $H5CLEAR $option1 $option2 $fname
|
||||
(
|
||||
cd $TESTDIR
|
||||
$RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname
|
||||
) >$actual 2>$actual_err
|
||||
cp $actual $actual_sav
|
||||
@ -181,7 +186,10 @@ TOOLTEST_OUT() {
|
||||
OPEN_CHK() {
|
||||
fname=$1
|
||||
expected=$2
|
||||
$OPENCHK_BIN $fname 2>/dev/null
|
||||
(
|
||||
cd $TESTDIR
|
||||
$OPENCHK_BIN $fname 2>/dev/null
|
||||
)
|
||||
actual=$?
|
||||
if test $actual -ne $expected; then
|
||||
echo "Unexpected return from $OPENCHK"
|
||||
@ -201,9 +209,11 @@ TOOLTEST() {
|
||||
ret_expected=$4
|
||||
#
|
||||
TESTING $H5CLEAR $option1 $option2 $fname
|
||||
fname=$1
|
||||
# h5clear $option1 $option2 $fname
|
||||
$RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname 2>/dev/null 1>/dev/null
|
||||
(
|
||||
cd $TESTDIR
|
||||
$RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname 2>/dev/null 1>/dev/null
|
||||
)
|
||||
if test $? -ne $ret_expected; then
|
||||
echo "*FAILED*"
|
||||
nerrors=`expr $nerrors + 1`
|
||||
@ -219,30 +229,34 @@ TOOLTEST() {
|
||||
##############################################################################
|
||||
# prepare for testing
|
||||
COPY_TESTFILES_TO_TESTDIR
|
||||
# For Cmake
|
||||
$CP -f $TESTDIR/h5clear_sec2_v0.h5 $TESTDIR/orig_h5clear_sec2_v0.h5
|
||||
$CP -f $TESTDIR/h5clear_sec2_v2.h5 $TESTDIR/orig_h5clear_sec2_v2.h5
|
||||
$CP -f $TESTDIR/h5clear_sec2_v3.h5 $TESTDIR/orig_h5clear_sec2_v3.h5
|
||||
#
|
||||
#
|
||||
#
|
||||
# The following are tests to verify the expected output from h5clear
|
||||
# "h5clear -h"
|
||||
# "h5clear" (no options, no file)
|
||||
# "h5clear junk.h5" (no options, nonexisting file)
|
||||
# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file)
|
||||
# "h5clear -m" (valid 1 option, no file)
|
||||
# "h5clear -s junk.h5" (valid 1 option, nonexisting file)
|
||||
# "h5clear -m -s junk.h5" (valid 2 options, no file)
|
||||
# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file)
|
||||
# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image)
|
||||
# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image)
|
||||
# "h5clear" (no options, no file)
|
||||
# "h5clear junk.h5" (no options, nonexisting file)
|
||||
# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file)
|
||||
# "h5clear -m" (valid 1 option, no file)
|
||||
# "h5clear -s junk.h5" (valid 1 option, nonexisting file)
|
||||
# "h5clear -m -s" (valid 2 options, no file)
|
||||
# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file)
|
||||
# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image)
|
||||
# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image)
|
||||
TOOLTEST_OUT "" -h "" h5clear_usage.ddl
|
||||
TOOLTEST_OUT "" "" "" h5clear_usage.ddl
|
||||
TOOLTEST_OUT junk.h5 "" "" h5clear_usage.ddl
|
||||
TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl
|
||||
TOOLTEST_OUT orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl
|
||||
TOOLTEST_OUT "" -m "" h5clear_missing_file.ddl
|
||||
TOOLTEST_OUT junk.h5 -s "" h5clear_open_fail.ddl
|
||||
TOOLTEST_OUT "" -m -s h5clear_missing_file.ddl
|
||||
TOOLTEST_OUT junk.h5 -m -s h5clear_open_fail.ddl
|
||||
TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl
|
||||
TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl
|
||||
TOOLTEST_OUT orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl
|
||||
TOOLTEST_OUT orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl
|
||||
#
|
||||
#
|
||||
#
|
||||
@ -254,9 +268,9 @@ TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl
|
||||
# "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code)
|
||||
# "h5clear -m -k" (valid/invalid 2 options, nofile, fail exit code)
|
||||
# "h5clear -l -m" (invalid/valid 2 options, nofile, fail exit code)
|
||||
# "h5clear -m -k junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code)
|
||||
# "h5clear -m -l junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code)
|
||||
# "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code)
|
||||
# "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code)
|
||||
# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code)
|
||||
# "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code)
|
||||
TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED
|
||||
TOOLTEST "" --vers "" $SUCCEED
|
||||
@ -273,8 +287,8 @@ TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL
|
||||
#
|
||||
#
|
||||
# h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear:
|
||||
TOOLTEST_OUT $TESTDIR/mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl
|
||||
TOOLTEST_OUT $TESTDIR/mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl
|
||||
TOOLTEST_OUT mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl
|
||||
TOOLTEST_OUT mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl
|
||||
#
|
||||
#
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user