[svn-r17031] Description:

Correct latent bug in one file space allocation test which was not
getting a new file pointer when reopening a file.

	Also, add a couple more asserts to the file space allocation code in
the library to help detect this problem earlier.

Tested on:
	Linux/32 2.6 (jam) w/core VFD
This commit is contained in:
Quincey Koziol 2009-06-11 10:03:54 -05:00
parent eda3b5015f
commit 22243fd75d
2 changed files with 13 additions and 1 deletions

View File

@ -302,6 +302,8 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
/* check arguments */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->lf);
HDassert(size > 0);
/* Get free space type from allocation type */
@ -768,6 +770,8 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
/* check arguments */
HDassert(f);
HDassert(f->shared);
HDassert(f->shared->lf);
HDassert(H5F_addr_defined(addr));
HDassert(size > 0);

View File

@ -3753,6 +3753,10 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* shrink the block */
if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0)
TEST_ERROR
@ -3804,6 +3808,10 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* try to extend the block */
extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr1, (hsize_t)TEST_BLOCK_SIZE50, (hsize_t)TEST_BLOCK_SIZE30);
@ -5864,7 +5872,7 @@ main(void)
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);
}
} /* end if */
if(nerrors)
goto error;