summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-10-10 19:22:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-10-10 19:22:05 (GMT)
commitcf0eb72e5a8172bc55bed0ea90a841fb0fe7bdae (patch)
treeb271acfd8c7da54fe81e4cabac4ecf1e0f71d651 /test
parent83a3d967e92e7d9cbf266346a584036241f5ce63 (diff)
downloadhdf5-cf0eb72e5a8172bc55bed0ea90a841fb0fe7bdae.zip
hdf5-cf0eb72e5a8172bc55bed0ea90a841fb0fe7bdae.tar.gz
hdf5-cf0eb72e5a8172bc55bed0ea90a841fb0fe7bdae.tar.bz2
[svn-r9396] Purpose:
Bug fix Description: Correct a couple of array bounds issues exposed by the PGI compiler Platforms tested: Linux 2.4 (verbena) w/PGI compilers Too minor too requie h5committest
Diffstat (limited to 'test')
-rw-r--r--test/dtypes.c6
-rw-r--r--test/tarray.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 8c5c820..f91fcb0 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -2472,7 +2472,7 @@ test_named (hid_t fapl)
hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1, attr1=-1;
herr_t status;
static hsize_t ds_size[2] = {10, 20};
- hsize_t i;
+ hsize_t i,j;
unsigned attr_data[10][20];
char filename[1024];
@@ -2528,7 +2528,9 @@ test_named (hid_t fapl)
/* It should be possible to define an attribute for the named type */
if ((attr1=H5Acreate (type, "attr1", H5T_NATIVE_UCHAR, space,
H5P_DEFAULT))<0) goto error;
- for (i=0; i<ds_size[0]*ds_size[1]; i++) attr_data[0][i] = (int)i;/*tricky*/
+ for (i=0; i<ds_size[0]; i++)
+ for (j=0; j<ds_size[1]; j++)
+ attr_data[i][j] = (int)(i*ds_size[1]+j);
if (H5Awrite(attr1, H5T_NATIVE_UINT, attr_data)<0) goto error;
if (H5Aclose (attr1)<0) goto error;
diff --git a/test/tarray.c b/test/tarray.c
index 8e92eb4..aa6e767 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -436,9 +436,9 @@ test_array_array_atomic(void)
/* Compare data read in */
for(i=0; i<SPACE1_DIM1; i++) {
- for(j=0; j<ARRAY2_DIM1; j++) {
- for(k=0; k<ARRAY2_DIM2; k++) {
- for(l=0; l<ARRAY2_DIM3; l++) {
+ for(j=0; j<ARRAY1_DIM1; j++) {
+ for(k=0; k<ARRAY3_DIM1; k++) {
+ for(l=0; l<ARRAY3_DIM2; l++) {
if(wdata[i][j][k][l]!=rdata[i][j][k][l]) {
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d][%d][%d]=%d, rdata[%d][%d][%d][%d]=%d\n",(int)i,(int)j,(int)k,(int)l,(int)wdata[i][j][k][l],(int)i,(int)j,(int)k,(int)l,(int)rdata[i][j][k][l]);
continue;