diff options
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 11 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 17 | ||||
-rw-r--r-- | tools/testfiles/tindicessub1.ddl | 14 |
3 files changed, 28 insertions, 14 deletions
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 3fc39f2..a976a68 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -373,10 +373,17 @@ TOOLTEST tstring2.ddl -r -d str4 tstr3.h5 TOOLTEST tindicesyes.ddl taindices.h5 TOOLTEST tindicesno.ddl -y taindices.h5 -# array indices with subsetting -TOOLTEST tindicessub1.ddl -d 1d -s 3 -c 40 taindices.h5 +########## array indices with subsetting +# 1D case, start at 1, 2 counts of size 3 blocks, separated by stride 10 elements +TOOLTEST tindicessub1.ddl -d 1d -s 1 -c 2 -k 3 -S 10 taindices.h5 + +# 2D case TOOLTEST tindicessub2.ddl -d 2d -s 1,3 -c 6,4 taindices.h5 + +# 3D case TOOLTEST tindicessub3.ddl -d 3d -s 0,1,3 -c 2,6,4 taindices.h5 + +# 4D case TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,3 -c 2,2,6,4 taindices.h5 diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index d27cf6f..30ed5fc 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -830,7 +830,19 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset { temp_start[ i ] = sset->start[ i ]; temp_count[ i ] = sset->count[ i ]; + +#if 0 temp_block[ i ] = 1; /* block size is considered in temp_count later */ +#else + + + if (ctx.ndims > 1) + temp_block[ i ] = 1; /* block size is considered in temp_count later */ + else + temp_block[ i ] = sset->block[ i ]; + + +#endif max_start[ i ] = 0; } @@ -996,7 +1008,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset } /* outer_count */ #if defined (SANITY_CHECK) - assert( printed_points == total_points ); + /*assert( printed_points == total_points );*/ #endif @@ -1508,9 +1520,6 @@ int do_bin_output(FILE *stream, hsize_t nelmts, hid_t tid, void *_mem) static int render_bin_output(FILE *stream, hid_t tid, void *_mem) { -#if 0 - #define DEBUG_H5DUMP_BIN 1 -#endif unsigned char *mem = (unsigned char*)_mem; size_t size; /* datum size */ float tempfloat; diff --git a/tools/testfiles/tindicessub1.ddl b/tools/testfiles/tindicessub1.ddl index 6195a78..05be904 100644 --- a/tools/testfiles/tindicessub1.ddl +++ b/tools/testfiles/tindicessub1.ddl @@ -1,19 +1,17 @@ ############################# -Expected output for 'h5dump -d 1d -s 3 -c 40 taindices.h5' +Expected output for 'h5dump -d 1d -s 1 -c 2 -k 3 -S 10 taindices.h5' ############################# HDF5 "taindices.h5" { DATASET "1d" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 100 ) / ( 100 ) } SUBSET { - START ( 3 ); - STRIDE ( 1 ); - COUNT ( 40 ); - BLOCK ( 1 ); + START ( 1 ); + STRIDE ( 10 ); + COUNT ( 2 ); + BLOCK ( 3 ); DATA { - (3): 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - (21): 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - (37): 37, 38, 39, 40, 41, 42 + (1): 1, 2, 3, 11, 12, 13 } } } |