summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5D.c19
-rw-r--r--test/external.c11
2 files changed, 11 insertions, 19 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 516103d..699ec9a 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1069,21 +1069,24 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[])
{
H5D_t *dset; /* Dataset for this operation */
herr_t ret_value = SUCCEED; /* Return value */
-
+
FUNC_ENTER_API(H5Dset_extent, FAIL)
H5TRACE2("e", "i*h", dset_id, size);
-
+
/* Check args */
if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
if(!size)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified")
+ /* layout must be chunked */
+ if(H5D_CHUNKED != dset->shared->layout.type)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "layout must be chunked")
+
/* Private function */
if(H5D_set_extent(dset, size, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset")
-
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset")
+
done:
- FUNC_LEAVE_API(ret_value)
+ FUNC_LEAVE_API(ret_value)
} /* end H5Dset_extent() */
diff --git a/test/external.c b/test/external.c
index 2f3cdf6..35d31dc 100644
--- a/test/external.c
+++ b/test/external.c
@@ -784,17 +784,6 @@ test_3 (hid_t fapl)
} /* end if */
} /* end for */
- /* Extend the dataset by another 100 elements */
- if(H5Dset_extent(dset, &max_size) < 0) goto error;
- if(H5Sclose(file_space) < 0) goto error;
- if((file_space = H5Dget_space(dset)) < 0) goto error;
-
- /* Write second half of dataset */
- for(i = 0; i < hs_count; i++)
- whole[i] = 100 + i;
- if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, &hs_start, NULL, &hs_count, NULL) < 0) goto error;
- if(H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, whole) < 0) goto error;
-
if(H5Dclose(dset) < 0) goto error;
if(H5Pclose(dcpl) < 0) goto error;