summaryrefslogtreecommitdiffstats
path: root/test/vfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/vfd.c')
-rw-r--r--test/vfd.c87
1 files changed, 40 insertions, 47 deletions
diff --git a/test/vfd.c b/test/vfd.c
index 01d9d98..a8e90c6 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -232,80 +232,77 @@ test_direct(void)
/* Initialize the dset1 */
p1 = points;
- for (i = n = 0; i < DSET1_DIM1; i++)
- for (j = 0; j < DSET1_DIM2; j++)
+ for(i = n = 0; i < DSET1_DIM1; i++)
+ for(j = 0; j < DSET1_DIM2; j++)
*p1++ = n++;
/* Create the data space1 */
dims1[0] = DSET1_DIM1;
dims1[1] = DSET1_DIM2;
- if ((space1 = H5Screate_simple(2, dims1, NULL)) < 0)
+ if((space1 = H5Screate_simple(2, dims1, NULL)) < 0)
TEST_ERROR;
/* Create the dset1 */
- if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR;
if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
+ if((dset1 = H5Dopen2(file, DSET1_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Read the data back from dset1 */
- if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
+ if(H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
p1 = points;
p2 = check;
- for (i = 0; i < DSET1_DIM1; i++) {
- for (j = 0; j < DSET1_DIM2; j++) {
- if (*p1++ != *p2++) {
+ for(i = 0; i < DSET1_DIM1; i++)
+ for(j = 0; j < DSET1_DIM2; j++)
+ if(*p1++ != *p2++) {
H5_FAILED();
printf(" Read different values than written in data set 1.\n");
printf(" At index %d,%d\n", i, j);
TEST_ERROR;
- }
- }
- }
+ } /* end if */
/* Create the data space2. For data set 2, memory address and data size are not aligned. */
dims2[0] = DSET2_DIM;
- if ((space2 = H5Screate_simple(1, dims2, NULL)) < 0)
+ if((space2 = H5Screate_simple(1, dims2, NULL)) < 0)
TEST_ERROR;
/* Create the dset2 */
- if ((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0)
+ if((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2) < 0)
+ if(H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2) < 0)
TEST_ERROR;
if(H5Dclose(dset2) < 0)
TEST_ERROR;
- if((dset2=H5Dopen(file, DSET2_NAME)) < 0)
+ if((dset2 = H5Dopen2(file, DSET2_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Read the data back from dset1 */
- if (H5Dread(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2) < 0)
+ if(H5Dread(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET2_DIM; i++) {
- if (wdata2[i] != rdata2[i]) {
+ for(i = 0; i < DSET2_DIM; i++)
+ if(wdata2[i] != rdata2[i]) {
H5_FAILED();
printf(" Read different values than written in data set 2.\n");
printf(" At index %d\n", i);
TEST_ERROR;
- }
- }
+ } /* end if */
if(H5Sclose(space1) < 0)
TEST_ERROR;
@@ -430,47 +427,45 @@ test_core(void)
/* Initialize the dset1 */
p1 = points;
- for (i = n = 0; i < DSET1_DIM1; i++)
- for (j = 0; j < DSET1_DIM2; j++)
+ for(i = n = 0; i < DSET1_DIM1; i++)
+ for(j = 0; j < DSET1_DIM2; j++)
*p1++ = n++;
/* Create the data space1 */
dims1[0] = DSET1_DIM1;
dims1[1] = DSET1_DIM2;
- if ((space1 = H5Screate_simple(2, dims1, NULL)) < 0)
+ if((space1 = H5Screate_simple(2, dims1, NULL)) < 0)
TEST_ERROR;
/* Create the dset1 */
- if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR;
if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
+ if((dset1 = H5Dopen2(file, DSET1_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Read the data back from dset1 */
- if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
+ if(H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
p1 = points;
p2 = check;
- for (i = 0; i < DSET1_DIM1; i++) {
- for (j = 0; j < DSET1_DIM2; j++) {
- if (*p1++ != *p2++) {
+ for(i = 0; i < DSET1_DIM1; i++)
+ for(j = 0; j < DSET1_DIM2; j++)
+ if(*p1++ != *p2++) {
H5_FAILED();
printf(" Read different values than written in data set 1.\n");
printf(" At index %d,%d\n", i, j);
TEST_ERROR;
- }
- }
- }
+ } /* end if */
if(H5Dclose(dset1) < 0)
TEST_ERROR;
@@ -483,46 +478,44 @@ test_core(void)
if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
+ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Create the dset1 */
- if ((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
- if (H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR;
if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
+ if((dset1 = H5Dopen2(file, DSET1_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Reallocate memory for reading buffer. */
if(check)
free(check);
- check=(int*)malloc(DSET1_DIM1*DSET1_DIM2*sizeof(int));
+ check = (int*)malloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
/* Read the data back from dset1 */
- if (H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
+ if(H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
p1 = points;
p2 = check;
- for (i = 0; i < DSET1_DIM1; i++) {
- for (j = 0; j < DSET1_DIM2; j++) {
- if (*p1++ != *p2++) {
+ for(i = 0; i < DSET1_DIM1; i++)
+ for(j = 0; j < DSET1_DIM2; j++)
+ if(*p1++ != *p2++) {
H5_FAILED();
printf(" Read different values than written in data set 1.\n");
printf(" At index %d,%d\n", i, j);
TEST_ERROR;
- }
- }
- }
+ } /* end if */
/* Check file size API */
if(H5Fget_filesize(file, &file_size) < 0)