From a67dbbaf810f44b7b05a72fa38fa1da621651896 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 11 Apr 2011 10:59:41 -0500 Subject: [svn-r20469] Bug 1386 - allow dimension size to be zero even though it isn't unlimited. This is a follow-up checkin for r20440: 1. I added a test case of extending dataset of zero dimension size and shrinking back to zero dimension size. 2. I updated the Makefile to include the new data file to be cleaned up. Tested on jam - relatively simple. --- configure | 2 +- src/H5Oefl.c | 6 ++++- test/Makefile.am | 2 +- test/Makefile.in | 2 +- test/th5s.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 5 files changed, 71 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 243269a..270fa38 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 20315 2011-03-24 18:33:45Z songyulu . +# From configure.in Id: configure.in 20405 2011-04-04 02:28:07Z koziol . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.81. # diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 0d71be9..b97138f 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -81,6 +81,11 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ * Programmer: Robb Matzke * Tuesday, November 25, 1997 * + * Modification: + * Raymond Lu + * 11 April 2011 + * We allow zero dimension size starting from the 1.8.7 release. + * The dataset size of external storage can be zero. *------------------------------------------------------------------------- */ static void * @@ -156,7 +161,6 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, /* Size */ H5F_DECODE_LENGTH (f, p, mesg->slot[u].size); - HDassert(mesg->slot[u].size > 0); } /* end for */ if(H5HL_unprotect(heap) < 0) diff --git a/test/Makefile.am b/test/Makefile.am index 6abd20b..718092e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -108,7 +108,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ - sys_file1 tfile[1-5].h5 th5s[1-3].h5 lheap.h5 fheap.h5 ohdr.h5 \ + sys_file1 tfile[1-5].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ diff --git a/test/Makefile.in b/test/Makefile.in index 98fa754..3c2a57a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -714,7 +714,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 \ - frspace.h5 links*.h5 sys_file1 tfile[1-5].h5 th5s[1-3].h5 \ + frspace.h5 links*.h5 sys_file1 tfile[1-5].h5 th5s[1-4].h5 \ lheap.h5 fheap.h5 ohdr.h5 stab.h5 extern_[1-3].h5 \ extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] links.h5 \ links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \ diff --git a/test/th5s.c b/test/th5s.c index 2aa4a92..2435fc9 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -528,6 +528,7 @@ test_h5s_zero_dim(void) hid_t attr; /* Attribute ID */ int rank; /* Logical rank of dataspace */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t chunk_dims[] = {SPACE1_DIM1, SPACE1_DIM2/3, SPACE1_DIM3}; hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ int wdata[SPACE1_DIM2][SPACE1_DIM3]; @@ -610,6 +611,12 @@ test_h5s_zero_dim(void) rdata_short[i][j] = 7; } + for(i=0; i