summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1998-07-06 21:01:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1998-07-06 21:01:59 (GMT)
commit650e88756c4d81f819141d28e9239fbb6446ed30 (patch)
treeb072d230ee7c60c7ab3548e04d291f81b8c1ceda
parent43f13aeca28a722d6436d43dcd84a59918dc0950 (diff)
downloadhdf5-650e88756c4d81f819141d28e9239fbb6446ed30.zip
hdf5-650e88756c4d81f819141d28e9239fbb6446ed30.tar.gz
hdf5-650e88756c4d81f819141d28e9239fbb6446ed30.tar.bz2
[svn-r452] Changed tests to use the new dataspace API calls. Still need to add tests for
point selections and strides.
-rw-r--r--test/big.c4
-rw-r--r--test/chunk.c4
-rw-r--r--test/cmpd_dset.c6
-rw-r--r--test/dsets.c4
-rw-r--r--test/extend.c6
-rw-r--r--test/external.c4
-rw-r--r--test/iopipe.c2
-rw-r--r--test/th5s.c15
8 files changed, 26 insertions, 19 deletions
diff --git a/test/big.c b/test/big.c
index c45690a..6dd72bb 100644
--- a/test/big.c
+++ b/test/big.c
@@ -85,7 +85,7 @@ writer (int wrt_n)
for (i=0; i<wrt_n; i++) {
hs_start[0] = randll (size2[0]);
HDfprintf (stdout, "#%03d 0x%016Hx\n", i, hs_start[0]);
- H5Sset_hyperslab (space2, hs_start, hs_size, NULL);
+ H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL);
for (j=0; j<WRT_SIZE; j++) {
buf[j] = i+1;
}
@@ -151,7 +151,7 @@ reader (const char *script_name)
HDfprintf (stdout, "#%03d 0x%016Hx", i, hs_offset[0]);
fflush (stdout);
- H5Sset_hyperslab (fspace, hs_offset, hs_size, NULL);
+ H5Sselect_hyperslab (fspace, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL);
H5Dread (d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf);
/* Check */
diff --git a/test/chunk.c b/test/chunk.c
index 592fc73..73cb07c 100644
--- a/test/chunk.c
+++ b/test/chunk.c
@@ -214,7 +214,7 @@ test_rowmaj (int op, hsize_t cache_size, hsize_t io_size)
hs_offset[1] = j;
hs_size[1] = MIN (io_size, CH_SIZE*DS_SIZE-j);
mem_space = H5Screate_simple (2, hs_size, hs_size);
- H5Sset_hyperslab (file_space, hs_offset, hs_size, NULL);
+ H5Sselect_hyperslab (file_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL);
if (READ==op) {
H5Dread (dset, H5T_NATIVE_CHAR, mem_space, file_space,
@@ -274,7 +274,7 @@ test_diag (int op, hsize_t cache_size, hsize_t io_size, hsize_t offset)
hs_offset[0] = hs_offset[1] = i;
hs_size[0] = hs_size[1] = MIN (io_size, CH_SIZE*DS_SIZE-i);
mem_space = H5Screate_simple (2, hs_size, hs_size);
- H5Sset_hyperslab (file_space, hs_offset, hs_size, NULL);
+ H5Sselect_hyperslab (file_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL);
if (READ==op) {
H5Dread (dset, H5T_NATIVE_CHAR, mem_space, file_space,
H5P_DEFAULT, buf);
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 694ce3d..160e84b 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -420,9 +420,7 @@ STEP 8: Read middle third hyperslab into memory array.\n");
f_offset[1] = NY/3;
h_size[0] = 2*NX/3 - f_offset[0];
h_size[1] = 2*NY/3 - f_offset[1];
- h_sample[0] = 1;
- h_sample[1] = 1;
- status = H5Sset_hyperslab (s8_f_sid, f_offset, h_size, h_sample);
+ status = H5Sselect_hyperslab (s8_f_sid, H5S_SELECT_SET, f_offset, NULL, h_size, NULL);
assert (status>=0);
/* Create memory data space */
@@ -547,6 +545,7 @@ STEP 10: Read middle third of hyperslab into middle third of memory array\n\
}
}
+#ifdef OLD_WAY
/*
*######################################################################
* Step 11: Write an array into the middle third of the dataset
@@ -598,6 +597,7 @@ STEP 11: Write an array back to the middle third of the dataset to\n\
}
}
}
+#endif /* OLD_WAY */
diff --git a/test/dsets.c b/test/dsets.c
index a3c15df..9eccc2d 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -582,7 +582,7 @@ test_compression(hid_t file)
points[hs_offset[0]+i][hs_offset[1]+j] = rand ();
}
}
- H5Sset_hyperslab (space, hs_offset, hs_size, NULL);
+ H5Sselect_hyperslab (space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL);
status = H5Dwrite (dataset, H5T_NATIVE_INT, space, space, xfer, points);
if (status<0) goto error;
@@ -599,6 +599,8 @@ test_compression(hid_t file)
printf(" At index %lu,%lu\n",
(unsigned long)(hs_offset[0]+i),
(unsigned long)(hs_offset[1]+j));
+ printf(" At original: %d\n", (int)points[hs_offset[0]+i][hs_offset[1]+j]);
+ printf(" At returned: %d\n", (int)check[hs_offset[0]+i][hs_offset[1]+j]);
goto error;
}
}
diff --git a/test/extend.c b/test/extend.c
index d1b3d0e..15f2322 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -107,7 +107,7 @@ main (void)
/* Select a hyperslab */
file_space = H5Dget_space (dataset);
assert (file_space>=0);
- status = H5Sset_hyperslab (file_space, offset, dims, NULL);
+ status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset, NULL, dims, NULL);
assert (status>=0);
/* Write to the hyperslab */
@@ -130,7 +130,7 @@ main (void)
offset[0] = i * NX/2;
offset[1] = j * NY/2;
assert (file_space>=0);
- status = H5Sset_hyperslab (file_space, offset, half_dims, NULL);
+ status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL);
assert (status>=0);
/* Read */
@@ -155,5 +155,3 @@ main (void)
return 0;
}
-
-
diff --git a/test/external.c b/test/external.c
index d552ac0..03943f8 100644
--- a/test/external.c
+++ b/test/external.c
@@ -599,7 +599,7 @@ test_2 (void)
hs_space = H5Scopy (space);
assert (hs_space>=0);
- status = H5Sset_hyperslab (hs_space, &hs_start, &hs_count, NULL);
+ status = H5Sselect_hyperslab (hs_space, H5S_SELECT_SET, &hs_start, NULL, &hs_count, NULL);
assert (status>=0);
memset (whole, 0, sizeof(whole));
@@ -751,7 +751,7 @@ test_3 (void)
for (i=0; i<hs_count; i++) {
whole[i] = 100+i;
}
- status = H5Sset_hyperslab (file_space, &hs_start, &hs_count, NULL);
+ status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, &hs_start, NULL, &hs_count, NULL);
assert (status>=0);
status = H5Dwrite (dset, H5T_NATIVE_INT, mem_space, file_space,
H5P_DEFAULT, whole);
diff --git a/test/iopipe.c b/test/iopipe.c
index d236ed1..447f483 100644
--- a/test/iopipe.c
+++ b/test/iopipe.c
@@ -318,7 +318,7 @@ main (void)
assert (size[0]>20 && size[1]>20);
start[0] = start[1] = 10;
count[0] = count[1] = size[0]-20;
- status = H5Sset_hyperslab (file_space, start, count, NULL);
+ status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, start, NULL, count, NULL);
assert (status>=0);
synchronize ();
#ifdef HAVE_GETRUSAGE
diff --git a/test/th5s.c b/test/th5s.c
index be866af..4102ea9 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -47,6 +47,10 @@ static char RcsId[] = "$Revision$";
#define SPACE2_DIM2 15
#define SPACE2_DIM3 13
#define SPACE2_DIM4 23
+#define SPACE2_MAX1 H5S_UNLIMITED
+#define SPACE2_MAX2 15
+#define SPACE2_MAX3 13
+#define SPACE2_MAX4 23
/* Scalar dataset with simple datatype */
#define SPACE3_NAME "Scalar1"
@@ -83,9 +87,10 @@ test_h5s_basic(void)
hid_t sid1, sid2; /* Dataspace ID */
unsigned rank; /* Logical rank of dataspace */
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3,
- SPACE2_DIM4};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, SPACE2_DIM4};
+ hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4};
hsize_t tdims[4]; /* Dimension array to test with */
+ hsize_t tmax[4];
size_t n; /* Number of dataspace elements */
herr_t ret; /* Generic return value */
@@ -112,7 +117,7 @@ test_h5s_basic(void)
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0,
"H5Sget_ldims");
- sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
+ sid2 = H5Screate_simple(SPACE2_RANK, dims2, max2);
CHECK(sid2, FAIL, "H5Screate_simple");
n = H5Sget_npoints(sid2);
@@ -124,10 +129,12 @@ test_h5s_basic(void)
CHECK(rank, UFAIL, "H5Sget_lrank");
VERIFY(rank, SPACE2_RANK, "H5Sget_lrank");
- ret = H5Sget_dims(sid2, tdims, NULL);
+ ret = H5Sget_dims(sid2, tdims, tmax);
CHECK(ret, FAIL, "H5Sget_ldims");
VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0,
"H5Sget_ldims");
+ VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0,
+ "H5Sget_ldims");
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");