From 3bd9ac725c8807150bf6ed8fe1cdd2f09d7a595e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Jul 2016 12:18:06 -0500 Subject: [svn-r30172] HDFFV-9953,9955: add new testfiles to h5dump (required for hdfview testing). These dataset types did not exist in other files. --- tools/h5dump/h5dumpgentest.c | 1045 +++++++++++++++++++++---------- tools/testfiles/tcompound_complex2.ddl | 1051 ++++++++++++++++++++++++++++++++ tools/testfiles/tcompound_complex2.h5 | Bin 0 -> 21880 bytes tools/testfiles/tvlenstr_array.ddl | 48 ++ tools/testfiles/tvlenstr_array.h5 | Bin 0 -> 6720 bytes 5 files changed, 1826 insertions(+), 318 deletions(-) create mode 100644 tools/testfiles/tcompound_complex2.ddl create mode 100644 tools/testfiles/tcompound_complex2.h5 create mode 100644 tools/testfiles/tvlenstr_array.ddl create mode 100644 tools/testfiles/tvlenstr_array.h5 diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 10b59f9..058ea90 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -111,6 +111,8 @@ #define FILE79 "tintsattrs.h5" #define FILE80 "tbitnopaque.h5" #define FILE81 "tints4dims.h5" +#define FILE82 "tcompound_complex2.h5" +#define FILE83 "tvlenstr_array.h5" /*------------------------------------------------------------------------- * prototypes @@ -263,20 +265,20 @@ typedef struct s1_t { #define F64_DIM1 (F64_ARRAY_BUF_LEN / sizeof(int) + 1) /* "FILE66" macros and for FILE69 */ -#define F66_XDIM 8 +#define F66_XDIM 8 #define F66_DATASETU08 "DU08BITS" #define F66_DATASETS08 "DS08BITS" -#define F66_YDIM8 8 +#define F66_YDIM8 8 #define F66_DATASETU16 "DU16BITS" #define F66_DATASETS16 "DS16BITS" -#define F66_YDIM16 16 +#define F66_YDIM16 16 #define F66_DATASETU32 "DU32BITS" #define F66_DATASETS32 "DS32BITS" -#define F66_YDIM32 32 +#define F66_YDIM32 32 #define F66_DATASETU64 "DU64BITS" #define F66_DATASETS64 "DS64BITS" #define F66_YDIM64 64 -#define F66_DUMMYDBL "DummyDBL" +#define F66_DUMMYDBL "DummyDBL" /* "FILE70" macros and for FILE71 */ /* Name of dataset to create in datafile */ @@ -351,6 +353,28 @@ typedef struct s1_t { #define F81_YDIM 6 #define F81_ZDIM 4 +/* "File 82" macros */ +/* Name of dataset to create in datafile */ +#define F82_DATASETNAME "CompoundComplex1D" +#define F82_DATASETNAME2 "CompoundComplex2D" +#define F82_DATASETNAME3 "CompoundComplex3D" +#define F82_DATASETNAME4 "CompoundComplex4D" +/* Dataset dimensions */ +#define F82_DIM32 32 +#define F82_RANK 1 +#define F82_RANK2 2 +#define F82_RANK3 3 +#define F82_RANK4 4 + +/* "File 83" macros */ +/* Name of dataset to create in datafile */ +#define F83_DATASETNAME "ScalarArrayOfVlenStr" +#define F83_DATASETNAME2 "CompoundArrayOfVlenStr" +/* Dataset dimensions */ +#define F83_DIM 5 +#define F83_RANK 1 +#define F83_ARRAYDIM 3 + static void gent_group(void) { @@ -428,7 +452,7 @@ gent_dataset(void) for(i = 0; i < 30; i++) for(j = 0; j < 20; j++) - dset2[i][j] = 0.0001F * j + i; + dset2[i][j] = 0.0001F * (float)j + (float)i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -523,7 +547,7 @@ gent_attribute(void) space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT); - for(i = 0; i < 10; i++) d[i] = 0.1F * i; + for(i = 0; i < 10; i++) d[i] = 0.1F * (float)i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space); @@ -567,7 +591,7 @@ static void gent_softlink(void) * Function: gent_softlink2 * * Purpose: Create soft links to various objects. - * Return: + * Return: * SUCCEED * FAIL * Programmer: Jonathan Kim @@ -581,7 +605,7 @@ static int gent_softlink2(void) hid_t gid1 = -1, gid2 = -1; hid_t datatype = -1; hid_t dset1 = -1, dset2 = -1; - hid_t dataspace = -1; + hid_t dataspace = -1; hsize_t dimsf[2]; /* dataset dimensions */ int data1[NX][NY] = {{0,0},{1,1},{2,2},{3,3}}; int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}}; @@ -625,7 +649,7 @@ static int gent_softlink2(void) status = H5Tcommit2(fileid1, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", FILE4_1); status = FAIL; goto out; } @@ -951,16 +975,16 @@ static void gent_compound_dt(void) { /* test compound data type */ for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); - dset1[i].c = (float)(1.0F/(i+1)); + dset1[i].c = (float)(1.0F/(float)(i+1)); dset2[i].a = i; - dset2[i].b = (float)(i+ i*0.1F); + dset2[i].b = (float)((float)i+ (float)i*0.1F); dset4[i].a = i; dset4[i].b = (float)(i+3); dset5[i].a = i; - dset5[i].b = (float)(i*0.1F); + dset5[i].b = (float)((float)i*0.1F); } @@ -1136,16 +1160,16 @@ static void gent_compound_dt2(void) { /* test compound data type */ for(i = 0; i < (int)sdim; i++) { dset1[i].a = i; dset1[i].b = (float)(i*i); - dset1[i].c = (float)(1.0F/(i+1)); + dset1[i].c = (float)(1.0F / (float)(i+ 1)); dset2[i].a = i; - dset2[i].b = (float)(i+ i*0.1F); + dset2[i].b = (float)((float)i + (float)i * 0.1F); dset4[i].a = i; - dset4[i].b = (float)(i*1.0F); + dset4[i].b = (float)((float)i * 1.0F); dset5[i].a = i; - dset5[i].b = (float)(i*1.0F); + dset5[i].b = (float)((float)i * 1.0F); } fid = H5Fcreate(FILE9, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1385,7 +1409,7 @@ static void gent_all(void) space = H5Screate_simple(1, dims, NULL); dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - dset2_1[i] = (float)(i * 0.1F + 1); + dset2_1[i] = (float)((float)i * 0.1F + 1); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); @@ -1396,7 +1420,7 @@ static void gent_all(void) dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 3; i++) for(j = 0; j < 5; j++) - dset2_2[i][j] = (float)((i + 1) * j * 0.1F); + dset2_2[i][j] = (float)((float)(i + 1) * (float)j * 0.1F); H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2); H5Sclose(space); H5Dclose(dataset); @@ -1564,7 +1588,7 @@ gent_many(void) space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - d[i] = 0.1F * i; + d[i] = 0.1F * (float)i; H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space2); H5Aclose(attr); @@ -1574,9 +1598,9 @@ gent_many(void) for(i2 = 0; i2 < 2; i2++) { for(i1 = 0; i1 < 2; i1++) { for(i0 = 0; i0 < 2; i0++) { - dset1[j].a[i3][i2][i1][i0] = i0+j; - dset1[j].b[i3][i2][i1][i0] = (double)(i0+j); - dset1[j].c[i3][i2][i1][i0] = (double)(i0+j+sdim); + dset1[j].a[i3][i2][i1][i0] = i0 + j; + dset1[j].b[i3][i2][i1][i0] = (double)(i0 + j); + dset1[j].c[i3][i2][i1][i0] = (double)((hsize_t)i0 + (hsize_t)j + sdim); } } } @@ -1879,7 +1903,7 @@ static void gent_str2(void) block[0]=1; for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1892,7 +1916,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1912,7 +1936,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0;(hsize_t) i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1926,7 +1950,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1945,7 +1969,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); H5Tset_size(memtype, HDstrlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -1959,7 +1983,7 @@ static void gent_str2(void) dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; + start[0] = (hsize_t)i; sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); H5Tset_size(memtype, HDstrlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); @@ -2045,7 +2069,7 @@ static void gent_objref(void) dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu32 = (uint32_t *)((void*)wbuf), i = 0; i < SPACE1_DIM1; i++) - *tu32++ = i * 3; + *tu32++ = (uint32_t)(i * 3); /* Write selection to disk */ H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); @@ -2150,7 +2174,7 @@ static void gent_datareg(void) dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) - *tu8++=i*3; + *tu8++ = (uint8_t)(i * 3); /* Write selection to disk */ H5Dwrite(dset2, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); @@ -2259,7 +2283,7 @@ static void gent_attrreg(void) dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++) - *tu8++=i*3; + *tu8++ = (uint8_t)(i * 3); /* Write selection to disk */ H5Dwrite(dset2, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); @@ -2377,8 +2401,8 @@ static void gent_nestcomp(void) for(i = 0; i< 10; i++) { s1[i].a = i; s1[i].b = (float)(i*i); - s1[i].c = 1.0F/(i+1); - s1[i].d.a = 65 + i; + s1[i].c = 1.0F/(float)(i + 1); + s1[i].d.a = (char)(65 + i); s1[i].d.b[0] = -100.0F; s1[i].d.b[1] = 100.0F; } @@ -2449,8 +2473,8 @@ static void gent_opaque(void) hsize_t dim = 2; for(x = 0; x < 100; x++){ - test[x][0] = x; - test[x][1] = 99 - x; + test[x][0] = (char)x; + test[x][1] = (char)(99 - x); } /* @@ -2550,8 +2574,8 @@ static void gent_vldatatypes(void) for(i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((i + 1) * sizeof(int)); - wdata[i].len = i + 1; + wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + wdata[i].len = (size_t)(i + 1); for(j = 0; j < i + 1; j++) ((int *)wdata[i].p)[j] = i * 10 + j; @@ -2577,12 +2601,12 @@ static void gent_vldatatypes(void) for(i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((i + 1) * sizeof(float)); - wdata[i].len = i + 1; + wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(float)); + wdata[i].len = (size_t)(i + 1); for(j = 0; j < i + 1; j++) - ((float *)wdata[i].p)[j] = (float)(i * 10 + ((float)j) / 10.0F); - } + ((float *)wdata[i].p)[j] = (float)((float)(i * 10) + ((float)j) / 10.0F); + } /* end for */ /* write out the floats in little-endian format */ space = H5Screate_simple(SPACE1_RANK, dims, NULL); @@ -2699,9 +2723,9 @@ gent_vldatatypes2(void) static void gent_vldatatypes3(void) { typedef struct { /* Struct that the VL sequences are composed of */ - int i; - float f; - hvl_t v; + int i; + float f; + hvl_t v; } s1; s1 wdata[SPACE1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -2714,12 +2738,12 @@ static void gent_vldatatypes3(void) /* Allocate and initialize VL data to write */ for(i=0; i 0) based on 2000x1000 dims. */ #define SPACE_ARRAY1BIG_DIM 2000 @@ -2944,7 +2968,7 @@ static void gent_array1_big(void) fid1 = H5Fcreate(FILE25_BIG, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*------------------------- - * Array type dataset + * Array type dataset */ /* Create dataspace for datasets */ sid1 = H5Screate_simple(SPACE1_RANK, sdims1, NULL); @@ -2960,7 +2984,7 @@ static void gent_array1_big(void) HDassert(ret >= 0); /*--------------------------- - * Region Reference dataset + * Region Reference dataset */ /* Create dataspace for the reference dataset */ sid2 = H5Screate_simple(SPACE1_RANK, dims2, NULL); @@ -3157,8 +3181,8 @@ static void gent_array4(void) /* Initialize array data to write */ for(i=0; i= 0) { + /* CompoundComplex1D */ + if ((type = H5Tcreate(H5T_COMPOUND, sizeof(compound))) >= 0) { + /* Insert top-level array members */ + dset_array_ndims = 1; dset_array_a_dims[0] = 4; + dset_array_a = H5Tarray_create2(H5T_STD_U32LE, dset_array_ndims, dset_array_a_dims); + H5Tinsert(type, "a", HOFFSET(compound, a), dset_array_a); + H5Tclose(dset_array_a); + + dset_array_ndims = 1; dset_array_b_dims[0] = 6; + dset_array_b = H5Tarray_create2(H5T_STD_I32LE, dset_array_ndims, dset_array_b_dims); + H5Tinsert(type, "b", HOFFSET(compound, b), dset_array_b); + H5Tclose(dset_array_b); + + dset_array_ndims = 2; dset_array_c_dims[0] = 2; dset_array_c_dims[1] = 4; + dset_array_c = H5Tarray_create2(H5T_IEEE_F32LE, dset_array_ndims, dset_array_c_dims); + H5Tinsert(type, "c", HOFFSET(compound, c), dset_array_c); + H5Tclose(dset_array_c); + + /* Insert first nested compound */ + hid_t str_type, array; + hsize_t dims[1]; + cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(nested_compound)); + + H5Tinsert(cmpd_tid1, "nested_double", HOFFSET(nested_compound, nested_a), H5T_IEEE_F64LE); + + dims[0] = 1; + str_type = mkstr(23, H5T_STR_NULLTERM); + array = H5Tarray_create2(str_type, 1, dims); + H5Tinsert(cmpd_tid1, "nested_string", HOFFSET(nested_compound, nested_string), array); + H5Tclose(array); + H5Tclose(str_type); + + dims[0] = 4; + str_type = mkstr(12, H5T_STR_NULLTERM); + array = H5Tarray_create2(str_type, 1, dims); + H5Tinsert(cmpd_tid1, "nested_string_array", HOFFSET(nested_compound, nested_string_array), array); + H5Tclose(array); + H5Tclose(str_type); + + H5Tinsert(type, "nested_compound", HOFFSET(compound, d), cmpd_tid1); + + /* Insert second nested compound */ + hid_t nest1, nest2; + cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(multiple_nested_compound)); + + H5Tinsert(cmpd_tid2, "nested_float", HOFFSET(multiple_nested_compound, a), H5T_IEEE_F32LE); + + /* Add first further nested compound */ + nest1 = H5Tcreate(H5T_COMPOUND, sizeof(further_nested)); + + dims[0] = 5; + array = H5Tarray_create2(H5T_STD_U32LE, 1, dims); + H5Tinsert(nest1, "nested_unsigned_int", HOFFSET(further_nested, multiple_nested_a), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_STD_I32LE, 1, dims); + H5Tinsert(nest1, "nested_int", HOFFSET(further_nested, multiple_nested_b), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_STD_U64LE, 1, dims); + H5Tinsert(nest1, "nested_unsigned_long", HOFFSET(further_nested, multiple_nested_c), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_STD_I64LE, 1, dims); + H5Tinsert(nest1, "nested_long", HOFFSET(further_nested, multiple_nested_d), array); + H5Tclose(array); + + H5Tinsert(cmpd_tid2, "further_nested_compoundA", HOFFSET(multiple_nested_compound, b), nest1); + H5Tclose(nest1); + + /* Add second further nested compound */ + nest2 = H5Tcreate(H5T_COMPOUND, sizeof(further_nested2)); + + dims[0] = 1; + str_type = mkstr(11, H5T_STR_NULLTERM); + array = H5Tarray_create2(str_type, 1, dims); + H5Tinsert(nest2, "nested_string", HOFFSET(further_nested2, further_nested_string), array); + H5Tclose(array); + H5Tclose(str_type); + + dims[0] = 4; + str_type = mkstr(13, H5T_STR_NULLTERM); + array = H5Tarray_create2(str_type, 1, dims); + H5Tinsert(nest2, "nested_string_array", HOFFSET(further_nested2, further_nested_string_array), array); + H5Tclose(array); + H5Tclose(str_type); + + /* Add a final third-level nested compound to this second-level compound */ + cmpd_tid3 = H5Tcreate(H5T_COMPOUND, sizeof(third_level_compound)); + + dims[0] = 10; + array = H5Tarray_create2(H5T_STD_I16LE, 1, dims); + H5Tinsert(cmpd_tid3, "deep_nested_short", HOFFSET(third_level_compound, deep_nested_short), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_STD_I32LE, 1, dims); + H5Tinsert(cmpd_tid3, "deep_nested_int", HOFFSET(third_level_compound, deep_nested_int), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_STD_I64LE, 1, dims); + H5Tinsert(cmpd_tid3, "deep_nested_long", HOFFSET(third_level_compound, deep_nested_long), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_IEEE_F64LE, 1, dims); + H5Tinsert(cmpd_tid3, "deep_nested_double", HOFFSET(third_level_compound, deep_nested_double), array); + H5Tclose(array); + + array = H5Tarray_create2(H5T_IEEE_F32LE, 1, dims); + H5Tinsert(cmpd_tid3, "deep_nested_float", HOFFSET(third_level_compound, deep_nested_float), array); + H5Tclose(array); + + H5Tinsert(nest2, "deep_nested_compound", HOFFSET(further_nested2, deep_nest), cmpd_tid3); + + H5Tinsert(cmpd_tid2, "further_nested_compoundB", HOFFSET(multiple_nested_compound, c), nest2); + H5Tclose(nest2); + + H5Tinsert(type, "multiple_nested_compound", HOFFSET(compound, e), cmpd_tid2); + + + if ((dset = H5Dcreate2(file, F82_DATASETNAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + for(i = 0; i < nelmts; i++) { + for (j = 0; j < dset_array_a_dims[0]; j++) + buf[i].a[j] = (unsigned int)(j + i*10); + for (j = 0; j < dset_array_b_dims[0]; j++) + buf[i].b[j] = (int)(j - i*10); + for (j = 0; j < dset_array_c_dims[0]; j++) + for (k = 0; k < dset_array_c_dims[1]; k++) + buf[i].c[j][k] = (float)(j + k + i*10) + (float)(j) * 0.1F; + + /* Set up first nested compound */ + buf[i].d.nested_a = (double) i; + + strcpy(buf[i].d.nested_string, "This is a test string."); + + for (j = 0; j < 4; j++) + strcpy(buf[i].d.nested_string_array[j], "String test"); + + /* Set up multiple nested compound */ + buf[i].e.a = (float) i; + + for (j = 0; j < 5; j++) { + buf[i].e.b.multiple_nested_a[j] = (unsigned int)(j + i*10); + buf[i].e.b.multiple_nested_b[j] = (int)(j - i*10); + buf[i].e.b.multiple_nested_c[j] = (unsigned long)(j + i*10); + buf[i].e.b.multiple_nested_d[j] = (long)(j - i*10); + } + + strcpy(buf[i].e.c.further_nested_string, "1234567890"); + for (j = 0; j < 4; j++) + strcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY"); + + for (j = 0; j < 10; j++) { + buf[i].e.c.deep_nest.deep_nested_short[j] = (short)(j + i*10); + buf[i].e.c.deep_nest.deep_nested_int[j] = (int)(j - i*10); + buf[i].e.c.deep_nest.deep_nested_long[j] = (long)(j + i*10); + buf[i].e.c.deep_nest.deep_nested_double[j] = (double)(j + i*10); + buf[i].e.c.deep_nest.deep_nested_float[j] = (float)(j + i*10); + } + } + + if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + fprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n"); + + H5Dclose(dset); + } + H5Tclose(type); + } + H5Tclose(cmpd_tid1); + H5Tclose(cmpd_tid2); + H5Tclose(cmpd_tid3); + H5Sclose(space); + } + +// /* CompoundComplex2D */ +// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { +// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); +// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); +// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); +// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); +// if ((space = H5Screate_simple(F82_RANK2, &nelmts, NULL)) >= 0) { +// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { +// for(i = 0; i < nelmts; i++) { +// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; +// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); +// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); +// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); +// } +// +// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); +// H5Dclose(dset); +// } +// H5Sclose(space); +// } +// H5Tclose(type); +// } +// +// /* CompoundComplex3D */ +// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { +// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); +// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); +// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); +// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); +// if ((space = H5Screate_simple(F82_RANK3, &nelmts, NULL)) >= 0) { +// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { +// for(i = 0; i < nelmts; i++) { +// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; +// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); +// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); +// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); +// } +// +// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); +// H5Dclose(dset); +// } +// H5Sclose(space); +// } +// H5Tclose(type); +// } +// +// /* CompoundComplex4D */ +// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) { +// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE); +// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE); +// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE); +// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE); +// if ((space = H5Screate_simple(F82_RANK4, &nelmts, NULL)) >= 0) { +// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { +// for(i = 0; i < nelmts; i++) { +// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i; +// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16); +// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32); +// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64); +// } +// +// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); +// H5Dclose(dset); +// } +// H5Sclose(space); +// } +// H5Tclose(type); +// } + + H5Fclose(file); +} + +/*------------------------------------------------------------------------- + * Function: gent_vlenstr_array + * + * Purpose: Generate a file to be used in testing Arrays of variable + * length strings. + *------------------------------------------------------------------------- + */ +static void gent_vlenstr_array(void) +{ + /* Compound datatype with different member types */ + typedef struct compound + { + /* Array of variable-length strings*/ + const char *vlen_array[F83_ARRAYDIM]; + } compound; + compound buf[F83_DIM]; + + const char *test[F83_ARRAYDIM] = { + "This is a variable-length test string.", + "This test string is also variable-length.", + "A final test of variable-length strings. This string is longer than the others." + }; + const char *buffer[F83_DIM*F83_ARRAYDIM]; + + hid_t file, type=-1, space=-1, dset=-1; + hid_t cmpd_tid1, array_tid; + int i, j; + + hsize_t dims[] = {F83_DIM}, arraydim[] = {F83_ARRAYDIM}; + /* Initialize scalar data */ + for (i = 0; i < F83_DIM; i++) + for (j = 0; j < 3; j++) + buffer[j + 3*i] = test[j]; + + /* Initialize compound data */ + for (i = 0; i < F83_DIM; i++) + for (j = 0; j < 3; j++) + buf[i].vlen_array[j] = test[j]; + + file = H5Fcreate(FILE83, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + if ((space = H5Screate_simple(F83_RANK, dims, NULL)) >= 0) { + array_tid = H5Tcopy(H5T_C_S1); + H5Tset_size(array_tid, H5T_VARIABLE); + + /* ScalarArrayOfVlenStr */ + if ((type = H5Tarray_create2(array_tid, F83_RANK, arraydim)) >= 0) { + if ((dset = H5Dcreate2(file, F83_DATASETNAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer) < 0) + fprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); + + H5Dclose(dset); + } + H5Tclose(type); + } + H5Tclose(array_tid); + H5Sclose(space); + } + + if ((space = H5Screate_simple(F83_RANK, dims, NULL)) >= 0) { + /* CompoundArrayOfVlenStr */ + if ((type = H5Tcreate(H5T_COMPOUND, sizeof(compound))) >= 0) { + cmpd_tid1 = H5Tcopy(H5T_C_S1); + H5Tset_size(cmpd_tid1, H5T_VARIABLE); + + array_tid = H5Tarray_create2(cmpd_tid1, F83_RANK, arraydim); + H5Tinsert(type, "vlen_str_array", HOFFSET(compound, vlen_array), array_tid); + + if ((dset = H5Dcreate2(file, F83_DATASETNAME2, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + fprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); + + H5Dclose(dset); + } + H5Tclose(cmpd_tid1); + H5Tclose(type); + } + H5Sclose(space); + } + + H5Fclose(file); +} + /*------------------------------------------------------------------------- * Function: main @@ -9779,9 +10186,11 @@ int main(void) gent_multi(); gent_large_objname(); gent_vlstr(); + gent_vlenstr_array(); gent_char(); gent_attr_all(); gent_compound_complex(); + gent_compound_complex2(); gent_named_dtype_attr(); gent_null_space(); gent_zero_dim_size(); diff --git a/tools/testfiles/tcompound_complex2.ddl b/tools/testfiles/tcompound_complex2.ddl new file mode 100644 index 0000000..562235d --- /dev/null +++ b/tools/testfiles/tcompound_complex2.ddl @@ -0,0 +1,1051 @@ +HDF5 "tcompound_complex2.h5" { +GROUP "/" { + DATASET "CompoundComplex1D" { + DATATYPE H5T_COMPOUND { + H5T_ARRAY { [4] H5T_STD_U32LE } "a"; + H5T_ARRAY { [6] H5T_STD_I32LE } "b"; + H5T_ARRAY { [2][4] H5T_IEEE_F32LE } "c"; + H5T_COMPOUND { + H5T_IEEE_F64LE "nested_double"; + H5T_ARRAY { [1] H5T_STRING { + STRSIZE 23; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } } "nested_string"; + H5T_ARRAY { [4] H5T_STRING { + STRSIZE 12; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } } "nested_string_array"; + } "nested_compound"; + H5T_COMPOUND { + H5T_IEEE_F32LE "nested_float"; + H5T_COMPOUND { + H5T_ARRAY { [5] H5T_STD_U32LE } "nested_unsigned_int"; + H5T_ARRAY { [5] H5T_STD_I32LE } "nested_int"; + H5T_ARRAY { [5] H5T_STD_U64LE } "nested_unsigned_long"; + H5T_ARRAY { [5] H5T_STD_I64LE } "nested_long"; + } "further_nested_compoundA"; + H5T_COMPOUND { + H5T_ARRAY { [1] H5T_STRING { + STRSIZE 11; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } } "nested_string"; + H5T_ARRAY { [4] H5T_STRING { + STRSIZE 13; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } } "nested_string_array"; + H5T_COMPOUND { + H5T_ARRAY { [10] H5T_STD_I16LE } "deep_nested_short"; + H5T_ARRAY { [10] H5T_STD_I32LE } "deep_nested_int"; + H5T_ARRAY { [10] H5T_STD_I64LE } "deep_nested_long"; + H5T_ARRAY { [10] H5T_IEEE_F64LE } "deep_nested_double"; + H5T_ARRAY { [10] H5T_IEEE_F32LE } "deep_nested_float"; + } "deep_nested_compound"; + } "further_nested_compoundB"; + } "multiple_nested_compound"; + } + DATASPACE SIMPLE { ( 32 ) / ( 32 ) } + DATA { + (0): { + [ 0, 1, 2, 3 ], + [ 0, 1, 2, 3, 4, 5 ], + [ 0, 1, 2, 3, + 1.1, 2.1, 3.1, 4.1 ], + { + 0, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 0, + { + [ 0, 1, 2, 3, 4 ], + [ 0, 1, 2, 3, 4 ], + [ 0, 1, 2, 3, 4 ], + [ 0, 1, 2, 3, 4 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], + [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] + } + } + } + }, + (1): { + [ 10, 11, 12, 13 ], + [ -10, -9, -8, -7, -6, -5 ], + [ 10, 11, 12, 13, + 11.1, 12.1, 13.1, 14.1 ], + { + 1, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 1, + { + [ 10, 11, 12, 13, 14 ], + [ -10, -9, -8, -7, -6 ], + [ 10, 11, 12, 13, 14 ], + [ -10, -9, -8, -7, -6 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ], + [ -10, -9, -8, -7, -6, -5, -4, -3, -2, -1 ], + [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ], + [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ], + [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ] + } + } + } + }, + (2): { + [ 20, 21, 22, 23 ], + [ -20, -19, -18, -17, -16, -15 ], + [ 20, 21, 22, 23, + 21.1, 22.1, 23.1, 24.1 ], + { + 2, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 2, + { + [ 20, 21, 22, 23, 24 ], + [ -20, -19, -18, -17, -16 ], + [ 20, 21, 22, 23, 24 ], + [ -20, -19, -18, -17, -16 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ], + [ -20, -19, -18, -17, -16, -15, -14, -13, -12, -11 ], + [ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ], + [ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ], + [ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ] + } + } + } + }, + (3): { + [ 30, 31, 32, 33 ], + [ -30, -29, -28, -27, -26, -25 ], + [ 30, 31, 32, 33, + 31.1, 32.1, 33.1, 34.1 ], + { + 3, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 3, + { + [ 30, 31, 32, 33, 34 ], + [ -30, -29, -28, -27, -26 ], + [ 30, 31, 32, 33, 34 ], + [ -30, -29, -28, -27, -26 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ], + [ -30, -29, -28, -27, -26, -25, -24, -23, -22, -21 ], + [ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ], + [ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ], + [ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ] + } + } + } + }, + (4): { + [ 40, 41, 42, 43 ], + [ -40, -39, -38, -37, -36, -35 ], + [ 40, 41, 42, 43, + 41.1, 42.1, 43.1, 44.1 ], + { + 4, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 4, + { + [ 40, 41, 42, 43, 44 ], + [ -40, -39, -38, -37, -36 ], + [ 40, 41, 42, 43, 44 ], + [ -40, -39, -38, -37, -36 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 ], + [ -40, -39, -38, -37, -36, -35, -34, -33, -32, -31 ], + [ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 ], + [ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 ], + [ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 ] + } + } + } + }, + (5): { + [ 50, 51, 52, 53 ], + [ -50, -49, -48, -47, -46, -45 ], + [ 50, 51, 52, 53, + 51.1, 52.1, 53.1, 54.1 ], + { + 5, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 5, + { + [ 50, 51, 52, 53, 54 ], + [ -50, -49, -48, -47, -46 ], + [ 50, 51, 52, 53, 54 ], + [ -50, -49, -48, -47, -46 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ], + [ -50, -49, -48, -47, -46, -45, -44, -43, -42, -41 ], + [ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ], + [ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ], + [ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ] + } + } + } + }, + (6): { + [ 60, 61, 62, 63 ], + [ -60, -59, -58, -57, -56, -55 ], + [ 60, 61, 62, 63, + 61.1, 62.1, 63.1, 64.1 ], + { + 6, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 6, + { + [ 60, 61, 62, 63, 64 ], + [ -60, -59, -58, -57, -56 ], + [ 60, 61, 62, 63, 64 ], + [ -60, -59, -58, -57, -56 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 ], + [ -60, -59, -58, -57, -56, -55, -54, -53, -52, -51 ], + [ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 ], + [ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 ], + [ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 ] + } + } + } + }, + (7): { + [ 70, 71, 72, 73 ], + [ -70, -69, -68, -67, -66, -65 ], + [ 70, 71, 72, 73, + 71.1, 72.1, 73.1, 74.1 ], + { + 7, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 7, + { + [ 70, 71, 72, 73, 74 ], + [ -70, -69, -68, -67, -66 ], + [ 70, 71, 72, 73, 74 ], + [ -70, -69, -68, -67, -66 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 ], + [ -70, -69, -68, -67, -66, -65, -64, -63, -62, -61 ], + [ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 ], + [ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 ], + [ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 ] + } + } + } + }, + (8): { + [ 80, 81, 82, 83 ], + [ -80, -79, -78, -77, -76, -75 ], + [ 80, 81, 82, 83, + 81.1, 82.1, 83.1, 84.1 ], + { + 8, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 8, + { + [ 80, 81, 82, 83, 84 ], + [ -80, -79, -78, -77, -76 ], + [ 80, 81, 82, 83, 84 ], + [ -80, -79, -78, -77, -76 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 ], + [ -80, -79, -78, -77, -76, -75, -74, -73, -72, -71 ], + [ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 ], + [ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 ], + [ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 ] + } + } + } + }, + (9): { + [ 90, 91, 92, 93 ], + [ -90, -89, -88, -87, -86, -85 ], + [ 90, 91, 92, 93, + 91.1, 92.1, 93.1, 94.1 ], + { + 9, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 9, + { + [ 90, 91, 92, 93, 94 ], + [ -90, -89, -88, -87, -86 ], + [ 90, 91, 92, 93, 94 ], + [ -90, -89, -88, -87, -86 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ], + [ -90, -89, -88, -87, -86, -85, -84, -83, -82, -81 ], + [ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ], + [ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ], + [ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ] + } + } + } + }, + (10): { + [ 100, 101, 102, 103 ], + [ -100, -99, -98, -97, -96, -95 ], + [ 100, 101, 102, 103, + 101.1, 102.1, 103.1, 104.1 ], + { + 10, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 10, + { + [ 100, 101, 102, 103, 104 ], + [ -100, -99, -98, -97, -96 ], + [ 100, 101, 102, 103, 104 ], + [ -100, -99, -98, -97, -96 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], + [ -100, -99, -98, -97, -96, -95, -94, -93, -92, -91 ], + [ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], + [ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], + [ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ] + } + } + } + }, + (11): { + [ 110, 111, 112, 113 ], + [ -110, -109, -108, -107, -106, -105 ], + [ 110, 111, 112, 113, + 111.1, 112.1, 113.1, 114.1 ], + { + 11, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 11, + { + [ 110, 111, 112, 113, 114 ], + [ -110, -109, -108, -107, -106 ], + [ 110, 111, 112, 113, 114 ], + [ -110, -109, -108, -107, -106 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ], + [ -110, -109, -108, -107, -106, -105, -104, -103, -102, -101 ], + [ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ], + [ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ], + [ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ] + } + } + } + }, + (12): { + [ 120, 121, 122, 123 ], + [ -120, -119, -118, -117, -116, -115 ], + [ 120, 121, 122, 123, + 121.1, 122.1, 123.1, 124.1 ], + { + 12, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 12, + { + [ 120, 121, 122, 123, 124 ], + [ -120, -119, -118, -117, -116 ], + [ 120, 121, 122, 123, 124 ], + [ -120, -119, -118, -117, -116 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 ], + [ -120, -119, -118, -117, -116, -115, -114, -113, -112, -111 ], + [ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 ], + [ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 ], + [ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 ] + } + } + } + }, + (13): { + [ 130, 131, 132, 133 ], + [ -130, -129, -128, -127, -126, -125 ], + [ 130, 131, 132, 133, + 131.1, 132.1, 133.1, 134.1 ], + { + 13, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 13, + { + [ 130, 131, 132, 133, 134 ], + [ -130, -129, -128, -127, -126 ], + [ 130, 131, 132, 133, 134 ], + [ -130, -129, -128, -127, -126 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 ], + [ -130, -129, -128, -127, -126, -125, -124, -123, -122, -121 ], + [ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 ], + [ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 ], + [ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 ] + } + } + } + }, + (14): { + [ 140, 141, 142, 143 ], + [ -140, -139, -138, -137, -136, -135 ], + [ 140, 141, 142, 143, + 141.1, 142.1, 143.1, 144.1 ], + { + 14, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 14, + { + [ 140, 141, 142, 143, 144 ], + [ -140, -139, -138, -137, -136 ], + [ 140, 141, 142, 143, 144 ], + [ -140, -139, -138, -137, -136 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149 ], + [ -140, -139, -138, -137, -136, -135, -134, -133, -132, -131 ], + [ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149 ], + [ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149 ], + [ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149 ] + } + } + } + }, + (15): { + [ 150, 151, 152, 153 ], + [ -150, -149, -148, -147, -146, -145 ], + [ 150, 151, 152, 153, + 151.1, 152.1, 153.1, 154.1 ], + { + 15, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 15, + { + [ 150, 151, 152, 153, 154 ], + [ -150, -149, -148, -147, -146 ], + [ 150, 151, 152, 153, 154 ], + [ -150, -149, -148, -147, -146 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 ], + [ -150, -149, -148, -147, -146, -145, -144, -143, -142, -141 ], + [ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 ], + [ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 ], + [ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 ] + } + } + } + }, + (16): { + [ 160, 161, 162, 163 ], + [ -160, -159, -158, -157, -156, -155 ], + [ 160, 161, 162, 163, + 161.1, 162.1, 163.1, 164.1 ], + { + 16, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 16, + { + [ 160, 161, 162, 163, 164 ], + [ -160, -159, -158, -157, -156 ], + [ 160, 161, 162, 163, 164 ], + [ -160, -159, -158, -157, -156 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169 ], + [ -160, -159, -158, -157, -156, -155, -154, -153, -152, -151 ], + [ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169 ], + [ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169 ], + [ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169 ] + } + } + } + }, + (17): { + [ 170, 171, 172, 173 ], + [ -170, -169, -168, -167, -166, -165 ], + [ 170, 171, 172, 173, + 171.1, 172.1, 173.1, 174.1 ], + { + 17, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 17, + { + [ 170, 171, 172, 173, 174 ], + [ -170, -169, -168, -167, -166 ], + [ 170, 171, 172, 173, 174 ], + [ -170, -169, -168, -167, -166 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 170, 171, 172, 173, 174, 175, 176, 177, 178, 179 ], + [ -170, -169, -168, -167, -166, -165, -164, -163, -162, -161 ], + [ 170, 171, 172, 173, 174, 175, 176, 177, 178, 179 ], + [ 170, 171, 172, 173, 174, 175, 176, 177, 178, 179 ], + [ 170, 171, 172, 173, 174, 175, 176, 177, 178, 179 ] + } + } + } + }, + (18): { + [ 180, 181, 182, 183 ], + [ -180, -179, -178, -177, -176, -175 ], + [ 180, 181, 182, 183, + 181.1, 182.1, 183.1, 184.1 ], + { + 18, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 18, + { + [ 180, 181, 182, 183, 184 ], + [ -180, -179, -178, -177, -176 ], + [ 180, 181, 182, 183, 184 ], + [ -180, -179, -178, -177, -176 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 ], + [ -180, -179, -178, -177, -176, -175, -174, -173, -172, -171 ], + [ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 ], + [ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 ], + [ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 ] + } + } + } + }, + (19): { + [ 190, 191, 192, 193 ], + [ -190, -189, -188, -187, -186, -185 ], + [ 190, 191, 192, 193, + 191.1, 192.1, 193.1, 194.1 ], + { + 19, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 19, + { + [ 190, 191, 192, 193, 194 ], + [ -190, -189, -188, -187, -186 ], + [ 190, 191, 192, 193, 194 ], + [ -190, -189, -188, -187, -186 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 ], + [ -190, -189, -188, -187, -186, -185, -184, -183, -182, -181 ], + [ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 ], + [ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 ], + [ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 ] + } + } + } + }, + (20): { + [ 200, 201, 202, 203 ], + [ -200, -199, -198, -197, -196, -195 ], + [ 200, 201, 202, 203, + 201.1, 202.1, 203.1, 204.1 ], + { + 20, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 20, + { + [ 200, 201, 202, 203, 204 ], + [ -200, -199, -198, -197, -196 ], + [ 200, 201, 202, 203, 204 ], + [ -200, -199, -198, -197, -196 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 ], + [ -200, -199, -198, -197, -196, -195, -194, -193, -192, -191 ], + [ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 ], + [ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 ], + [ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209 ] + } + } + } + }, + (21): { + [ 210, 211, 212, 213 ], + [ -210, -209, -208, -207, -206, -205 ], + [ 210, 211, 212, 213, + 211.1, 212.1, 213.1, 214.1 ], + { + 21, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 21, + { + [ 210, 211, 212, 213, 214 ], + [ -210, -209, -208, -207, -206 ], + [ 210, 211, 212, 213, 214 ], + [ -210, -209, -208, -207, -206 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219 ], + [ -210, -209, -208, -207, -206, -205, -204, -203, -202, -201 ], + [ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219 ], + [ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219 ], + [ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219 ] + } + } + } + }, + (22): { + [ 220, 221, 222, 223 ], + [ -220, -219, -218, -217, -216, -215 ], + [ 220, 221, 222, 223, + 221.1, 222.1, 223.1, 224.1 ], + { + 22, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 22, + { + [ 220, 221, 222, 223, 224 ], + [ -220, -219, -218, -217, -216 ], + [ 220, 221, 222, 223, 224 ], + [ -220, -219, -218, -217, -216 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229 ], + [ -220, -219, -218, -217, -216, -215, -214, -213, -212, -211 ], + [ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229 ], + [ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229 ], + [ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229 ] + } + } + } + }, + (23): { + [ 230, 231, 232, 233 ], + [ -230, -229, -228, -227, -226, -225 ], + [ 230, 231, 232, 233, + 231.1, 232.1, 233.1, 234.1 ], + { + 23, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 23, + { + [ 230, 231, 232, 233, 234 ], + [ -230, -229, -228, -227, -226 ], + [ 230, 231, 232, 233, 234 ], + [ -230, -229, -228, -227, -226 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239 ], + [ -230, -229, -228, -227, -226, -225, -224, -223, -222, -221 ], + [ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239 ], + [ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239 ], + [ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239 ] + } + } + } + }, + (24): { + [ 240, 241, 242, 243 ], + [ -240, -239, -238, -237, -236, -235 ], + [ 240, 241, 242, 243, + 241.1, 242.1, 243.1, 244.1 ], + { + 24, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 24, + { + [ 240, 241, 242, 243, 244 ], + [ -240, -239, -238, -237, -236 ], + [ 240, 241, 242, 243, 244 ], + [ -240, -239, -238, -237, -236 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249 ], + [ -240, -239, -238, -237, -236, -235, -234, -233, -232, -231 ], + [ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249 ], + [ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249 ], + [ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249 ] + } + } + } + }, + (25): { + [ 250, 251, 252, 253 ], + [ -250, -249, -248, -247, -246, -245 ], + [ 250, 251, 252, 253, + 251.1, 252.1, 253.1, 254.1 ], + { + 25, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 25, + { + [ 250, 251, 252, 253, 254 ], + [ -250, -249, -248, -247, -246 ], + [ 250, 251, 252, 253, 254 ], + [ -250, -249, -248, -247, -246 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 250, 251, 252, 253, 254, 255, 256, 257, 258, 259 ], + [ -250, -249, -248, -247, -246, -245, -244, -243, -242, -241 ], + [ 250, 251, 252, 253, 254, 255, 256, 257, 258, 259 ], + [ 250, 251, 252, 253, 254, 255, 256, 257, 258, 259 ], + [ 250, 251, 252, 253, 254, 255, 256, 257, 258, 259 ] + } + } + } + }, + (26): { + [ 260, 261, 262, 263 ], + [ -260, -259, -258, -257, -256, -255 ], + [ 260, 261, 262, 263, + 261.1, 262.1, 263.1, 264.1 ], + { + 26, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 26, + { + [ 260, 261, 262, 263, 264 ], + [ -260, -259, -258, -257, -256 ], + [ 260, 261, 262, 263, 264 ], + [ -260, -259, -258, -257, -256 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269 ], + [ -260, -259, -258, -257, -256, -255, -254, -253, -252, -251 ], + [ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269 ], + [ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269 ], + [ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269 ] + } + } + } + }, + (27): { + [ 270, 271, 272, 273 ], + [ -270, -269, -268, -267, -266, -265 ], + [ 270, 271, 272, 273, + 271.1, 272.1, 273.1, 274.1 ], + { + 27, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 27, + { + [ 270, 271, 272, 273, 274 ], + [ -270, -269, -268, -267, -266 ], + [ 270, 271, 272, 273, 274 ], + [ -270, -269, -268, -267, -266 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279 ], + [ -270, -269, -268, -267, -266, -265, -264, -263, -262, -261 ], + [ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279 ], + [ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279 ], + [ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279 ] + } + } + } + }, + (28): { + [ 280, 281, 282, 283 ], + [ -280, -279, -278, -277, -276, -275 ], + [ 280, 281, 282, 283, + 281.1, 282.1, 283.1, 284.1 ], + { + 28, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 28, + { + [ 280, 281, 282, 283, 284 ], + [ -280, -279, -278, -277, -276 ], + [ 280, 281, 282, 283, 284 ], + [ -280, -279, -278, -277, -276 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289 ], + [ -280, -279, -278, -277, -276, -275, -274, -273, -272, -271 ], + [ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289 ], + [ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289 ], + [ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289 ] + } + } + } + }, + (29): { + [ 290, 291, 292, 293 ], + [ -290, -289, -288, -287, -286, -285 ], + [ 290, 291, 292, 293, + 291.1, 292.1, 293.1, 294.1 ], + { + 29, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 29, + { + [ 290, 291, 292, 293, 294 ], + [ -290, -289, -288, -287, -286 ], + [ 290, 291, 292, 293, 294 ], + [ -290, -289, -288, -287, -286 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299 ], + [ -290, -289, -288, -287, -286, -285, -284, -283, -282, -281 ], + [ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299 ], + [ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299 ], + [ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299 ] + } + } + } + }, + (30): { + [ 300, 301, 302, 303 ], + [ -300, -299, -298, -297, -296, -295 ], + [ 300, 301, 302, 303, + 301.1, 302.1, 303.1, 304.1 ], + { + 30, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 30, + { + [ 300, 301, 302, 303, 304 ], + [ -300, -299, -298, -297, -296 ], + [ 300, 301, 302, 303, 304 ], + [ -300, -299, -298, -297, -296 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 300, 301, 302, 303, 304, 305, 306, 307, 308, 309 ], + [ -300, -299, -298, -297, -296, -295, -294, -293, -292, -291 ], + [ 300, 301, 302, 303, 304, 305, 306, 307, 308, 309 ], + [ 300, 301, 302, 303, 304, 305, 306, 307, 308, 309 ], + [ 300, 301, 302, 303, 304, 305, 306, 307, 308, 309 ] + } + } + } + }, + (31): { + [ 310, 311, 312, 313 ], + [ -310, -309, -308, -307, -306, -305 ], + [ 310, 311, 312, 313, + 311.1, 312.1, 313.1, 314.1 ], + { + 31, + [ "This is a test string." ], + [ "String test", "String test", "String test", "String test" ] + }, + { + 31, + { + [ 310, 311, 312, 313, 314 ], + [ -310, -309, -308, -307, -306 ], + [ 310, 311, 312, 313, 314 ], + [ -310, -309, -308, -307, -306 ] + }, + { + [ "1234567890" ], + [ "STRING ARRAY", "STRING ARRAY", "STRING ARRAY", "STRING ARRAY" ], + { + [ 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 ], + [ -310, -309, -308, -307, -306, -305, -304, -303, -302, -301 ], + [ 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 ], + [ 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 ], + [ 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 ] + } + } + } + } + } + } +} +} diff --git a/tools/testfiles/tcompound_complex2.h5 b/tools/testfiles/tcompound_complex2.h5 new file mode 100644 index 0000000..48eb004 Binary files /dev/null and b/tools/testfiles/tcompound_complex2.h5 differ diff --git a/tools/testfiles/tvlenstr_array.ddl b/tools/testfiles/tvlenstr_array.ddl new file mode 100644 index 0000000..87efbb6 --- /dev/null +++ b/tools/testfiles/tvlenstr_array.ddl @@ -0,0 +1,48 @@ +HDF5 "tvlenstr_array.h5" { +GROUP "/" { + DATASET "CompoundArrayOfVlenStr" { + DATATYPE H5T_COMPOUND { + H5T_ARRAY { [3] H5T_STRING { + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } } "vlen_str_array"; + } + DATASPACE SIMPLE { ( 5 ) / ( 5 ) } + DATA { + (0): { + [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ] + }, + (1): { + [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ] + }, + (2): { + [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ] + }, + (3): { + [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ] + }, + (4): { + [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ] + } + } + } + DATASET "ScalarArrayOfVlenStr" { + DATATYPE H5T_ARRAY { [3] H5T_STRING { + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } } + DATASPACE SIMPLE { ( 5 ) / ( 5 ) } + DATA { + (0): [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ], + (1): [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ], + (2): [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ], + (3): [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ], + (4): [ "This is a variable-length test string.", "This test string is also variable-length.", "A final test of variable-length strings. This string is longer than the others." ] + } + } +} +} diff --git a/tools/testfiles/tvlenstr_array.h5 b/tools/testfiles/tvlenstr_array.h5 new file mode 100644 index 0000000..41e8867 Binary files /dev/null and b/tools/testfiles/tvlenstr_array.h5 differ -- cgit v0.12