mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
Merge pull request #10 in ~VCHOI/my_third_fork from develop to bugfix/HDFFV-10808-h5pset_file_space_strategy-succeeds
* commit '1d8f7bf297100ec11204442708a7f670a89f3f02': Updated the Java attribute test so that attribute access property lists are created and used correctly. Add test cleanup Need to shift off two arguments HDFFV-9407 add autotools test Move pragma statements outside of routines, to make older compilers happy. HDFFV-9407 Add test
This commit is contained in:
commit
5256fbde26
1
MANIFEST
1
MANIFEST
@ -1698,6 +1698,7 @@
|
||||
./tools/testfiles/h5dump-help.txt
|
||||
./tools/testfiles/non_existing.ddl
|
||||
./tools/testfiles/packedbits.ddl
|
||||
./tools/testfiles/t128bit_float.h5
|
||||
./tools/testfiles/taindices.h5
|
||||
./tools/testfiles/tall-1.ddl
|
||||
./tools/testfiles/tall-2.ddl
|
||||
|
@ -93,6 +93,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
|
||||
H5DUMP_PACKED_BITS-clearall-objects
|
||||
H5DUMP-XML-clearall-objects
|
||||
H5DUMP_VDS-clearall-objects
|
||||
H5DUMP-t128bit_float #uses grepTest.cmake
|
||||
######### tools/h5format_convert #########
|
||||
H5FC-clearall-objects
|
||||
######### tools/h5import #########
|
||||
|
@ -50,6 +50,7 @@ public class TestH5A {
|
||||
long type_id = -1;
|
||||
long space_id = -1;
|
||||
long lapl_id = -1;
|
||||
long aapl_id = -1;
|
||||
|
||||
private final void _deleteFile(String filename) {
|
||||
File file = new File(filename);
|
||||
@ -90,8 +91,10 @@ public class TestH5A {
|
||||
assertTrue("TestH5A.createH5file: _createDataset: ", H5did > 0);
|
||||
space_id = H5.H5Screate(HDF5Constants.H5S_NULL);
|
||||
assertTrue(space_id > 0);
|
||||
lapl_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_ACCESS);
|
||||
lapl_id = H5.H5Pcreate(HDF5Constants.H5P_LINK_ACCESS);
|
||||
assertTrue(lapl_id > 0);
|
||||
aapl_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_ACCESS);
|
||||
assertTrue(aapl_id > 0);
|
||||
type_id = H5.H5Tenum_create(HDF5Constants.H5T_STD_I32LE);
|
||||
assertTrue(type_id > 0);
|
||||
int status = H5.H5Tenum_insert(type_id, "test", 1);
|
||||
@ -122,6 +125,8 @@ public class TestH5A {
|
||||
try {H5.H5Sclose(space_id);} catch (Exception ex) {}
|
||||
if (lapl_id > 0)
|
||||
try {H5.H5Pclose(lapl_id);} catch (Exception ex) {}
|
||||
if (aapl_id > 0)
|
||||
try {H5.H5Pclose(aapl_id);} catch (Exception ex) {}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@ -194,7 +199,6 @@ public class TestH5A {
|
||||
long n = 0;
|
||||
long attr_id = -1;
|
||||
long attribute_id = -1;
|
||||
long aapl_id = HDF5Constants.H5P_DEFAULT;
|
||||
|
||||
try {
|
||||
attr_id = H5.H5Acreate(H5did, "file", type_id, space_id,
|
||||
@ -203,7 +207,7 @@ public class TestH5A {
|
||||
// Opening the existing attribute, obj_name(Created by H5ACreate2)
|
||||
// by index, attached to an object identifier.
|
||||
attribute_id = H5.H5Aopen_by_idx(H5did, ".", HDF5Constants.H5_INDEX_CRT_ORDER, HDF5Constants.H5_ITER_INC,
|
||||
0, HDF5Constants.H5P_DEFAULT, lapl_id);
|
||||
0, aapl_id, lapl_id);
|
||||
|
||||
assertTrue("testH5Aopen_by_idx: H5Aopen_by_idx", attribute_id >= 0);
|
||||
|
||||
@ -258,7 +262,7 @@ public class TestH5A {
|
||||
try {
|
||||
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
|
||||
type_id, space_id, HDF5Constants.H5P_DEFAULT,
|
||||
HDF5Constants.H5P_DEFAULT, lapl_id);
|
||||
aapl_id, lapl_id);
|
||||
assertTrue("testH5Acreate_by_name: H5Acreate_by_name",
|
||||
attribute_id >= 0);
|
||||
|
||||
@ -289,7 +293,7 @@ public class TestH5A {
|
||||
boolean bool_val = false;
|
||||
|
||||
try {
|
||||
attr_id = H5.H5Acreate(loc_id, old_attr_name, type_id, space_id, HDF5Constants.H5P_DEFAULT, lapl_id);
|
||||
attr_id = H5.H5Acreate(loc_id, old_attr_name, type_id, space_id, HDF5Constants.H5P_DEFAULT, aapl_id);
|
||||
|
||||
ret_val = H5.H5Arename(loc_id, old_attr_name, new_attr_name);
|
||||
|
||||
@ -328,7 +332,7 @@ public class TestH5A {
|
||||
|
||||
try {
|
||||
attr_id = H5.H5Acreate_by_name(loc_id, obj_name, old_attr_name,
|
||||
type_id, space_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, lapl_id);
|
||||
type_id, space_id, HDF5Constants.H5P_DEFAULT, aapl_id, lapl_id);
|
||||
|
||||
ret_val = H5.H5Arename_by_name(loc_id, obj_name, old_attr_name,
|
||||
new_attr_name, lapl_id);
|
||||
@ -369,7 +373,7 @@ public class TestH5A {
|
||||
try {
|
||||
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
|
||||
type_id, space_id, HDF5Constants.H5P_DEFAULT,
|
||||
HDF5Constants.H5P_DEFAULT, lapl_id);
|
||||
aapl_id, lapl_id);
|
||||
assertTrue("testH5Aget_name: H5Acreate_by_name ", attribute_id > 0);
|
||||
ret_name = H5.H5Aget_name(attribute_id);
|
||||
assertEquals(ret_name, attr_name);
|
||||
|
@ -59,11 +59,11 @@ New Features
|
||||
(ADB - 2019/06/12, HDFFV-10805)
|
||||
|
||||
- Add options to enable or disable building tools and tests
|
||||
|
||||
Configure options --enable-tests and --enable-tools were added for
|
||||
|
||||
Configure options --enable-tests and --enable-tools were added for
|
||||
autotools configure. These options are enabled by default, and can be
|
||||
disabled with either --disable-tests (or tools) or --enable-tests=no
|
||||
(or --enable-tools=no). Build time is reduced ~20% when tools are
|
||||
disabled with either --disable-tests (or tools) or --enable-tests=no
|
||||
(or --enable-tools=no). Build time is reduced ~20% when tools are
|
||||
disabled, 35% when tests are disabled, 45% when both are disabled.
|
||||
Reenabling them after the initial build requires running configure
|
||||
again with the option(s) enabled.
|
||||
@ -240,7 +240,6 @@ New Features
|
||||
|
||||
(ADB - 2018/12/12, HDFVIEW-4)
|
||||
|
||||
|
||||
- Removed H5I_REFERENCE from the Java wrappers
|
||||
|
||||
This ID class was never used by the library and has been removed
|
||||
@ -251,7 +250,12 @@ New Features
|
||||
|
||||
Tools:
|
||||
------
|
||||
-
|
||||
- h5dump was fixed for 128-bit floats, but was missing a test.
|
||||
|
||||
New test greps for the first 15 numbers of the 128-bit value.
|
||||
|
||||
(ADB - 2019/06/23, HDFFV-9407)
|
||||
|
||||
|
||||
High-Level APIs:
|
||||
---------------
|
||||
@ -286,7 +290,7 @@ Bug Fixes since HDF5-1.10.3 release
|
||||
H5F_LIBVER_V18, the H5Ocopy() call will fail with the error stack indicating
|
||||
that the fill value version is out of bounds.
|
||||
|
||||
This was fixed by changing the fill value message version to H5O_FILL_VERSION_3
|
||||
This was fixed by changing the fill value message version to H5O_FILL_VERSION_3
|
||||
(from H5O_FILL_VERSION_2) for H5F_LIBVER_V18.
|
||||
|
||||
(VC - 2019/6/14, HDFFV-10800)
|
||||
|
@ -515,6 +515,9 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5T__get_native_type() */
|
||||
|
||||
/* Disable warning for intentional identical branches here -QAK */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5T__get_native_integer
|
||||
@ -551,9 +554,6 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
|
||||
/* Disable warning for intentional identical branches here -QAK */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||
if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) {
|
||||
match = H5T_NATIVE_INT_MATCH_CHAR;
|
||||
native_size = sizeof(char);
|
||||
@ -573,7 +573,6 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
|
||||
match = H5T_NATIVE_INT_MATCH_LLONG;
|
||||
native_size = sizeof(long long);
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
} else if(direction == H5T_DIR_DESCEND) {
|
||||
if(prec > H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) {
|
||||
match = H5T_NATIVE_INT_MATCH_LLONG;
|
||||
@ -659,7 +658,11 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5T__get_native_integer() */
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/* Disable warning for intentional identical branches here -QAK */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5T__get_native_float
|
||||
@ -698,9 +701,6 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
|
||||
HDassert(size>0);
|
||||
|
||||
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
|
||||
/* Disable warning for intentional identical branches here -QAK */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||
if(size<=sizeof(float)) {
|
||||
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
|
||||
native_size = sizeof(float);
|
||||
@ -724,7 +724,6 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
|
||||
native_size = sizeof(double);
|
||||
#endif
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
} else {
|
||||
#if H5_SIZEOF_LONG_DOUBLE !=0
|
||||
if(size>sizeof(double)) {
|
||||
@ -788,7 +787,11 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5T__get_native_float() */
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/* Disable warning for intentional identical branches here -QAK */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5T__get_native_bitfield
|
||||
@ -818,9 +821,6 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
|
||||
/* Disable warning for intentional identical branches here -QAK */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||
if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) {
|
||||
tid = H5T_NATIVE_B8;
|
||||
native_size = 1;
|
||||
@ -842,7 +842,6 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
|
||||
native_size = 8;
|
||||
align = H5T_NATIVE_UINT64_ALIGN_g;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
} else if(direction == H5T_DIR_DESCEND) {
|
||||
if(prec>H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B32_g))) {
|
||||
tid = H5T_NATIVE_B64;
|
||||
@ -878,6 +877,7 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction,
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5T__get_native_bitfield() */
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
|
@ -320,6 +320,7 @@
|
||||
${HDF5_TOOLS_DIR}/testfiles/tvlenstr_array.h5
|
||||
${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5
|
||||
${HDF5_TOOLS_DIR}/testfiles/tvms.h5
|
||||
${HDF5_TOOLS_DIR}/testfiles/t128bit_float.h5
|
||||
${HDF5_TOOLS_DIR}/testfiles/zerodim.h5
|
||||
)
|
||||
set (HDF5_ERROR_REFERENCE_TEST_FILES
|
||||
@ -674,6 +675,32 @@
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
macro (ADD_H5_GREP_TEST resultfile resultcode result_check)
|
||||
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
|
||||
# Remove any output file left over from previous test run
|
||||
add_test (
|
||||
NAME H5DUMP-${resultfile}-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E remove
|
||||
${resultfile}.out
|
||||
${resultfile}.out.err
|
||||
)
|
||||
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
|
||||
add_test (
|
||||
NAME H5DUMP-${resultfile}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
|
||||
-D "TEST_ARGS:STRING=${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
|
||||
-D "TEST_OUTPUT=${resultfile}.out"
|
||||
-D "TEST_EXPECT=${resultcode}"
|
||||
-D "TEST_REFERENCE=${result_check}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
macro (ADD_H5ERR_MASK_TEST resultfile resultcode result_errcheck)
|
||||
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
|
||||
# Remove any output file left over from previous test run
|
||||
@ -1551,6 +1578,9 @@
|
||||
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
|
||||
ADD_H5_TEST (err_attr_dspace 1 err_attr_dspace.h5)
|
||||
|
||||
# test to verify HDFFV-9407: long double full precision
|
||||
ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lf t128bit_float.h5)
|
||||
|
||||
##############################################################################
|
||||
### P L U G I N T E S T S
|
||||
##############################################################################
|
||||
|
@ -34,6 +34,7 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
|
||||
RM='rm -rf'
|
||||
CMP='cmp'
|
||||
DIFF='diff -c'
|
||||
GREP='grep'
|
||||
CP='cp'
|
||||
DIRNAME='dirname'
|
||||
LS='ls'
|
||||
@ -83,6 +84,7 @@ $SRC_H5DUMP_TESTFILES/charsets.h5
|
||||
$SRC_H5DUMP_TESTFILES/file_space.h5
|
||||
$SRC_H5DUMP_TESTFILES/filter_fail.h5
|
||||
$SRC_H5DUMP_TESTFILES/packedbits.h5
|
||||
$SRC_H5DUMP_TESTFILES/t128bit_float.h5
|
||||
$SRC_H5DUMP_TESTFILES/taindices.h5
|
||||
$SRC_H5DUMP_TESTFILES/tall.h5
|
||||
$SRC_H5DUMP_TESTFILES/tarray1.h5
|
||||
@ -903,6 +905,36 @@ TOOLTEST_HELP() {
|
||||
|
||||
}
|
||||
|
||||
# Call the h5dump tool and grep for a value
|
||||
#
|
||||
GREPTEST()
|
||||
{
|
||||
expectdata=$1
|
||||
actual=$TESTDIR/$2
|
||||
actual_err="$TESTDIR/`basename $2 .ddl`.oerr"
|
||||
shift
|
||||
shift
|
||||
|
||||
# Run test.
|
||||
TESTING $DUMPER -p $@
|
||||
(
|
||||
cd $TESTDIR
|
||||
$ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@"
|
||||
) >$actual 2>$actual_err
|
||||
$GREP $expectdata $actual > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " PASSED"
|
||||
else
|
||||
echo " FAILED"
|
||||
nerrors="`expr $nerrors + 1`"
|
||||
fi
|
||||
|
||||
# Clean up output file
|
||||
if test -z "$HDF5_NOCLEANUP"; then
|
||||
rm -f $actual $actual_err
|
||||
fi
|
||||
}
|
||||
|
||||
# Print a "SKIP" message
|
||||
SKIP() {
|
||||
TESTING $DUMPER $@
|
||||
@ -1363,6 +1395,9 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
|
||||
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
|
||||
TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5
|
||||
|
||||
# test to verify HDFFV-9407: long double full precision
|
||||
GREPTEST "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
|
||||
|
||||
# Clean up temporary files/directories
|
||||
CLEAN_TESTFILES_AND_TESTDIR
|
||||
|
||||
|
BIN
tools/testfiles/t128bit_float.h5
Normal file
BIN
tools/testfiles/t128bit_float.h5
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user