Skip to content

Commit

Permalink
Fix display of long double in tools (#469)
Browse files Browse the repository at this point in the history
* OESS-98 convert plugin option to FetchContent, add tests

* Fixes for pkcfg files because of plugin option

* OESS-98 fix tools test for plugins

* Keep doxygen comments under 100 chars long - format hint

* Whitespace

* HDFFV-11144 - Reclassify CMake messages

* HDFFV-11099/11100 added help text

* Reworked switch statement to compare string instead

* Fix typo

* Update CDash mode

* Correct name of threadsafe

* Correct option name

* Undo accidental commit

* Note LLVM 10 to 11 format default changes

* Update format plugin

* Undo clang-format version 11 changes

* One more correction

* Update supported platforms

* Revert whitespace changes

* Correct whitespace

* Changes from PR#3

* HDFFV-11213 added option to control gcc10 warnings diagnostics

* HDFFV-11212 Use the new references correctly in JNI utility and tests

* format source

* Fix typo

* Add new test file

* HDFFV-11212 - update test and remove unused arg

* Minor non-space formatting changes

* Use H5I_INVALID_ID instead of "-1"

* source formatting

* add missing testfile, update jni function

* Undo commit of debug code

* remove mislocated file

* Fix h5repack test for handling of fapls and id close

* Update h5diff test files usage text

* HDFFV-11212 add new ref tests for JNI export dataset

* src format update

* Remove blank line typo

* src format typo

* long double requires %Lg

* Another long double foramt specifer S.B. %Lg

* issue with t128bit test

* Windows issue with h5dump and type.

* Fix review issues

* refactor function nesting and fix error checks

* format fixes

* Remove untested functions and javadoc quiet comments

* Restore TRY block.

* Change string append errors to memory exception

* revert to H5_JNI_FATAL_ERROR - support functions need work

* Add assertion error for h5util functions

* remove duplicate function

* format fix

* Revert HD function error handling

* Update copyright comments

* GH #386 java folder copyright corrections

* Whitespace

* GH #359 implement and fix tools 1.6 API usage

* remove excessive comments

* Flip inits to correct ifdef section

* rework ifdef to be simpler

* format issue

* Reformat ifdef inits

* remove static attribute

* format compliance

* Update names

* Revert because logic relies on float not being int

* Changes noticed from creating merge of #412

* Double underscore change

* Correct compiler version variable used

* Remove header guard underscores

* Whitespace cleanup

* Split format source and commit changes on repo push

* remove pre-split setting

* Change windows TS to use older VS.

* correct window os name

* HDFFV-11212 JNI export util and Javadoc

* Suggested review changes

* Another change found

* Committing clang-format changes

* HDFFV-11113 long double in tools

* HDFFV-11113 add note

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
byrnHDF and github-actions[bot] authored Mar 17, 2021
1 parent d836797 commit af54fd5
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ tools/testfiles/tints4dimsStride2.ddl -text
tools/testfiles/tintsattrs.h5 -text svneol=unset#application/x-hdf
tools/testfiles/tlarge_objname.h5 -text
tools/testfiles/tldouble.h5 -text
tools/testfiles/tldouble_scalar.h5 -text
tools/testfiles/tlonglinks.h5 -text
tools/testfiles/tloop.h5 -text
tools/testfiles/tloop2.h5 -text
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,11 @@
./tools/testfiles/tlarge_objname.ddl
./tools/testfiles/tlarge_objname.h5
./tools/testfiles/tldouble.ddl
./tools/testfiles/tldouble.wddl
./tools/testfiles/tldouble.h5
./tools/testfiles/tldouble_scalar.ddl
./tools/testfiles/tldouble_scalar.wddl
./tools/testfiles/tldouble_scalar.h5
./tools/testfiles/tlonglinks.ddl
./tools/testfiles/tlonglinks.h5
./tools/testfiles/tloop-1.ddl
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/hdf5-config-version.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else()
endif()

if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
(PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
(PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR))
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
Expand Down
7 changes: 7 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,13 @@ Bug Fixes since HDF5-1.12.0 release

Tools
-----
- Fixed tools display of long double.

Long doubles were not being display correctly. Changed the printf
specifier from %Lf to %Lg.

(ADB - 2021/03/12, HDFFV-11113)

- Fixed tools argument parsing.

Tools parsing used the length of the option from the long array to match
Expand Down
6 changes: 3 additions & 3 deletions tools/lib/h5diff_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define F_FORMAT "%-15g %-15g %-15g\n"

#if H5_SIZEOF_LONG_DOUBLE != 0
#define LD_FORMAT "%-15Lf %-15Lf %-15Lf\n"
#define LD_FORMAT "%-15Lg %-15Lg %-15Lg\n"
#endif

#define I_FORMAT "%-15d %-15d %-15d\n"
Expand All @@ -42,7 +42,7 @@
#define F_FORMAT_P "%-15.10g %-15.10g %-15.10g %-14.10g\n"

#if H5_SIZEOF_LONG_DOUBLE != 0
#define LD_FORMAT_P "%-15.10Lf %-15.10Lf %-15.10Lf %-14.10Lf\n"
#define LD_FORMAT_P "%-15.10Lg %-15.10Lg %-15.10Lg %-14.10Lg\n"
#endif

#define I_FORMAT_P "%-15d %-15d %-15d %-14f\n"
Expand All @@ -59,7 +59,7 @@
#define F_FORMAT_P_NOTCOMP "%-15.10g %-15.10g %-15.10g not comparable\n"

#if H5_SIZEOF_LONG_DOUBLE != 0
#define LD_FORMAT_P_NOTCOMP "%-15.10Lf %-15.10Lf %-15.10Lf not comparable\n"
#define LD_FORMAT_P_NOTCOMP "%-15.10Lg %-15.10Lg %-15.10Lg not comparable\n"
#endif

#define I_FORMAT_P_NOTCOMP "%-15d %-15d %-15d not comparable\n"
Expand Down
11 changes: 9 additions & 2 deletions tools/test/h5dump/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
${HDF5_TOOLS_DIR}/testfiles/tintsattrs.ddl
${HDF5_TOOLS_DIR}/testfiles/tintsnodata.ddl
${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.ddl
${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl
#${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl #special handling on windows
#${HDF5_TOOLS_DIR}/testfiles/tldouble_scalar.ddl #special handling on windows
${HDF5_TOOLS_DIR}/testfiles/tlonglinks.ddl
${HDF5_TOOLS_DIR}/testfiles/tloop-1.ddl
${HDF5_TOOLS_DIR}/testfiles/tmulti.ddl
Expand Down Expand Up @@ -294,6 +295,7 @@
${HDF5_TOOLS_DIR}/testfiles/tintsnodata.h5
${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.h5
${HDF5_TOOLS_DIR}/testfiles/tldouble.h5
${HDF5_TOOLS_DIR}/testfiles/tldouble_scalar.h5
${HDF5_TOOLS_DIR}/testfiles/tlonglinks.h5
${HDF5_TOOLS_DIR}/testfiles/tloop.h5
${HDF5_TOOLS_DIR}/testfiles/tmulti-b.h5
Expand Down Expand Up @@ -409,8 +411,12 @@
configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF)
#file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
#file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tldouble.wddl" "${PROJECT_BINARY_DIR}/testfiles/std/tldouble.ddl" "h5dump_std_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tldouble_scalar.wddl" "${PROJECT_BINARY_DIR}/testfiles/std/tldouble_scalar.ddl" "h5dump_std_files")
else ()
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tldouble.ddl" "h5dump_std_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tldouble_scalar.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tldouble_scalar.ddl" "h5dump_std_files")
endif ()
add_custom_target(h5dump_std_files ALL COMMENT "Copying files needed by h5dump_std tests" DEPENDS ${h5dump_std_files_list})

Expand Down Expand Up @@ -1085,7 +1091,8 @@
ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5)

# test for long double (some systems do not have long double)
# ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5)
ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5)
ADD_H5_TEST (tldouble_scalar 0 -p --enable-error-stack tldouble_scalar.h5)

# test for vms
ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5)
Expand Down
1 change: 1 addition & 0 deletions tools/test/h5dump/h5dumpgentest.c
Original file line number Diff line number Diff line change
Expand Up @@ -11138,6 +11138,7 @@ main(void)
gent_aindices();
gent_longlinks();
gent_ldouble();
gent_ldouble_scalar();
gent_binary();
gent_bigdims();
gent_hyperslab();
Expand Down
5 changes: 4 additions & 1 deletion tools/test/h5dump/testh5dump.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ $SRC_H5DUMP_TESTFILES/tintsattrs.h5
$SRC_H5DUMP_TESTFILES/tints4dims.h5
$SRC_H5DUMP_TESTFILES/tlarge_objname.h5
$SRC_H5DUMP_TESTFILES/tldouble.h5
$SRC_H5DUMP_TESTFILES/tldouble_scalar.h5
$SRC_H5DUMP_TESTFILES/tlonglinks.h5
$SRC_H5DUMP_TESTFILES/tloop.h5
$SRC_H5DUMP_TESTFILES/tmulti-b.h5
Expand Down Expand Up @@ -288,6 +289,7 @@ $SRC_H5DUMP_TESTFILES/tints4dimsStride2.ddl
$SRC_H5DUMP_TESTFILES/tintsattrs.ddl
$SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
$SRC_H5DUMP_TESTFILES/tldouble.ddl
$SRC_H5DUMP_TESTFILES/tldouble_scalar.ddl
$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
$SRC_H5DUMP_TESTFILES/tloop-1.ddl
$SRC_H5DUMP_TESTFILES/tmulti.ddl
Expand Down Expand Up @@ -1351,7 +1353,8 @@ TOOLTEST tgrpnullspace.ddl -p --enable-error-stack tgrpnullspace.h5
TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5

# test for long double (some systems do not have long double)
#TOOLTEST tldouble.ddl --enable-error-stack tldouble.h5
TOOLTEST tldouble.ddl --enable-error-stack tldouble.h5
TOOLTEST tldouble_scalar.ddl -p --enable-error-stack tldouble_scalar.h5

# test for vms
TOOLTEST tvms.ddl --enable-error-stack tvms.h5
Expand Down
11 changes: 11 additions & 0 deletions tools/testfiles/tldouble.wddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HDF5 "tldouble.h5" {
GROUP "/" {
DATASET "dset" {
DATATYPE 128-bit little-endian floating-point
DATASPACE SIMPLE { ( 3 ) / ( 3 ) }
DATA {
(0): 1, 2, 3
}
}
}
}
26 changes: 26 additions & 0 deletions tools/testfiles/tldouble_scalar.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
HDF5 "tldouble_scalar.h5" {
GROUP "/" {
DATASET "dset" {
DATATYPE H5T_ARRAY { [6] H5T_NATIVE_LDOUBLE }
DATASPACE SCALAR
STORAGE_LAYOUT {
CONTIGUOUS
SIZE 96
OFFSET 2048
}
FILTERS {
NONE
}
FILLVALUE {
FILL_TIME H5D_FILL_TIME_IFSET
VALUE H5D_FILL_VALUE_DEFAULT
}
ALLOCATION_TIME {
H5D_ALLOC_TIME_LATE
}
DATA {
(0): [ 0, 1, 2, 3, 4, 5 ]
}
}
}
}
Binary file added tools/testfiles/tldouble_scalar.h5
Binary file not shown.
26 changes: 26 additions & 0 deletions tools/testfiles/tldouble_scalar.wddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
HDF5 "tldouble_scalar.h5" {
GROUP "/" {
DATASET "dset" {
DATATYPE H5T_ARRAY { [6] 128-bit little-endian floating-point }
DATASPACE SCALAR
STORAGE_LAYOUT {
CONTIGUOUS
SIZE 96
OFFSET 2048
}
FILTERS {
NONE
}
FILLVALUE {
FILL_TIME H5D_FILL_TIME_IFSET
VALUE H5D_FILL_VALUE_DEFAULT
}
ALLOCATION_TIME {
H5D_ALLOC_TIME_LATE
}
DATA {
(0): [ 0, 1, 2, 3, 4, 5 ]
}
}
}
}

0 comments on commit af54fd5

Please sign in to comment.