summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-12-29 20:54:58 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-12-29 20:54:58 (GMT)
commiteb3eb77e5741ead1beb2f294aff4cd9f461f8c06 (patch)
tree72facdec25caf4a1c2194b14bedad3dc253c1c1a /src
parent972a1f1003c50c017f5d229841e34e1564f5a87d (diff)
downloadhdf5-eb3eb77e5741ead1beb2f294aff4cd9f461f8c06.zip
hdf5-eb3eb77e5741ead1beb2f294aff4cd9f461f8c06.tar.gz
hdf5-eb3eb77e5741ead1beb2f294aff4cd9f461f8c06.tar.bz2
[svn-r16224] merge from 16223
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')
-rw-r--r--src/H5Dint.c14
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")