From 252ed47f9b0333a112a49a5b23a1cc4a5e108b1e Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 28 Sep 2013 15:41:41 -0500 Subject: [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. --- test/big.c | 9 +++++++-- 1 file 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