[svn-r16405] #1449 Change set_extent test to use standard standalone test framework

use a fapl obtained by h5_fileaccess to the call of H5Fcreate
and redo the test calls with

h5_reset();
    fapl = h5_fileaccess();

    nerrors += do_ranks( fapl ) < 0 ? 1 : 0;
    nerrors += test_external( fapl ) < 0 ? 1 : 0;
    nerrors += do_layouts( fapl ) < 0 ? 1 : 0;

tested: windows, linux
This commit is contained in:
Pedro Vicente Nunes 2009-02-03 10:55:56 -05:00
parent 348c380e3f
commit dfaf4dec8e

View File

@ -53,24 +53,27 @@
#define DIME2 7
#define ISTORE_IK 64
static int do_ranks( void );
static int do_layouts( void );
static int do_ranks( hid_t fapl );
static int do_layouts( hid_t fapl );
static int test_rank1( hbool_t do_compress,
hbool_t do_fill_value,
hbool_t set_istore_k,
H5D_fill_time_t fill_time);
H5D_fill_time_t fill_time,
hid_t fapl);
static int test_rank2( hbool_t do_compress,
hbool_t do_fill_value,
hbool_t set_istore_k,
H5D_fill_time_t fill_time);
H5D_fill_time_t fill_time,
hid_t fapl);
static int test_rank3( hbool_t do_compress,
hbool_t do_fill_value,
hbool_t set_istore_k,
H5D_fill_time_t fill_time);
H5D_fill_time_t fill_time,
hid_t fapl);
static int test_external( void );
static int test_layouts( H5D_layout_t layout );
static int test_external( hid_t fapl );
static int test_layouts( H5D_layout_t layout, hid_t fapl );
/*-------------------------------------------------------------------------
* main
@ -79,24 +82,17 @@ static int test_layouts( H5D_layout_t layout );
int main( void )
{
if ( do_ranks() < 0 )
{
goto error;
}
if ( test_external() < 0 )
{
goto error;
}
if ( do_layouts() < 0 )
{
goto error;
}
puts("All set_extent tests passed.");
hid_t fapl; /* file access property list */
int nerrors = 0;
h5_reset();
fapl = h5_fileaccess();
nerrors += do_ranks( fapl ) < 0 ? 1 : 0;
nerrors += test_external( fapl ) < 0 ? 1 : 0;
nerrors += do_layouts( fapl ) < 0 ? 1 : 0;
HDremove(FILE_NAME1);
HDremove(FILE_NAME2);
HDremove(FILE_NAME3);
@ -105,11 +101,17 @@ int main( void )
HDremove(EXT_FILE_NAME1);
HDremove(EXT_FILE_NAME2);
if(nerrors)
{
printf("***** %d H5Dset_extent TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
exit(1);
}
puts("All H5Dset_extent tests passed.");
return 0;
error:
H5_FAILED();
return 1;
}
@ -118,7 +120,7 @@ error:
* test with several ranks
*-------------------------------------------------------------------------
*/
static int do_ranks( void )
static int do_ranks( hid_t fapl )
{
hbool_t do_compress = 0;
@ -130,27 +132,27 @@ static int do_ranks( void )
do_fillvalue = 1;
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET ) < 0)
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET, fapl ) < 0)
{
goto error;
}
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET, fapl ) < 0)
{
goto error;
}
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET ) < 0)
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET, fapl ) < 0)
{
goto error;
}
@ -164,15 +166,15 @@ static int do_ranks( void )
do_fillvalue = 0;
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR ) < 0)
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR, fapl ) < 0)
{
goto error;
}
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR, fapl ) < 0)
{
goto error;
}
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR ) < 0)
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR, fapl ) < 0)
{
goto error;
}
@ -188,27 +190,27 @@ static int do_ranks( void )
do_compress = 1;
do_fillvalue = 1;
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET ) < 0)
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET, fapl ) < 0)
{
goto error;
}
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET, fapl ) < 0)
{
goto error;
}
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET ) < 0)
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_IFSET, fapl ) < 0)
{
goto error;
}
@ -225,15 +227,15 @@ static int do_ranks( void )
do_fillvalue = 0;
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR ) < 0)
if (test_rank1( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR, fapl ) < 0)
{
goto error;
}
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR, fapl ) < 0)
{
goto error;
}
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR ) < 0)
if (test_rank3( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ERROR, fapl ) < 0)
{
goto error;
}
@ -248,7 +250,7 @@ static int do_ranks( void )
do_fillvalue = 1;
set_istore_k = 1;
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC ) < 0)
if (test_rank2( do_compress, do_fillvalue, set_istore_k, H5D_FILL_TIME_ALLOC, fapl ) < 0)
{
goto error;
}
@ -269,17 +271,17 @@ error:
* test with different storage layouts
*-------------------------------------------------------------------------
*/
static int do_layouts( void )
static int do_layouts( hid_t fapl )
{
TESTING("storage layout use");
if (test_layouts( H5D_COMPACT ) < 0)
if (test_layouts( H5D_COMPACT, fapl ) < 0)
{
goto error;
}
if (test_layouts( H5D_CONTIGUOUS ) < 0)
if (test_layouts( H5D_CONTIGUOUS, fapl ) < 0)
{
goto error;
}
@ -300,7 +302,8 @@ error:
static int test_rank1( hbool_t do_compress,
hbool_t do_fill_value,
hbool_t set_istore_k,
H5D_fill_time_t fill_time)
H5D_fill_time_t fill_time,
hid_t fapl)
{
hid_t fid=-1;
@ -354,7 +357,7 @@ static int test_rank1( hbool_t do_compress,
}
/* create a new file */
if ((fid = H5Fcreate(FILE_NAME1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
if ((fid = H5Fcreate(FILE_NAME1, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
{
goto error;
}
@ -833,7 +836,8 @@ error:
static int test_rank2( hbool_t do_compress,
hbool_t do_fill_value,
hbool_t set_istore_k,
H5D_fill_time_t fill_time)
H5D_fill_time_t fill_time,
hid_t fapl)
{
hid_t fid=-1;
@ -889,7 +893,7 @@ static int test_rank2( hbool_t do_compress,
}
/* create a new file */
if ((fid = H5Fcreate(FILE_NAME2, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
if ((fid = H5Fcreate(FILE_NAME2, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
{
goto error;
}
@ -1424,7 +1428,8 @@ error:
static int test_rank3( hbool_t do_compress,
hbool_t do_fill_value,
hbool_t set_istore_k,
H5D_fill_time_t fill_time)
H5D_fill_time_t fill_time,
hid_t fapl)
{
hid_t fid=-1;
@ -1483,7 +1488,7 @@ static int test_rank3( hbool_t do_compress,
}
/* create a new file */
if ((fid = H5Fcreate(FILE_NAME3, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
if ((fid = H5Fcreate(FILE_NAME3, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
{
goto error;
}
@ -2004,7 +2009,7 @@ error:
* test usage with external storage
*-------------------------------------------------------------------------
*/
static int test_external( void )
static int test_external( hid_t fapl )
{
hid_t fid=-1;
@ -2043,7 +2048,7 @@ static int test_external( void )
TESTING("external file use");
/* create a new file */
if ((fid = H5Fcreate(FILE_NAME4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if ((fid = H5Fcreate(FILE_NAME4, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
{
goto error;
}
@ -2379,7 +2384,7 @@ error:
* test usage with layouts compact and contiguous
*-------------------------------------------------------------------------
*/
static int test_layouts( H5D_layout_t layout )
static int test_layouts( H5D_layout_t layout, hid_t fapl )
{
hid_t fid=-1;
@ -2404,7 +2409,7 @@ static int test_layouts( H5D_layout_t layout )
/* create a new file */
if ((fid = H5Fcreate(FILE_NAME5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
if ((fid = H5Fcreate(FILE_NAME5, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
{
goto error;
}