From 74665d2a041abc2b49d80da3126114103fc4a557 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 16 Jul 1999 13:12:34 -0500 Subject: [svn-r1495] Corrections and small bugfixes to VL testing. --- test/tvltypes.c | 72 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/test/tvltypes.c b/test/tvltypes.c index d29a9e9..539ea99 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -111,10 +111,10 @@ test_vltypes_vlen_atomic(void) /* Allocate and initialize VL data to write */ for(i=0; ip=malloc((j+1)*sizeof(uint32_t)); + t1->p=malloc((j+1)*sizeof(unsigned int)); t1->len=j+1; for(k=0; k<(j+1); k++) - ((uint32_t *)t1->p)[k]=i*100+j*10+k; + ((unsigned int *)t1->p)[k]=i*100+j*10+k; } /* end for */ } /* end for */ @@ -542,8 +566,8 @@ test_vltypes_vlen_vlen_atomic(void) /* Make certain the correct amount of memory has been used */ /* 10 hvl_t elements allocated = 1 + 2 + 3 + 4 elements for each array position */ - /* 20 uint32_t elements allocated = 1 + 3 + 6 + 10 elements */ - VERIFY(mem_used,10*sizeof(hvl_t)+20*sizeof(uint32_t),"H5Dread"); + /* 20 unsigned int elements allocated = 1 + 3 + 6 + 10 elements */ + VERIFY(mem_used,10*sizeof(hvl_t)+20*sizeof(unsigned int),"H5Dread"); /* Compare data read in */ for(i=0; ilen; k++) { - if( ((uint32_t *)t1->p)[k] != ((uint32_t *)t2->p)[k] ) { + if( ((unsigned int *)t1->p)[k] != ((unsigned int *)t2->p)[k] ) { num_errs++; - printf("VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)k, (int)((uint32_t *)t1->p)[k], (int)k, (int)((uint32_t *)t2->p)[k]); + printf("VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)k, (int)((unsigned int *)t1->p)[k], (int)k, (int)((unsigned int *)t2->p)[k]); continue; } /* end if */ } /* end for */ @@ -575,6 +599,10 @@ test_vltypes_vlen_vlen_atomic(void) /* Make certain the VL memory has been freed */ VERIFY(mem_used,0,"H5Dvlen_reclaim"); + /* Reclaim the write VL data */ + ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata); + CHECK(ret, FAIL, "H5Dvlen_reclaim"); + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -591,6 +619,10 @@ test_vltypes_vlen_vlen_atomic(void) ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); + /* Close dataset transfer property list */ + ret = H5Pclose(xfer_pid); + CHECK(ret, FAIL, "H5Pclose"); + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -610,9 +642,9 @@ test_vltypes(void) /* These next tests use the same file */ test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */ - test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */ - test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ - test_vltypes_vlen_compound(); /* Test VL compound datatypes */ + test_vltypes_vlen_compound(); /* Test VL compound datatypes */ + test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */ + test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ } /* test_vltypes() */ -- cgit v0.12