summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-05-19 22:12:50 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-05-19 22:12:50 (GMT)
commitd41b5be368dbfc9298fdae92ec4aa752593915b8 (patch)
treeb70f151f6a7f4e2ea51ec1c70624b4dddefdd28b /hl
parent80e6dfe3ba830d2e1399737ecd23b16889c262c9 (diff)
downloadhdf5-d41b5be368dbfc9298fdae92ec4aa752593915b8.zip
hdf5-d41b5be368dbfc9298fdae92ec4aa752593915b8.tar.gz
hdf5-d41b5be368dbfc9298fdae92ec4aa752593915b8.tar.bz2
[svn-r18859] pull r18858 from 185;
Cange allocation of buffer to use the specified dimensions to calculate the size of a data buffer. Also removed any initialized values.
Diffstat (limited to 'hl')
-rw-r--r--hl/test/test_ds.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 540e7e2..53870f5 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -243,8 +243,7 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
int rank = 3;
int rankds = 1;
hsize_t dims[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE};
- char buf[DIM_DATA*3] = {1,2,3,4,5,6,7,8,9,10,11,12,
- 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12};
+ char buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
@@ -297,8 +296,7 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
int rank = 3;
int rankds = 1;
hsize_t dims[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE};
- short buf[DIM_DATA*3] = {1,2,3,4,5,6,7,8,9,10,11,12,
- 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12};
+ short buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
@@ -352,7 +350,7 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
int rank = RANK;
int rankds = 1;
hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE};
- int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12};
+ int buf[DIM1_SIZE*DIM2_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
int s1_wbuf[DIM1_SIZE] = {10,20,30};
@@ -394,10 +392,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
int rank = 4;
int rankds = 1;
hsize_t dims[4] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE,DIM4_SIZE};
- long buf[DIM_DATA*3*2] = {1,2,3,4,5,6,7,8,9,10,11,12,
- 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,
- 1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,
- 1,2,3,4,5,6,7,8,9,10,11,12};
+ long buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE*DIM4_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
@@ -463,7 +458,7 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims)
int rank = RANK;
int rankds = 1;
hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE};
- float buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12};
+ float buf[DIM1_SIZE*DIM2_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
float s1_wbuf[DIM1_SIZE] = {10,20,30};