summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-04-09 04:16:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-04-09 04:16:53 (GMT)
commitc1163e0399e052856124c62a5a34bcbd92756a1a (patch)
tree470a514f8fd89c78c2997a4e663de270d35e500f /test/dsets.c
parent0dc4ce37046c373ca48ed5d186e3598d7b48ed35 (diff)
downloadhdf5-c1163e0399e052856124c62a5a34bcbd92756a1a.zip
hdf5-c1163e0399e052856124c62a5a34bcbd92756a1a.tar.gz
hdf5-c1163e0399e052856124c62a5a34bcbd92756a1a.tar.bz2
[svn-r24995] Description:
Improve checks for NULL buffer from user during H5Dread/H5Dwrite calls. Tested on: Linux/32 2.4.x (jam) w/gcc
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 5f44ce2..3cd303f 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -6677,8 +6677,17 @@ test_zero_dims(hid_t file)
if(H5Pset_chunk(dcpl, 1, &csize) < 0) FAIL_STACK_ERROR
if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- /* Just a no-op */
+ /* Various no-op writes */
if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR
+ if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR
+ if(H5Dwrite(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR
+ if(H5Dwrite(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR
+
+ /* Various no-op reads */
+ if(H5Dread(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR
+ if(H5Dread(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR
+ if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR
+ if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, NULL) < 0) FAIL_STACK_ERROR
if(H5Dclose(d) < 0) FAIL_STACK_ERROR
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR