diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2005-02-08 20:55:17 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2005-02-08 20:55:17 (GMT) |
commit | 983e9a9e267845c80995898fba2bc7e6ebb0e881 (patch) | |
tree | 9969499d2f5dda6de472656b1f439732dab95eb1 /tools/h5dump/h5dumpgentest.c | |
parent | 70c0ba03cec20ad3c353fcf776f4b48f2ac8da9f (diff) | |
download | hdf5-983e9a9e267845c80995898fba2bc7e6ebb0e881.zip hdf5-983e9a9e267845c80995898fba2bc7e6ebb0e881.tar.gz hdf5-983e9a9e267845c80995898fba2bc7e6ebb0e881.tar.bz2 |
[svn-r9961]
Purpose:
bug fix, new test file
Description:
h5dump was not properly displaying array indices > 3D
Solution:
added the same algorythm and data structure that h5diff uses to calculate the array index
from a element number position
Platforms tested:
linux
solaris
Misc. update:
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index d0df063..e438572 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -5197,10 +5197,12 @@ static void gent_aindices(void) hsize_t dims1[1] = {100}; hsize_t dims2[2] = {2,100}; hsize_t dims3[3] = {2,2,100}; + hsize_t dims4[4] = {2,3,4,5}; int buf1[100]; int buf2[2][100]; int buf3[2][2][100]; - int i, j, k, n, ret; + int buf4[2][3][4][5]; + int i, j, k, l, n, ret; for (i=n=0; i<100; i++){ buf1[i]=n++; @@ -5218,7 +5220,16 @@ static void gent_aindices(void) } } } - + for (i=n=0; i<2; i++){ + for (j=0; j<3; j++){ + for (k=0; k<4; k++){ + for (l=0; l<5; l++){ + buf4[i][j][k][l]=n++; + } + } + } + } + /* create a file */ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>=0); @@ -5230,6 +5241,7 @@ static void gent_aindices(void) write_dset(fid,1,dims1,"1d",H5T_NATIVE_INT,buf1); write_dset(fid,2,dims2,"2d",H5T_NATIVE_INT,buf2); write_dset(fid,3,dims3,"3d",H5T_NATIVE_INT,buf3); + write_dset(fid,4,dims4,"4d",H5T_NATIVE_INT,buf4); /*------------------------------------------------------------------------- * test with group indentation @@ -5244,6 +5256,7 @@ static void gent_aindices(void) write_dset(gid[5],1,dims1,"1d",H5T_NATIVE_INT,buf1); write_dset(gid[5],2,dims2,"2d",H5T_NATIVE_INT,buf2); write_dset(gid[5],3,dims3,"3d",H5T_NATIVE_INT,buf3); + write_dset(gid[5],4,dims4,"4d",H5T_NATIVE_INT,buf4); for (i=0; i<6; i++) H5Gclose(gid[i]); @@ -5262,7 +5275,6 @@ static void gent_aindices(void) *------------------------------------------------------------------------- */ - int main(void) { gent_group(); |