From 22243fd75d15d40ab491e7f8ac74ad2bb8a77486 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 11 Jun 2009 10:03:54 -0500 Subject: [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 --- src/H5MF.c | 4 ++++ test/mf.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/H5MF.c b/src/H5MF.c index a3769d1..2cf52b0 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -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); diff --git a/test/mf.c b/test/mf.c index 4259520..8b5c51b 100644 --- a/test/mf.c +++ b/test/mf.c @@ -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; -- cgit v0.12