summaryrefslogtreecommitdiffstats
path: root/test/hyperslab.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-02-26 19:58:14 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-02-26 19:58:14 (GMT)
commit912c5a0874182f0705e3fe6756859817e2a64cdd (patch)
treea68f01992ce5a618dfee8f69778e2ffd8dda03af /test/hyperslab.c
parentefb18f8785f0c1f967743fba1ed13a392a0ca601 (diff)
downloadhdf5-912c5a0874182f0705e3fe6756859817e2a64cdd.zip
hdf5-912c5a0874182f0705e3fe6756859817e2a64cdd.tar.gz
hdf5-912c5a0874182f0705e3fe6756859817e2a64cdd.tar.bz2
[svn-r1108] Changes since 19990225
---------------------- ./INSTALL Added warnings and a disclaimer about GNU, DEC, Irix64, and NT compilers that generate incorrect machine code. ./configure.in ./src/H5private.h Detects and includes <sys/param.h> which is needed on FreeBSD before <sys/proc.h> even though we only really using anything from <sys/proc.h> on the DEC Alpha. ./config/irix64 Turned off warnings for duplicate definitions from the linker because -lnsl on irix has the same stuff in it as -lc. ./config/irix6.x Split up the CC and CFLAGS settings like with irix64 so that compilers besides `-n32' can be used. ./bin/snapshot The snapshots are tagged with names like hdf5-1_1_52 which is similar to the way the releases are tagged (cvs doesn't allow dots in tags). ./test/dtypes.c ./src/H5private.h ./src/H5Tconv.c Fixed some alignment violations on the DEC when using high optimization levels. The DEC incorrectly optimizes certain memcpy() and memmove() calls when the source argument is not word aligned if the call looks like it's copying an atomic data type. ./test/hyperslab Worked around code generation bugs in the Irix64 Mongoose 7.00 compiler by casting some `unsigned long' values to `unsigned' in an expression. ./src/H5Ocomp.c Fixed a place where %d was used to print a size_t.
Diffstat (limited to 'test/hyperslab.c')
-rw-r--r--test/hyperslab.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 6fdfaa5..01e092c 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -284,7 +284,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
* Purpose: Tests H5V_hyper_copy().
*
* The NX, NY, and NZ arguments are the size for the source and
- * destination arrays. You map pass zero for NZ or for NY and
+ * destination arrays. You may pass zero for NZ or for NY and
* NZ to test the 2-d and 1-d cases respectively.
*
* A hyperslab is copied from/to (depending on MODE) various
@@ -384,12 +384,12 @@ test_copy(int mode,
dst = H5MM_calloc(nx*ny*nz);
init_full(src, nx, ny, nz);
- for (i = 0; i < nx; i += di) {
- for (j = 0; j < ny; j += dj) {
- for (k = 0; k < nz; k += dk) {
- for (dx = 1; dx <= nx - i; dx += ddx) {
- for (dy = 1; dy <= ny - j; dy += ddy) {
- for (dz = 1; dz <= nz - k; dz += ddz) {
+ for (i=0; i<nx; i+=di) {
+ for (j=0; j<ny; j+=dj) {
+ for (k=0; k<nz; k+=dk) {
+ for (dx=1; dx<=nx-i; dx+=ddx) {
+ for (dy=1; dy<=ny-j; dy+=ddy) {
+ for (dz=1; dz<=nz-k; dz+=ddz) {
/*
* Describe the source and destination hyperslabs
@@ -451,10 +451,10 @@ test_copy(int mode,
* Set all loc values to 1 so we can detect writing
* outside the hyperslab.
*/
- for (u = 0; u < nx; u++) {
- for (v = 0; v < ny; v++) {
- for (w = 0; w < nz; w++) {
- dst[u * ny * nz + v * nz + w] = 1;
+ for (u=0; u<nx; u++) {
+ for (v=0; v<ny; v++) {
+ for (w=0; w<nz; w++) {
+ dst[u*ny*nz + v*nz + w] = 1;
}
}
}
@@ -476,10 +476,10 @@ test_copy(int mode,
for (v=dst_offset[1];
v<dst_offset[1]+dy;
v++) {
- for (w = dst_offset[2];
- w < dst_offset[2] + dz;
+ for (w=dst_offset[2];
+ w<dst_offset[2]+dz;
w++) {
- acc += dst[u * ny * nz + v * nz + w];
+ acc += dst[u*ny*nz + v*nz + w];
}
}
}
@@ -512,14 +512,21 @@ test_copy(int mode,
* we added the border of 1's to the hyperslab.
*/
acc = 0;
- for (u = 0; u < nx; u++) {
- for (v = 0; v < ny; v++) {
- for (w = 0; w < nz; w++) {
- acc += dst[u * ny * nz + v * nz + w];
+ for (u=0; u<nx; u++) {
+ for (v=0; v<ny; v++) {
+ for (w=0; w<nz; w++) {
+ acc += dst[u*ny*nz + v*nz + w];
}
}
}
- if (acc != ref_value + nx*ny*nz - dx*dy*dz) {
+
+ /*
+ * The following casts are to work around an
+ * optimization bug in the Mongoose 7.20 Irix64
+ * compiler.
+ */
+ if (acc+(unsigned)dx*(unsigned)dy*(unsigned)dz !=
+ ref_value + nx*ny*nz) {
puts("*FAILED*");
if (!isatty(1)) {
/*