diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-21 14:56:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-21 14:56:20 (GMT) |
commit | d327b6eae6d41e03d2fddb139f4294d4b429c46c (patch) | |
tree | 6f22d646a6226fd13afe89ddb8cf7dee4e7cfa68 /src/H5HF.c | |
parent | 143cfe24b447f7470c8e25852bfec5705f6b7f47 (diff) | |
download | hdf5-d327b6eae6d41e03d2fddb139f4294d4b429c46c.zip hdf5-d327b6eae6d41e03d2fddb139f4294d4b429c46c.tar.gz hdf5-d327b6eae6d41e03d2fddb139f4294d4b429c46c.tar.bz2 |
[svn-r12603] Description:
Add a bunch more regression tests:
- Verify opening a fractal heap more than once works correctly
- Check that 0 & 1-sized object insertions are handled correctly
- Check that bad heap IDs are detected when attempting to read an
object
- Check that doubling tables with different parameter values are
working correctly
Add some more checks to the code to detect 0-sized object insertions and
bad heap IDs for reading.
Tested On:
FreeBSD/32 4.11 (sleipnir)
Linux/32 2.4 (heping)
Linux/64 2.4 (mir)
Solaris/64 2.9 (shanti)
Diffstat (limited to 'src/H5HF.c')
-rw-r--r-- | src/H5HF.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -196,7 +196,7 @@ HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr); if(NULL == (hdr = H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load fractal heap header") #ifdef QAK -HDfprintf(stderr, "%s: hdr->rc = %u\n", FUNC, hdr->rc); +HDfprintf(stderr, "%s: hdr->rc = %u, hdr->fspace = %p\n", FUNC, hdr->rc, hdr->fspace); #endif /* QAK */ /* Create fractal heap info */ @@ -323,14 +323,15 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, HDfprintf(stderr, "%s: size = %Zu\n", FUNC, size); #endif /* QAK */ - /* - * Check arguments. - */ + /* Sanity check */ HDassert(fh); - HDassert(size > 0); HDassert(obj); HDassert(id); + /* Check arguments */ + if(size == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "can't insert 0-sized objects") + /* Get the fractal heap header */ hdr = fh->hdr; |