summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2013-09-28 20:41:41 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2013-09-28 20:41:41 (GMT)
commit252ed47f9b0333a112a49a5b23a1cc4a5e108b1e (patch)
tree3fed2e1d255671fbe932dfd826925949243cefe7
parent985d16da9face2a0b5e4a0dffdc1ca41853d844d (diff)
downloadhdf5-252ed47f9b0333a112a49a5b23a1cc4a5e108b1e.zip
hdf5-252ed47f9b0333a112a49a5b23a1cc4a5e108b1e.tar.gz
hdf5-252ed47f9b0333a112a49a5b23a1cc4a5e108b1e.tar.bz2
[svn-r24215] Bug fix: HDFFV-8271 Big.c error in address generated by random number.
Description: There is a bug in the current big.c tests. In a nut-shell, the writing part randomly picks 50 locations and write 4KB from that location. Random location range is from byte 0 to end of dataset. There is the problem--if the random location is greater than (end of dataset - 4KB), then error. Solution: Adjust the random number to be at least 4KB less than the end of the dataset. That allows it write 4KB more from the generated starting position. Also put in a proper error message if unexpected switch values happened. Tested: h5comittest plus jam serial build and test.
-rw-r--r--test/big.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/big.c b/test/big.c
index dffbbeb..7465e47 100644
--- a/test/big.c
+++ b/test/big.c
@@ -393,6 +393,11 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
HDfprintf(stdout, "Unexpected file size of NOFILE\n");
goto error;
break;
+
+ default:
+ HDfprintf(stdout, "Unexpected file size(%d)\n", testsize);
+ goto error;
+ break;
}
/*
@@ -431,7 +436,8 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
hs_size[0] = WRT_SIZE;
if ((mem_space = H5Screate_simple (1, hs_size, hs_size)) < 0) goto error;
for (i=0; i<wrt_n; i++) {
- hs_start[0] = randll (size2[0], i);
+ /* start position must be at least hs_size from the end */
+ hs_start[0] = randll (size2[0]-hs_size[0], i);
HDfprintf (out, "#%03d 0x%016Hx\n", i, hs_start[0]);
if (H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL,
hs_size, NULL) < 0) goto error;
@@ -604,7 +610,6 @@ usage(void)
int testvfd(vfd_t vfd)
{
hid_t fapl=-1;
- hsize_t family_size;
char filename[1024];
fsizes_t testsize;