[svn-r15802] Description:

Skip some file free space tests that deal with aligned allocations when
using the stdio VFD, which has its own allocation process that drops the
unaligned fragments instead of tracking them with the free space manager.

Tested on:
	Mac OS X/32 10.5.5 (amazon) w/stdio VFD
This commit is contained in:
Quincey Koziol 2008-10-07 09:14:14 -05:00
parent 9f60f016ab
commit c05f2a85a3

128
test/mf.c
View File

@ -3196,7 +3196,7 @@ error:
* H5MF_try_extend() the block with aligned address should succeed
*/
static int
test_mf_align_eoa(hid_t fapl, hid_t new_fapl)
test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
hid_t fapl1;
@ -3213,6 +3213,10 @@ test_mf_align_eoa(hid_t fapl, hid_t new_fapl)
TESTING("H5MM_alloc() of file allocation with alignment: test 1");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -3308,9 +3312,18 @@ test_mf_align_eoa(hid_t fapl, hid_t new_fapl)
TEST_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
TESTING("H5MF_try_shrink() of file allocation with alignment: test 2");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Re-open the file with alignment and meta/sdata setting */
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
@ -3351,9 +3364,18 @@ test_mf_align_eoa(hid_t fapl, hid_t new_fapl)
if (new_file_size != (file_size-TEST_BLOCK_SIZE50)) TEST_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
TESTING("H5MF_try_extend() of file allocation with alignment: test 3");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Re-open the file with alignment and meta/sdata setting */
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
@ -3394,6 +3416,11 @@ test_mf_align_eoa(hid_t fapl, hid_t new_fapl)
if (new_file_size != (file_size+TEST_BLOCK_SIZE30)) TEST_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -3435,7 +3462,7 @@ error:
* The block is allocated from file allocation and should be aligned
*/
static int
test_mf_align_fs(hid_t fapl, hid_t new_fapl)
test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -3611,6 +3638,10 @@ test_mf_align_fs(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of free-space manager with alignment: test 3");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
if((file_size = h5_get_file_size(filename)) < 0)
TEST_ERROR
@ -3681,6 +3712,11 @@ test_mf_align_fs(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -3788,7 +3824,7 @@ error:
* EOA is at 20372
*/
static int
test_mf_align_alloc1(hid_t fapl, hid_t new_fapl)
test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -3805,6 +3841,10 @@ test_mf_align_alloc1(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 1");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -3937,6 +3977,11 @@ test_mf_align_alloc1(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -4035,7 +4080,7 @@ error:
* EOA is at 18432
*/
static int
test_mf_align_alloc2(hid_t fapl, hid_t new_fapl)
test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -4050,6 +4095,10 @@ test_mf_align_alloc2(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 2");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -4204,6 +4253,11 @@ test_mf_align_alloc2(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -4350,7 +4404,7 @@ error:
* There is space of 1014 left in meta_aggr
*/
static int
test_mf_align_alloc3(hid_t fapl, hid_t new_fapl)
test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -4367,6 +4421,10 @@ test_mf_align_alloc3(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 3");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -4559,6 +4617,11 @@ test_mf_align_alloc3(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -4635,7 +4698,7 @@ error:
*
*/
static int
test_mf_align_alloc4(hid_t fapl, hid_t new_fapl)
test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -4651,6 +4714,10 @@ test_mf_align_alloc4(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 4");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -4752,6 +4819,11 @@ test_mf_align_alloc4(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -4829,7 +4901,7 @@ error:
* meta_aggr and sdata_aggr are all 0
*/
static int
test_mf_align_alloc5(hid_t fapl, hid_t new_fapl)
test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -4846,6 +4918,10 @@ test_mf_align_alloc5(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 5");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -4962,6 +5038,11 @@ test_mf_align_alloc5(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -5087,7 +5168,7 @@ error:
* meta_aggr is unchanged
*/
static int
test_mf_align_alloc6(hid_t fapl, hid_t new_fapl)
test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
char filename[FILENAME_LEN]; /* Filename to use */
@ -5103,6 +5184,10 @@ test_mf_align_alloc6(hid_t fapl, hid_t new_fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 6");
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
if(HDstrcmp(env_h5_drvr, "stdio")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@ -5256,6 +5341,11 @@ test_mf_align_alloc6(hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
PASSED()
} /* end if */
else {
SKIPPED();
puts(" Current VFD doesn't support mis-aligned fragments");
} /* end else */
return(0);
@ -5274,6 +5364,12 @@ main(void)
hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */
unsigned nerrors = 0; /* Cumulative error count */
test_type_t curr_test;
const char *env_h5_drvr = NULL; /* File Driver value from environment */
/* Get the VFD to use */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
if(env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
fapl = h5_fileaccess();
if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
@ -5359,14 +5455,14 @@ main(void)
TEST_ERROR;
} /* end switch */
nerrors += test_mf_align_eoa(fapl, new_fapl);
nerrors += test_mf_align_fs(fapl, new_fapl);
nerrors += test_mf_align_alloc1(fapl, new_fapl);
nerrors += test_mf_align_alloc2(fapl, new_fapl);
nerrors += test_mf_align_alloc3(fapl, new_fapl);
nerrors += test_mf_align_alloc4(fapl, new_fapl);
nerrors += test_mf_align_alloc5(fapl, new_fapl);
nerrors += test_mf_align_alloc6(fapl, new_fapl);
nerrors += test_mf_align_eoa(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_fs(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_alloc1(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_alloc2(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_alloc3(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_alloc4(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_alloc5(env_h5_drvr, fapl, new_fapl);
nerrors += test_mf_align_alloc6(env_h5_drvr, fapl, new_fapl);
}
if(nerrors)