summaryrefslogtreecommitdiffstats
path: root/test/vfd.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-04 22:19:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-04 22:19:07 (GMT)
commit1de51c7bc148b9cb5104936dfd23096a222d0cb8 (patch)
treeb23ea23404fd02a41f4539ebbc8311a1c43fecbe /test/vfd.c
parent041de441c5d7468812be8af1346b30db6ea94e3a (diff)
downloadhdf5-1de51c7bc148b9cb5104936dfd23096a222d0cb8.zip
hdf5-1de51c7bc148b9cb5104936dfd23096a222d0cb8.tar.gz
hdf5-1de51c7bc148b9cb5104936dfd23096a222d0cb8.tar.bz2
[svn-r14187] Description:
Put H5Acreate() under API versioning, with all internal usage shifted to H5Acreate2(). Add regression tests for H5Acreate1(). Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test/vfd.c')
-rw-r--r--test/vfd.c221
1 files changed, 111 insertions, 110 deletions
diff --git a/test/vfd.c b/test/vfd.c
index 97a2526..01d9d98 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -84,11 +84,11 @@ test_sec2(void)
/* Set property list and file name for SEC2 driver. */
fapl = h5_fileaccess();
- if(H5Pset_fapl_sec2(fapl)<0)
+ if(H5Pset_fapl_sec2(fapl) < 0)
TEST_ERROR;
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -100,7 +100,7 @@ test_sec2(void)
TEST_ERROR;
/* Check file handle API */
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
@@ -115,7 +115,7 @@ test_sec2(void)
if(file_size<1*KB || file_size>4*KB)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
PASSED();
@@ -175,17 +175,17 @@ test_direct(void)
/* Set property list and file name for Direct driver. Set memory alignment boundary
* and file block size to 512 which is the minimum for Linux 2.6. */
fapl = h5_fileaccess();
- if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE)<0)
+ if(H5Pset_fapl_direct(fapl, MBOUNDARY, FBSIZE, CBSIZE) < 0)
TEST_ERROR;
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
/* Verify the file access properties */
- if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize)<0)
+ if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0)
TEST_ERROR;
if(mbound != MBOUNDARY || fbsize != FBSIZE || cbsize != CBSIZE)
TEST_ERROR;
- if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE)<0)
+ if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
@@ -207,7 +207,7 @@ test_direct(void)
TEST_ERROR;
/* Check file handle API */
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
@@ -239,25 +239,25 @@ test_direct(void)
/* 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)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME))<0)
+ if((dset1=H5Dopen(file, DSET1_NAME)) < 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 */
@@ -276,25 +276,25 @@ test_direct(void)
/* 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)
+ if(H5Dclose(dset2) < 0)
TEST_ERROR;
- if((dset2=H5Dopen(file, DSET2_NAME))<0)
+ if((dset2=H5Dopen(file, DSET2_NAME)) < 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 */
@@ -307,15 +307,15 @@ test_direct(void)
}
}
- if(H5Sclose(space1)<0)
+ if(H5Sclose(space1) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if(H5Sclose(space2)<0)
+ if(H5Sclose(space2) < 0)
TEST_ERROR;
- if(H5Dclose(dset2)<0)
+ if(H5Dclose(dset2) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
if(points)
free(points);
@@ -379,11 +379,11 @@ test_core(void)
/* Set property list and file name for CORE driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
TEST_ERROR;
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -394,7 +394,7 @@ test_core(void)
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle) < 0)
TEST_ERROR;
if(fhandle==NULL)
{
@@ -412,16 +412,16 @@ test_core(void)
if(file_size<2*KB || file_size>6*KB)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Open the file with backing store off for read and write.
* Changes won't be saved in file. */
- if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Allocate memory for data set. */
@@ -437,25 +437,25 @@ test_core(void)
/* 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)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME))<0)
+ if((dset1=H5Dopen(file, DSET1_NAME)) < 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 */
@@ -472,32 +472,32 @@ test_core(void)
}
}
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Open the file with backing store on for read and write.
* Changes will be saved in file. */
- if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE)<0)
+ 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)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if((dset1=H5Dopen(file, DSET1_NAME))<0)
+ if((dset1=H5Dopen(file, DSET1_NAME)) < 0)
TEST_ERROR;
/* Reallocate memory for reading buffer. */
@@ -507,7 +507,7 @@ test_core(void)
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 */
@@ -533,11 +533,11 @@ test_core(void)
if(file_size<64*KB || file_size>256*KB)
TEST_ERROR;
- if(H5Sclose(space1)<0)
+ if(H5Sclose(space1) < 0)
TEST_ERROR;
- if(H5Dclose(dset1)<0)
+ if(H5Dclose(dset1) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
if(points)
free(points);
@@ -597,7 +597,7 @@ test_family_opens(char *fname, hid_t fa_pl)
if(file >= 0) TEST_ERROR
/* Case 3: reopen file with wrong member size */
- if(H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fa_pl, (hsize_t)128, H5P_DEFAULT) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
@@ -613,7 +613,7 @@ test_family_opens(char *fname, hid_t fa_pl)
break;
}
- if(H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fa_pl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
H5E_BEGIN_TRY {
@@ -671,14 +671,14 @@ test_family(void)
/* Set property list and file name for FAMILY driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Test different wrong ways to reopen family files where there's only
@@ -687,10 +687,10 @@ test_family(void)
TEST_ERROR;
/* Reopen the file with default member file size */
- if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Check file size API */
@@ -702,7 +702,7 @@ test_family(void)
TEST_ERROR;
/* Create and write dataset */
- if((space=H5Screate_simple(2, dims, NULL))<0)
+ if((space=H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -713,30 +713,30 @@ test_family(void)
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0)
+ if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i=0; i<FAMILY_NUMBER; i++)
for(j=0; j<FAMILY_SIZE; j++)
buf[i][j] = i*10000+j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
TEST_ERROR;
/* check file handle API */
- if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl2=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
- if(H5Pset_family_offset(fapl2, (hsize_t)0)<0)
+ if(H5Pset_family_offset(fapl2, (hsize_t)0) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
- if(H5Pset_family_offset(fapl2, (hsize_t)(FAMILY_SIZE*2))<0)
+ if(H5Pset_family_offset(fapl2, (hsize_t)(FAMILY_SIZE*2)) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2) < 0)
TEST_ERROR;
if(*fhandle2<0)
TEST_ERROR;
@@ -755,28 +755,28 @@ test_family(void)
TEST_ERROR;
}
- if(H5Sclose(space)<0)
+ if(H5Sclose(space) < 0)
TEST_ERROR;
- if(H5Dclose(dset)<0)
+ if(H5Dclose(dset) < 0)
TEST_ERROR;
- if(H5Pclose(fapl2)<0)
+ if(H5Pclose(fapl2) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Test different wrong ways to reopen family files when there're multiple
* member files existing. */
- if(test_family_opens(filename, fapl)<0)
+ if(test_family_opens(filename, fapl) < 0)
TEST_ERROR;
/* Reopen the file with correct member file size. */
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
@@ -834,7 +834,7 @@ test_family_compat(void)
/* Set property list and file name for FAMILY driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT) < 0)
TEST_ERROR;
h5_fixname(COMPAT_BASENAME, fapl, filename, sizeof filename);
@@ -847,13 +847,13 @@ test_family_compat(void)
}
strcat(pathname, filename);
- if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl))<0)
+ if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
- if(H5Pclose(fapl)<0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
PASSED();
@@ -979,27 +979,27 @@ test_multi(void)
memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX*3/4;
- if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE)<0)
+ if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0)
TEST_ERROR;
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
/* Test wrong ways to reopen multi files */
- if(test_multi_opens(filename)<0)
+ if(test_multi_opens(filename) < 0)
TEST_ERROR;
/* Reopen the file */
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Create and write data set */
- if((space=H5Screate_simple(2, dims, NULL))<0)
+ if((space=H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -1020,27 +1020,27 @@ test_multi(void)
if(file_size < HADDR_MAX/4 || file_size > HADDR_MAX/2)
TEST_ERROR;
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0)
+ if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i=0; i<MULTI_SIZE; i++)
for(j=0; j<MULTI_SIZE; j++)
buf[i][j] = i*10000+j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
TEST_ERROR;
- if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0)
+ if((fapl2=H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
- if(H5Pset_multi_type(fapl2, H5FD_MEM_SUPER)<0)
+ if(H5Pset_multi_type(fapl2, H5FD_MEM_SUPER) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle) < 0)
TEST_ERROR;
if(*fhandle<0)
TEST_ERROR;
- if(H5Pset_multi_type(fapl2, H5FD_MEM_DRAW)<0)
+ if(H5Pset_multi_type(fapl2, H5FD_MEM_DRAW) < 0)
TEST_ERROR;
- if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2) < 0)
TEST_ERROR;
if(*fhandle2<0)
TEST_ERROR;
@@ -1056,11 +1056,11 @@ test_multi(void)
if(file_size < HADDR_MAX/2 || file_size > HADDR_MAX)
TEST_ERROR;
- if(H5Sclose(space)<0)
+ if(H5Sclose(space) < 0)
TEST_ERROR;
- if(H5Dclose(dset)<0)
+ if(H5Dclose(dset) < 0)
TEST_ERROR;
- if(H5Pclose(fapl2)<0)
+ if(H5Pclose(fapl2) < 0)
TEST_ERROR;
/* Create and write attribute for the root group. */
@@ -1068,34 +1068,34 @@ test_multi(void)
FAIL_STACK_ERROR
/* Attribute string. */
- if((atype = H5Tcopy(H5T_C_S1))<0)
+ if((atype = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
- if(H5Tset_size(atype, strlen(meta) + 1)<0)
+ if(H5Tset_size(atype, strlen(meta) + 1) < 0)
TEST_ERROR;
- if(H5Tset_strpad(atype, H5T_STR_NULLTERM)<0)
+ if(H5Tset_strpad(atype, H5T_STR_NULLTERM) < 0)
TEST_ERROR;
/* Create and write attribute */
- if((aspace = H5Screate_simple(1, adims, NULL))<0)
+ if((aspace = H5Screate_simple(1, adims, NULL)) < 0)
TEST_ERROR;
- if((attr = H5Acreate(root, "Metadata", atype, aspace, H5P_DEFAULT))<0)
+ if((attr = H5Acreate2(root, ".", "Metadata", atype, aspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(H5Awrite(attr, atype, meta)<0)
+ if(H5Awrite(attr, atype, meta) < 0)
TEST_ERROR;
/* Close IDs */
- if(H5Tclose(atype)<0)
+ if(H5Tclose(atype) < 0)
TEST_ERROR;
- if(H5Sclose(aspace)<0)
+ if(H5Sclose(aspace) < 0)
TEST_ERROR;
- if(H5Aclose(attr)<0)
+ if(H5Aclose(attr) < 0)
TEST_ERROR;
- if(H5Fclose(file)<0)
+ if(H5Fclose(file) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
@@ -1134,18 +1134,18 @@ error:
int
main(void)
{
- int nerrors=0;
+ int nerrors = 0;
h5_reset();
- nerrors += test_sec2()<0 ?1:0;
- nerrors += test_core()<0 ?1:0;
- nerrors += test_family()<0 ?1:0;
- nerrors += test_family_compat()<0 ?1:0;
- nerrors += test_multi()<0 ?1:0;
- nerrors += test_direct()<0 ?1:0;
+ nerrors += test_sec2() < 0 ? 1 : 0;
+ nerrors += test_core() < 0 ? 1 : 0;
+ nerrors += test_family() < 0 ? 1 : 0;
+ nerrors += test_family_compat() < 0 ? 1 : 0;
+ nerrors += test_multi() < 0 ? 1 : 0;
+ nerrors += test_direct() < 0 ? 1 : 0;
- if (nerrors){
+ if(nerrors) {
printf("***** %d Virtual File Driver TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
return 1;
@@ -1154,3 +1154,4 @@ main(void)
printf("All Virtual File Driver tests passed.\n");
return 0;
}
+