From 4320d92be6f2d4c945ebe2ce8d63a683d6642a96 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Tue, 12 Mar 2024 21:27:09 -0500 Subject: Add big-endian _Float16 tools tests and files --- tools/test/h5dump/CMakeTests.cmake | 5 +- tools/test/h5dump/CMakeTestsXML.cmake | 5 +- tools/test/h5dump/expected/tfloat16_be.ddl | 46 ++++ tools/test/h5dump/expected/xml/tfloat16_be.h5.xml | 302 ++++++++++++++++++++++ tools/test/h5dump/h5dumpgentest.c | 81 +++++- tools/test/h5dump/testfiles/tfloat16_be.h5 | Bin 0 -> 2304 bytes tools/test/h5dump/testh5dump.sh.in | 5 +- tools/test/h5dump/testh5dumpxml.sh.in | 7 +- tools/test/h5ls/CMakeTests.cmake | 25 +- tools/test/h5ls/expected/tfloat16_be.ls | 8 + tools/test/h5ls/expected/tfloat16_be_nosupport.ls | 8 + tools/test/h5ls/testh5ls.sh.in | 11 +- 12 files changed, 489 insertions(+), 14 deletions(-) create mode 100644 tools/test/h5dump/expected/tfloat16_be.ddl create mode 100644 tools/test/h5dump/expected/xml/tfloat16_be.h5.xml create mode 100644 tools/test/h5dump/testfiles/tfloat16_be.h5 create mode 100644 tools/test/h5ls/expected/tfloat16_be.ls create mode 100644 tools/test/h5ls/expected/tfloat16_be_nosupport.ls diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index cea090d..3a863bd 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -104,6 +104,7 @@ #tfloatsattrs.ddl #native #tfloatsattrs.wddl #special for windows tfloat16.ddl + tfloat16_be.ddl tfpformat.ddl tgroup-1.ddl tgroup-2.ddl @@ -293,6 +294,7 @@ tfilters.h5 tfloatsattrs.h5 tfloat16.h5 + tfloat16_be.h5 tfpformat.h5 tfvalues.h5 tgroup.h5 @@ -1338,8 +1340,9 @@ ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5) ADD_H5_TEST (tldouble_scalar 0 -p --enable-error-stack tldouble_scalar.h5) - # Add test for _Float16 type + # Add tests for _Float16 type ADD_H5_TEST (tfloat16 0 --enable-error-stack tfloat16.h5) + ADD_H5_TEST (tfloat16_be 0 --enable-error-stack tfloat16_be.h5) # test for vms ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5) diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index c666733..5d2e647 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -58,6 +58,7 @@ tempty.h5 textlink.h5 tfloat16.h5 + tfloat16_be.h5 tfpformat.h5 tgroup.h5 thlink.h5 @@ -108,6 +109,7 @@ test35.nc.xml textlink.h5.xml tfloat16.h5.xml + tfloat16_be.h5.xml tfpformat.h5.xml tgroup.h5.xml thlink.h5.xml @@ -296,8 +298,9 @@ ADD_XML_H5_TEST (torderattr3.h5 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5) ADD_XML_H5_TEST (torderattr4.h5 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5) - # Add test for _Float16 type + # Add tests for _Float16 type ADD_XML_H5_TEST (tfloat16.h5 0 tfloat16.h5) + ADD_XML_H5_TEST (tfloat16_be.h5 0 tfloat16_be.h5) # tests for floating point user defined printf format ADD_XML_H5_TEST (tfpformat.h5 0 -u -m %.7f tfpformat.h5) diff --git a/tools/test/h5dump/expected/tfloat16_be.ddl b/tools/test/h5dump/expected/tfloat16_be.ddl new file mode 100644 index 0000000..0872a92 --- /dev/null +++ b/tools/test/h5dump/expected/tfloat16_be.ddl @@ -0,0 +1,46 @@ +HDF5 "tfloat16_be.h5" { +GROUP "/" { + DATASET "DS16BITS" { + DATATYPE H5T_IEEE_F16BE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + DATA { + (0,0): 16, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, + (1,0): 15, 0.5625, 1.0625, 1.5625, 2.0625, 2.5625, 3.0625, 3.5625, + (1,8): 4.0625, 4.5625, 5.0625, 5.5625, 6.0625, 6.5625, 7.0625, 7.5625, + (2,0): 14, 0.625, 1.125, 1.625, 2.125, 2.625, 3.125, 3.625, 4.125, + (2,9): 4.625, 5.125, 5.625, 6.125, 6.625, 7.125, 7.625, + (3,0): 13, 0.6875, 1.1875, 1.6875, 2.1875, 2.6875, 3.1875, 3.6875, + (3,8): 4.1875, 4.6875, 5.1875, 5.6875, 6.1875, 6.6875, 7.1875, 7.6875, + (4,0): 12, 0.75, 1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.25, + (4,11): 5.75, 6.25, 6.75, 7.25, 7.75, + (5,0): 11, 0.8125, 1.3125, 1.8125, 2.3125, 2.8125, 3.3125, 3.8125, + (5,8): 4.3125, 4.8125, 5.3125, 5.8125, 6.3125, 6.8125, 7.3125, 7.8125, + (6,0): 10, 0.875, 1.375, 1.875, 2.375, 2.875, 3.375, 3.875, 4.375, + (6,9): 4.875, 5.375, 5.875, 6.375, 6.875, 7.375, 7.875, + (7,0): 9, 0.9375, 1.4375, 1.9375, 2.4375, 2.9375, 3.4375, 3.9375, + (7,8): 4.4375, 4.9375, 5.4375, 5.9375, 6.4375, 6.9375, 7.4375, 7.9375 + } + ATTRIBUTE "DS16BITS" { + DATATYPE H5T_IEEE_F16BE + DATASPACE SIMPLE { ( 128 ) / ( 128 ) } + DATA { + (0): 16, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, + (15): 7.5, 15, 0.5625, 1.0625, 1.5625, 2.0625, 2.5625, 3.0625, + (23): 3.5625, 4.0625, 4.5625, 5.0625, 5.5625, 6.0625, 6.5625, + (30): 7.0625, 7.5625, 14, 0.625, 1.125, 1.625, 2.125, 2.625, 3.125, + (39): 3.625, 4.125, 4.625, 5.125, 5.625, 6.125, 6.625, 7.125, 7.625, + (48): 13, 0.6875, 1.1875, 1.6875, 2.1875, 2.6875, 3.1875, 3.6875, + (56): 4.1875, 4.6875, 5.1875, 5.6875, 6.1875, 6.6875, 7.1875, + (63): 7.6875, 12, 0.75, 1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, + (73): 4.75, 5.25, 5.75, 6.25, 6.75, 7.25, 7.75, 11, 0.8125, 1.3125, + (83): 1.8125, 2.3125, 2.8125, 3.3125, 3.8125, 4.3125, 4.8125, + (90): 5.3125, 5.8125, 6.3125, 6.8125, 7.3125, 7.8125, 10, 0.875, + (98): 1.375, 1.875, 2.375, 2.875, 3.375, 3.875, 4.375, 4.875, 5.375, + (107): 5.875, 6.375, 6.875, 7.375, 7.875, 9, 0.9375, 1.4375, 1.9375, + (116): 2.4375, 2.9375, 3.4375, 3.9375, 4.4375, 4.9375, 5.4375, + (123): 5.9375, 6.4375, 6.9375, 7.4375, 7.9375 + } + } + } +} +} diff --git a/tools/test/h5dump/expected/xml/tfloat16_be.h5.xml b/tools/test/h5dump/expected/xml/tfloat16_be.h5.xml new file mode 100644 index 0000000..b9116f0 --- /dev/null +++ b/tools/test/h5dump/expected/xml/tfloat16_be.h5.xml @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16 + 0.5 + 1 + 1.5 + 2 + 2.5 + 3 + 3.5 + 4 + 4.5 + 5 + 5.5 + 6 + 6.5 + 7 + 7.5 + 15 + 0.5625 + 1.0625 + 1.5625 + 2.0625 + 2.5625 + 3.0625 + 3.5625 + 4.0625 + 4.5625 + 5.0625 + 5.5625 + 6.0625 + 6.5625 + 7.0625 + 7.5625 + 14 + 0.625 + 1.125 + 1.625 + 2.125 + 2.625 + 3.125 + 3.625 + 4.125 + 4.625 + 5.125 + 5.625 + 6.125 + 6.625 + 7.125 + 7.625 + 13 + 0.6875 + 1.1875 + 1.6875 + 2.1875 + 2.6875 + 3.1875 + 3.6875 + 4.1875 + 4.6875 + 5.1875 + 5.6875 + 6.1875 + 6.6875 + 7.1875 + 7.6875 + 12 + 0.75 + 1.25 + 1.75 + 2.25 + 2.75 + 3.25 + 3.75 + 4.25 + 4.75 + 5.25 + 5.75 + 6.25 + 6.75 + 7.25 + 7.75 + 11 + 0.8125 + 1.3125 + 1.8125 + 2.3125 + 2.8125 + 3.3125 + 3.8125 + 4.3125 + 4.8125 + 5.3125 + 5.8125 + 6.3125 + 6.8125 + 7.3125 + 7.8125 + 10 + 0.875 + 1.375 + 1.875 + 2.375 + 2.875 + 3.375 + 3.875 + 4.375 + 4.875 + 5.375 + 5.875 + 6.375 + 6.875 + 7.375 + 7.875 + 9 + 0.9375 + 1.4375 + 1.9375 + 2.4375 + 2.9375 + 3.4375 + 3.9375 + 4.4375 + 4.9375 + 5.4375 + 5.9375 + 6.4375 + 6.9375 + 7.4375 + 7.9375 + + + + + + 16 + 0.5 + 1 + 1.5 + 2 + 2.5 + 3 + 3.5 + 4 + 4.5 + 5 + 5.5 + 6 + 6.5 + 7 + 7.5 + 15 + 0.5625 + 1.0625 + 1.5625 + 2.0625 + 2.5625 + 3.0625 + 3.5625 + 4.0625 + 4.5625 + 5.0625 + 5.5625 + 6.0625 + 6.5625 + 7.0625 + 7.5625 + 14 + 0.625 + 1.125 + 1.625 + 2.125 + 2.625 + 3.125 + 3.625 + 4.125 + 4.625 + 5.125 + 5.625 + 6.125 + 6.625 + 7.125 + 7.625 + 13 + 0.6875 + 1.1875 + 1.6875 + 2.1875 + 2.6875 + 3.1875 + 3.6875 + 4.1875 + 4.6875 + 5.1875 + 5.6875 + 6.1875 + 6.6875 + 7.1875 + 7.6875 + 12 + 0.75 + 1.25 + 1.75 + 2.25 + 2.75 + 3.25 + 3.75 + 4.25 + 4.75 + 5.25 + 5.75 + 6.25 + 6.75 + 7.25 + 7.75 + 11 + 0.8125 + 1.3125 + 1.8125 + 2.3125 + 2.8125 + 3.3125 + 3.8125 + 4.3125 + 4.8125 + 5.3125 + 5.8125 + 6.3125 + 6.8125 + 7.3125 + 7.8125 + 10 + 0.875 + 1.375 + 1.875 + 2.375 + 2.875 + 3.375 + 3.875 + 4.375 + 4.875 + 5.375 + 5.875 + 6.375 + 6.875 + 7.375 + 7.875 + 9 + 0.9375 + 1.4375 + 1.9375 + 2.4375 + 2.9375 + 3.4375 + 3.9375 + 4.4375 + 4.9375 + 5.4375 + 5.9375 + 6.4375 + 6.9375 + 7.4375 + 7.9375 + + + + + diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 1af0a45..46e0f99 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -121,6 +121,7 @@ #define FILE92 "tst_onion_dset_ext.h5" #ifdef H5_HAVE__FLOAT16 #define FILE93 "tfloat16.h5" +#define FILE94 "tfloat16_be.h5" #endif #define ONION_TEST_FIXNAME_SIZE 1024 @@ -420,6 +421,11 @@ typedef struct s1_t { #define F93_XDIM 8 #define F93_YDIM 16 #define F93_DATASET "DS16BITS" + +/* "FILE94" macros */ +#define F94_XDIM 8 +#define F94_YDIM 16 +#define F94_DATASET "DS16BITS" #endif static void @@ -12034,7 +12040,7 @@ gent_float16(void) if (H5Tget_size(tid) == 0) goto error; - /* Dataset of 16-bit float */ + /* Dataset of 16-bit little-endian float */ dims[0] = F93_XDIM; dims[1] = F93_YDIM; space = H5Screate_simple(2, dims, NULL); @@ -12055,7 +12061,7 @@ gent_float16(void) H5Dwrite(dataset, H5T_IEEE_F16LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); - /* Attribute of 16-bit float */ + /* Attribute of 16-bit little-endian float */ adims[0] = F93_XDIM * F93_YDIM; aspace = H5Screate_simple(1, adims, NULL); attr = H5Acreate2(dataset, F93_DATASET, H5T_IEEE_F16LE, aspace, H5P_DEFAULT, H5P_DEFAULT); @@ -12073,6 +12079,76 @@ error: H5Fclose(fid); } + +static void +gent_float16_be(void) +{ + hid_t fid = H5I_INVALID_HID; + hid_t tid = H5I_INVALID_HID; + hid_t attr = H5I_INVALID_HID; + hid_t dataset = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t aspace = H5I_INVALID_HID; + hsize_t dims[2], adims[1]; + + struct { + H5__Float16 arr[F94_XDIM][F94_YDIM]; + } * dset16; + + H5__Float16 *aset16 = NULL; + H5__Float16 val16bits; + + dset16 = malloc(sizeof(*dset16)); + + aset16 = calloc(F94_XDIM * F94_YDIM, sizeof(H5__Float16)); + + fid = H5Fcreate(FILE94, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + if ((tid = H5Tcopy(H5T_NATIVE_FLOAT16)) < 0) + goto error; + + if (H5Tget_size(tid) == 0) + goto error; + + /* Dataset of 16-bit big-endian float */ + dims[0] = F94_XDIM; + dims[1] = F94_YDIM; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate2(fid, F94_DATASET, H5T_IEEE_F16BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + val16bits = (H5__Float16)F94_YDIM; + for (size_t i = 0; i < dims[0]; i++) { + dset16->arr[i][0] = val16bits; + aset16[i * dims[1]] = dset16->arr[i][0]; + + for (size_t j = 1; j < dims[1]; j++) { + dset16->arr[i][j] = (H5__Float16)(j * dims[0] + i) / (H5__Float16)F94_YDIM; + aset16[i * dims[1] + j] = dset16->arr[i][j]; + } + + val16bits -= (H5__Float16)1; + } + + H5Dwrite(dataset, H5T_IEEE_F16LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); + + /* Attribute of 16-bit big-endian float */ + adims[0] = F94_XDIM * F94_YDIM; + aspace = H5Screate_simple(1, adims, NULL); + attr = H5Acreate2(dataset, F94_DATASET, H5T_IEEE_F16BE, aspace, H5P_DEFAULT, H5P_DEFAULT); + + H5Awrite(attr, H5T_IEEE_F16LE, aset16); + + H5Aclose(attr); + H5Sclose(aspace); + H5Sclose(space); + H5Dclose(dataset); + +error: + free(aset16); + free(dset16); + + H5Fclose(fid); +} #endif int @@ -12181,6 +12257,7 @@ main(void) #ifdef H5_HAVE__FLOAT16 gent_float16(); + gent_float16_be(); #endif return 0; diff --git a/tools/test/h5dump/testfiles/tfloat16_be.h5 b/tools/test/h5dump/testfiles/tfloat16_be.h5 new file mode 100644 index 0000000..f0d656a Binary files /dev/null and b/tools/test/h5dump/testfiles/tfloat16_be.h5 differ diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 3949518..daba93b 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -134,6 +134,7 @@ $SRC_H5DUMP_TESTFILES/tfcontents2.h5 $SRC_H5DUMP_TESTFILES/tfilters.h5 $SRC_H5DUMP_TESTFILES/tfloatsattrs.h5 $SRC_H5DUMP_TESTFILES/tfloat16.h5 +$SRC_H5DUMP_TESTFILES/tfloat16_be.h5 $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tfvalues.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 @@ -275,6 +276,7 @@ $SRC_H5DUMP_OUTFILES/tfill.ddl $SRC_H5DUMP_OUTFILES/tfletcher32.ddl $SRC_H5DUMP_OUTFILES/tfloatsattrs.ddl $SRC_H5DUMP_OUTFILES/tfloat16.ddl +$SRC_H5DUMP_OUTFILES/tfloat16_be.ddl $SRC_H5DUMP_OUTFILES/tfpformat.ddl $SRC_H5DUMP_OUTFILES/tgroup-1.ddl $SRC_H5DUMP_OUTFILES/tgroup-2.ddl @@ -1469,8 +1471,9 @@ TOOLTEST tfloatsattrs.ddl -p --enable-error-stack tfloatsattrs.h5 TOOLTEST tldouble.ddl --enable-error-stack tldouble.h5 TOOLTEST tldouble_scalar.ddl -p --enable-error-stack tldouble_scalar.h5 -# test for _Float16 type +# tests for _Float16 type TOOLTEST tfloat16.ddl --enable-error-stack tfloat16.h5 +TOOLTEST tfloat16_be.ddl --enable-error-stack tfloat16_be.h5 # test for vms TOOLTEST tvms.ddl --enable-error-stack tvms.h5 diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index 95a4bd5..b95d5c4 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -101,6 +101,7 @@ $SRC_H5DUMP_TESTFILES/tdset.h5 $SRC_H5DUMP_TESTFILES/tempty.h5 $SRC_H5DUMP_TESTFILES/textlink.h5 $SRC_H5DUMP_TESTFILES/tfloat16.h5 +$SRC_H5DUMP_TESTFILES/tfloat16_be.h5 $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 $SRC_H5DUMP_TESTFILES/thlink.h5 @@ -152,6 +153,7 @@ $SRC_H5DUMP_OUTFILES/xml/tenum.h5.xml $SRC_H5DUMP_OUTFILES/xml/test35.nc.xml $SRC_H5DUMP_OUTFILES/xml/textlink.h5.xml $SRC_H5DUMP_OUTFILES/xml/tfloat16.h5.xml +$SRC_H5DUMP_OUTFILES/xml/tfloat16_be.h5.xml $SRC_H5DUMP_OUTFILES/xml/tfpformat.h5.xml $SRC_H5DUMP_OUTFILES/xml/tgroup.h5.xml $SRC_H5DUMP_OUTFILES/xml/thlink.h5.xml @@ -385,8 +387,9 @@ TOOLTEST torderattr2.h5.xml --xml -H --sort_by=name --sort_order=descending tord TOOLTEST torderattr3.h5.xml --xml -H --sort_by=creation_order --sort_order=ascending torderattr.h5 TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=descending torderattr.h5 -# test for _Float16 type -TOOLTEST tfloat16.h5.xml --xml tfloat16.h5 +# tests for _Float16 type +TOOLTEST tfloat16.h5.xml --xml tfloat16.h5 +TOOLTEST tfloat16_be.h5.xml --xml tfloat16_be.h5 # tests for floating point user defined printf format TOOLTEST tfpformat.h5.xml -u -m %.7f tfpformat.h5 diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index 9e3bb38..2aefdb6 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -36,6 +36,7 @@ textlinksrc.h5 textlinktar.h5 tfloat16.h5 + tfloat16_be.h5 tgroup.h5 tgrp_comments.h5 tgrpnullspace.h5 @@ -91,6 +92,8 @@ textlinksrc-nodangle-2.ls tfloat16.ls tfloat16_nosupport.ls + tfloat16_be.ls + tfloat16_be_nosupport.ls tgroup.ls tgroup-1.ls tgroup-2.ls @@ -322,16 +325,26 @@ # If support is available for _Float16 type, the second test # will fail as the type will be printed out as "native _Float16" # rather than "IEEE 16-bit little-endian float". - ADD_H5_TEST (tfloat16 0 -w80 -v tfloat16.h5) - ADD_H5_TEST (tfloat16_nosupport 0 -w80 -v tfloat16.h5) - set_tests_properties (H5LS-tfloat16_nosupport PROPERTIES WILL_FAIL "true") + if (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tfloat16_be 0 -w80 -v tfloat16_be.h5) + ADD_H5_TEST (tfloat16_be_nosupport 0 -w80 -v tfloat16_be.h5) + set_tests_properties (H5LS-tfloat16_be_nosupport PROPERTIES WILL_FAIL "true") + else () + ADD_H5_TEST (tfloat16 0 -w80 -v tfloat16.h5) + ADD_H5_TEST (tfloat16_nosupport 0 -w80 -v tfloat16.h5) + set_tests_properties (H5LS-tfloat16_nosupport PROPERTIES WILL_FAIL "true") + endif () else () - # If support is NOT available for _Float16 type, the first test - # will fail as the type will be printed out as - # "IEEE 16-bit little-endian float" rather than "native _Float16" + # If support is NOT available for _Float16 type, the first two tests + # will fail as the types will be printed out as + # "IEEE 16-bit little-endian float" and "IEEE 16-bit big-endian float" + # rather than "native _Float16" ADD_H5_TEST (tfloat16 0 -w80 -v tfloat16.h5) set_tests_properties (H5LS-tfloat16 PROPERTIES WILL_FAIL "true") + ADD_H5_TEST (tfloat16_be 0 -w80 -v tfloat16_be.h5) + set_tests_properties (H5LS-tfloat16_be PROPERTIES WILL_FAIL "true") ADD_H5_TEST (tfloat16_nosupport 0 -w80 -v tfloat16.h5) + ADD_H5_TEST (tfloat16_be_nosupport 0 -w80 -v tfloat16_be.h5) endif () # test for wildcards in filename (does not work with cmake) diff --git a/tools/test/h5ls/expected/tfloat16_be.ls b/tools/test/h5ls/expected/tfloat16_be.ls new file mode 100644 index 0000000..6a2e7de --- /dev/null +++ b/tools/test/h5ls/expected/tfloat16_be.ls @@ -0,0 +1,8 @@ +Opened "tfloat16_be.h5" with sec2 driver. +DS16BITS Dataset {8/8, 16/16} + Attribute: DS16BITS {128} + Type: native _Float16 + Location: 1:800 + Links: 1 + Storage: 256 logical bytes, 256 allocated bytes, 100.00% utilization + Type: native _Float16 diff --git a/tools/test/h5ls/expected/tfloat16_be_nosupport.ls b/tools/test/h5ls/expected/tfloat16_be_nosupport.ls new file mode 100644 index 0000000..1c6911d --- /dev/null +++ b/tools/test/h5ls/expected/tfloat16_be_nosupport.ls @@ -0,0 +1,8 @@ +Opened "tfloat16_be.h5" with sec2 driver. +DS16BITS Dataset {8/8, 16/16} + Attribute: DS16BITS {128} + Type: IEEE 16-bit big-endian float + Location: 1:800 + Links: 1 + Storage: 256 logical bytes, 256 allocated bytes, 100.00% utilization + Type: IEEE 16-bit big-endian float diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in index 3d306df..478e5b7 100644 --- a/tools/test/h5ls/testh5ls.sh.in +++ b/tools/test/h5ls/testh5ls.sh.in @@ -17,6 +17,7 @@ srcdir=@srcdir@ USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" HAVE__FLOAT16="@HAVE__FLOAT16@" +WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" TESTNAME=h5ls EXIT_SUCCESS=0 @@ -80,6 +81,7 @@ $SRC_H5DUMP_TESTFILES/textlink.h5 $SRC_H5DUMP_TESTFILES/textlinksrc.h5 $SRC_H5DUMP_TESTFILES/textlinktar.h5 $SRC_H5DUMP_TESTFILES/tfloat16.h5 +$SRC_H5DUMP_TESTFILES/tfloat16_be.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 $SRC_H5DUMP_TESTFILES/tgrp_comments.h5 $SRC_H5DUMP_TESTFILES/tgrpnullspace.h5 @@ -132,6 +134,8 @@ $SRC_H5LS_OUTFILES/textlinksrc-6-old.ls $SRC_H5LS_OUTFILES/textlinksrc-7-old.ls $SRC_H5LS_OUTFILES/tfloat16.ls $SRC_H5LS_OUTFILES/tfloat16_nosupport.ls +$SRC_H5LS_OUTFILES/tfloat16_be.ls +$SRC_H5LS_OUTFILES/tfloat16_be_nosupport.ls $SRC_H5LS_OUTFILES/tsoftlinks-1.ls $SRC_H5LS_OUTFILES/tsoftlinks-2.ls $SRC_H5LS_OUTFILES/tsoftlinks-3.ls @@ -367,9 +371,14 @@ TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thli # test for _Float16 type if test $HAVE__FLOAT16 = "yes" ; then - TOOLTEST tfloat16.ls 0 -w80 -v tfloat16.h5 + if test $WORDS_BIGENDIAN = "yes" ; then + TOOLTEST tfloat16_be.ls 0 -w80 -v tfloat16_be.h5 + else + TOOLTEST tfloat16.ls 0 -w80 -v tfloat16.h5 + fi else TOOLTEST tfloat16_nosupport.ls 0 -w80 -v tfloat16.h5 + TOOLTEST tfloat16_be_nosupport.ls 0 -w80 -v tfloat16_be.h5 fi # test for wildcards in filename (does not work with cmake) -- cgit v0.12