summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-10-14 19:46:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-10-14 19:46:13 (GMT)
commitcc1502af9c304cd5f51eedeedf1e190f771cd556 (patch)
treeb7d82900161eff17eb707058c3f2c5a28d5f6039
parenta47135b29e152e689d57cb890409f72037061344 (diff)
downloadhdf5-cc1502af9c304cd5f51eedeedf1e190f771cd556.zip
hdf5-cc1502af9c304cd5f51eedeedf1e190f771cd556.tar.gz
hdf5-cc1502af9c304cd5f51eedeedf1e190f771cd556.tar.bz2
[svn-r5990] Purpose:
Code cleanup Description: Clean up some compile warnings and have these tests create their data files with the correct file drivers and directories, etc. Platforms tested: FreeBSD 4.6 (sleipnir) w and w/o parallel Linux 2.2.x (eirene) w/FORTRAN & C++ Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/FORTRAN & parallel
-rw-r--r--test/dsets.c11
-rw-r--r--test/file_handle.c29
2 files changed, 20 insertions, 20 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 7442c50..11bad7f 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -285,12 +285,13 @@ test_simple_io(hid_t file)
*-------------------------------------------------------------------------
*/
static herr_t
-test_compact_io(void)
+test_compact_io(hid_t fapl)
{
hid_t file, dataset, space, plist;
hsize_t dims[2];
herr_t status;
int wbuf[16][8], rbuf[16][8];
+ char filename[1024];
int i, j, n;
TESTING("compact dataset I/O");
@@ -310,7 +311,8 @@ test_compact_io(void)
assert(space>=0);
/* Create a file */
- if((file=H5Fcreate(FILENAME[1], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
goto error;
/* Create property list for compact dataset creation */
@@ -337,7 +339,7 @@ test_compact_io(void)
/*
* Open the file and check data
*/
- if((file=H5Fopen(FILENAME[1], H5F_ACC_RDONLY, H5P_DEFAULT))<0)
+ if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0)
goto error;
if((dataset = H5Dopen(file, DSET_COMPACT_IO_NAME))<0)
goto error;
@@ -986,7 +988,6 @@ main(void)
#endif
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
goto error;
}
@@ -999,7 +1000,7 @@ main(void)
nerrors += test_create(file)<0 ?1:0;
nerrors += test_simple_io(file)<0 ?1:0;
- nerrors += test_compact_io()<0 ?1:0;
+ nerrors += test_compact_io(fapl)<0 ?1:0;
nerrors += test_tconv(file)<0 ?1:0;
nerrors += test_compression(file)<0 ?1:0;
nerrors += test_multiopen (file)<0 ?1:0;
diff --git a/test/file_handle.c b/test/file_handle.c
index b644faa..2457586 100644
--- a/test/file_handle.c
+++ b/test/file_handle.c
@@ -43,7 +43,7 @@ const char *FILENAME[] = {
static herr_t
test_sec2(void)
{
- hid_t file, fapl;
+ hid_t file=(-1), fapl;
char filename[1024];
int *fhandle=NULL;
@@ -59,7 +59,7 @@ test_sec2(void)
goto error;
/* Check file handle API */
- if(H5Fget_vfd_handle(file, H5P_DEFAULT, &fhandle)<0)
+ if(H5Fget_vfd_handle(file, H5P_DEFAULT, (void **)&fhandle)<0)
goto error;
if(*fhandle<0)
goto error;
@@ -98,7 +98,7 @@ error:
static herr_t
test_core(void)
{
- hid_t file, fapl;
+ hid_t file=(-1), fapl;
char filename[1024];
void *fhandle=NULL;
@@ -155,7 +155,7 @@ error:
static herr_t
test_family(void)
{
- hid_t file, fapl, fapl2, space, dset;
+ hid_t file=(-1), fapl, fapl2=(-1), space=(-1), dset=(-1);
char filename[1024];
char dname[]="dataset";
int i, j;
@@ -167,7 +167,7 @@ test_family(void)
/* Set property list and file name for FAMILY driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_family(fapl, FAMILY_SIZE, H5P_DEFAULT)<0)
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0)
goto error;
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
@@ -189,17 +189,17 @@ test_family(void)
/* check file handle API */
if((fapl2=H5Pcreate(H5P_FILE_ACCESS))<0)
goto error;
- if(H5Pset_family_offset(fapl2, 0)<0)
+ if(H5Pset_family_offset(fapl2, (hsize_t)0)<0)
goto error;
- if(H5Fget_vfd_handle(file, fapl2, &fhandle)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0)
goto error;
if(*fhandle<0)
goto error;
- if(H5Pset_family_offset(fapl2, FAMILY_SIZE*2)<0)
+ if(H5Pset_family_offset(fapl2, (hsize_t)(FAMILY_SIZE*2))<0)
goto error;
- if(H5Fget_vfd_handle(file, fapl2, &fhandle2)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0)
goto error;
if(*fhandle2<0)
goto error;
@@ -247,7 +247,7 @@ error:
static herr_t
test_multi(void)
{
- hid_t file, fapl, fapl2, dset, space;
+ hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1);
char filename[1024];
int *fhandle2=NULL, *fhandle=NULL;
H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
@@ -275,12 +275,12 @@ test_multi(void)
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
- sprintf(sv[H5FD_MEM_SUPER], "%c.meta", 's');
+ sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
- sprintf(sv[H5FD_MEM_DRAW], "%c.raw", 'r');
+ sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
@@ -307,14 +307,14 @@ test_multi(void)
goto error;
if(H5Pset_multi_type(fapl2, H5FD_MEM_SUPER)<0)
goto error;
- if(H5Fget_vfd_handle(file, fapl2, &fhandle)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle)<0)
goto error;
if(*fhandle<0)
goto error;
if(H5Pset_multi_type(fapl2, H5FD_MEM_DRAW)<0)
goto error;
- if(H5Fget_vfd_handle(file, fapl2, &fhandle2)<0)
+ if(H5Fget_vfd_handle(file, fapl2, (void **)&fhandle2)<0)
goto error;
if(*fhandle2<0)
goto error;
@@ -365,7 +365,6 @@ error:
int
main(void)
{
- hid_t file;
int nerrors=0;
h5_reset();