diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-12-29 20:36:34 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-12-29 20:36:34 (GMT) |
commit | 75951cfcf8fe9e5d8f9a7785828285eaddc0c3ae (patch) | |
tree | 443c8af14a5c4914859d7223e8f15be382484280 /src/H5Dint.c | |
parent | f9f462e720c03e3b73cfa5b9fb4f190212e50546 (diff) | |
download | hdf5-75951cfcf8fe9e5d8f9a7785828285eaddc0c3ae.zip hdf5-75951cfcf8fe9e5d8f9a7785828285eaddc0c3ae.tar.gz hdf5-75951cfcf8fe9e5d8f9a7785828285eaddc0c3ae.tar.bz2 |
[svn-r16223] Modified H5Dset_extent so that it fails when called for compact datasets and contiguous with no external storage
new test program: It adds tests for several ranks, use of fill value or not, compression, different fill value allocation times, use of different storage layouts, and external files
tested: windows, linux
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r-- | src/H5Dint.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index 3018108..221d448 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2294,6 +2294,20 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(0 == (H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") + /* Check if we are allowed to modify the space; only datasets with chunked and external storage are allowed to be modified */ + if( H5D_COMPACT == dset->shared->layout.type ) + { + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "dataset has compact storage") + } + if( H5D_CONTIGUOUS == dset->shared->layout.type ) + { + if( 0 == dset->shared->dcpl_cache.efl.nused) + { + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "dataset has contiguous storage") + } + + } + /* Check if the filters in the DCPL will need to encode, and if so, can they? */ if(H5D_check_filters(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") |