diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2001-03-29 23:56:23 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2001-03-29 23:56:23 (GMT) |
commit | 067806e5070d3503b76db91ce6201c26b44c12e5 (patch) | |
tree | 346c667f77309951605c3b84673345fa9c1c0fb4 | |
parent | e9c66f61a77c40bc27a1371291892c4147555689 (diff) | |
download | hdf5-067806e5070d3503b76db91ce6201c26b44c12e5.zip hdf5-067806e5070d3503b76db91ce6201c26b44c12e5.tar.gz hdf5-067806e5070d3503b76db91ce6201c26b44c12e5.tar.bz2 |
[svn-r3739]
Purpose:
a bug fix
Description:
when creating sds dimensional scale dataset, I accidently created two sds dimensional scale dataset with the same name, (say using name "dim1" for both rank 2 and rank 3).
hdf4 library doesn't give me complaints, hdp dumpsds doesn't generate complaints. h4toh5 converter since assumed that dimensional scale name has to be unique, simply skip if finding the same dimensional name, so accidently the result from hdp dumpsds are the same as the result from h5dump until I implement library API and find this bug.
Solution:
make unique sds dimensional scale name for this test file. Will also need to modify testfiles later.
suggestions: somebody check hdf4 library to disallow the same dimensional scale nameOused for the same sds object.
Platforms tested:
eirene, and this check in will not affect daily test.
-rw-r--r-- | tools/h4toh5/h4toh5test.c | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/tools/h4toh5/h4toh5test.c b/tools/h4toh5/h4toh5test.c index 333d49f..9090251 100644 --- a/tools/h4toh5/h4toh5test.c +++ b/tools/h4toh5/h4toh5test.c @@ -2900,7 +2900,7 @@ int test_vgall() { int32 sds_ref; int32 fill_value; int32 array_data[TYP_DIMSIZE][TYP_DIMSIZE][TYP_DIMSIZE]; - int32 dimo_sca[TYP_DIMSIZE]; + int32 dim_sca0[TYP_DIMSIZE],dim_sca1[TYP_DIMSIZE]; int32 dim_sizes[TYP_RANK]; int32 start[TYP_RANK],edges[TYP_RANK],stride[TYP_RANK]; float64 cal; @@ -2937,6 +2937,7 @@ int test_vgall() { char dim_name0[] ="dim0"; char dim_name1[] ="dim1"; + char dim_name2[] ="dim2"; char dim_label[] ="dim.label"; char dim_unit[] ="dim.unit"; char dim_format[] ="dim.format"; @@ -2963,8 +2964,10 @@ int test_vgall() { } } - for (i=0;i<TYP_DIMSIZE;i++) - dimo_sca[i]= 2*i; + for (i=0;i<TYP_DIMSIZE;i++) { + dim_sca0[i]= 2*i; + dim_sca1[i]= i; + } for (i=0;i<TYP_RANK;i++){ stride[i]=1; @@ -3468,30 +3471,48 @@ int test_vgall() { printf("sds set dim id failed. \n"); return FAIL; } - if (i==0) { + + + switch(i) { + + case 0: istat = SDsetdimname(dim_id,dim_name0); if(istat == FAIL) { - printf("sds set dim.name failed. \n"); - return FAIL; + printf("sds set dim.name failed. \n"); + return FAIL; } - istat= SDsetdimscale(dim_id,dim_sizes[0],DFNT_INT32,(VOIDP)dimo_sca); + istat =SDsetdimscale(dim_id,dim_sizes[0],DFNT_INT32,(VOIDP)dim_sca0); if(istat == FAIL) { - printf("sds set dim. scale failed. \n"); - return FAIL; + printf("sds set dim. scale failed. \n"); + return FAIL; } - } - else { + break; + case 1: istat = SDsetdimname(dim_id,dim_name1); if(istat == FAIL) { - printf("sds set dim.name failed. \n"); - return FAIL; + printf("sds set dim.name failed. \n"); + return FAIL; } - istat = SDsetdimscale(dim_id,dim_sizes[1],DFNT_INT32,(VOIDP)dimo_sca); + istat = SDsetdimscale(dim_id,dim_sizes[1],DFNT_INT32,(VOIDP)dim_sca1); if(istat == FAIL) { - printf("sds set dim. scale failed. \n"); - return FAIL; + printf("sds set dim. scale failed. \n"); + return FAIL; } - } + break; + case 2: + istat = SDsetdimname(dim_id,dim_name2); + if(istat == FAIL) { + printf("sds set dim.name failed. \n"); + return FAIL; + } + istat = SDsetdimscale(dim_id,dim_sizes[2],DFNT_INT32,(VOIDP)dim_sca0); + if(istat == FAIL) { + printf("sds set dim. scale failed. \n"); + return FAIL; + } + break; + } + istat=SDsetdimstrs(dim_id,dim_label,dim_unit,dim_format); if(istat == FAIL) { |