summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-09-07 00:22:07 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-09-07 00:22:07 (GMT)
commita8df8470bbd6d5abd52f8c53b4d63e8add59adcc (patch)
treece51431f4652d02a9465f89df62bcd34e5ec6190 /test
parentecfcf34b945ec2b2412ac5a991fbdaf6489c655e (diff)
downloadhdf5-a8df8470bbd6d5abd52f8c53b4d63e8add59adcc.zip
hdf5-a8df8470bbd6d5abd52f8c53b4d63e8add59adcc.tar.gz
hdf5-a8df8470bbd6d5abd52f8c53b4d63e8add59adcc.tar.bz2
[svn-r27689] Merge of r27459 and r27460 from trunk
Minor warning cleanup (27459) Renamed a few "h5tri_t extended" variables to "h5tri_t was_extended". Apparently, "extended" is a typedef name someplace in the headers used on Solaris, which causes potentially confusing warnings to be emitted. (27460) Minor code cleanup in test/trefer.c - Fixed an out-of-range char assignment. - Added a couple of malloc() casts. Tested on: h5committest
Diffstat (limited to 'test')
-rw-r--r--test/mf.c70
-rw-r--r--test/trefer.c6
2 files changed, 38 insertions, 38 deletions
diff --git a/test/mf.c b/test/mf.c
index b5d1255..b037fc9 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -589,12 +589,12 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* File size */
- H5FD_mem_t type;
+ H5FD_mem_t type;
haddr_t addr;
- htri_t extended;
- haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
- hsize_t ma_size=0, new_ma_size=0;
- hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ htri_t was_extended;
+ haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
+ hsize_t ma_size=0, new_ma_size=0;
+ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_extend() of file allocation: test 1");
@@ -666,9 +666,9 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* should succeed */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)TEST_BLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)TEST_BLOCK_SIZE50);
- if(extended <= 0)
+ if(was_extended <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -725,10 +725,10 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
if(new_ma_addr != ma_addr)
TEST_ERROR
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr, (hsize_t)(TEST_BLOCK_SIZE30-10), (hsize_t)(TEST_BLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr, (hsize_t)(TEST_BLOCK_SIZE30-10), (hsize_t)(TEST_BLOCK_SIZE50));
/* should not succeed */
- if(extended > 0)
+ if(was_extended > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -1435,7 +1435,7 @@ test_mf_fs_extend(hid_t fapl)
frspace_state_t state; /* State of free space*/
H5MF_sect_ud_t udata;
H5FS_section_info_t *node;
- htri_t extended;
+ htri_t was_extended;
TESTING("H5MF_try_extend() of free-space manager:test 1");
@@ -1529,10 +1529,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)TEST_BLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)TEST_BLOCK_SIZE50);
/* should succeed */
- if(extended <= 0)
+ if(was_extended <= 0)
TEST_ERROR
/* Section B is removed from free-space manager */
@@ -1647,10 +1647,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)(TEST_BLOCK_SIZE50+10));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)(TEST_BLOCK_SIZE50+10));
/* Should not be able to extend the allocated block */
- if(extended)
+ if(was_extended)
TEST_ERROR
/* free-space info should remain the same */
@@ -1760,10 +1760,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)(TEST_BLOCK_SIZE40));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)TEST_BLOCK_SIZE30, (hsize_t)(TEST_BLOCK_SIZE40));
/* Should succeed in extending the allocated block */
- if(extended <=0)
+ if(was_extended <=0)
TEST_ERROR
/* Should have 1 section of size=10 left in free-space manager */
@@ -1873,10 +1873,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)(TEST_BLOCK_SIZE30-10), (hsize_t)TEST_BLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)TEST_BLOCK_ADDR70, (hsize_t)(TEST_BLOCK_SIZE30-10), (hsize_t)TEST_BLOCK_SIZE50);
/* Should not succeed in extending the allocated block */
- if(extended)
+ if(was_extended)
TEST_ERROR
/* Free-space info should be the same */
@@ -3222,7 +3222,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
haddr_t new_addr, addr, saddr;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
hsize_t ma_size=0, new_ma_size=0, sdata_size=0;
- htri_t extended;
+ htri_t was_extended;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1");
@@ -3267,10 +3267,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
/* Try to extend the block by an amount < (% * aggr->alloc_size) */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
/* should succeed */
- if(!extended)
+ if(!was_extended)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3283,10 +3283,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE50);
/* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE700));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE700));
/* should succeed */
- if(!extended)
+ if(!was_extended)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3299,10 +3299,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE700);
/* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE2058));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE2058));
/* should succeed */
- if(!extended)
+ if(!was_extended)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3365,9 +3365,9 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
/* should be able to fulfill request from the aggreqator itself */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
- if(!extended)
+ if(!was_extended)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3435,9 +3435,9 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
/* unable to fulfill request from the aggreqator itself */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50));
- if(extended)
+ if(was_extended)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3753,7 +3753,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
haddr_t addr1, addr2;
haddr_t ma_addr=HADDR_UNDEF;
hsize_t ma_size=0;
- htri_t extended;
+ htri_t was_extended;
frspace_state_t state;
hsize_t alignment=0, mis_align=0, tmp=0, accum=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -3959,9 +3959,9 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* try to extend the block */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr1, (hsize_t)TEST_BLOCK_SIZE50, (hsize_t)TEST_BLOCK_SIZE30);
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr1, (hsize_t)TEST_BLOCK_SIZE50, (hsize_t)TEST_BLOCK_SIZE30);
- if (extended <=0) TEST_ERROR
+ if (was_extended <=0) TEST_ERROR
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -4033,7 +4033,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
haddr_t addr;
frspace_state_t state;
H5MF_sect_ud_t udata;
- htri_t extended;
+ htri_t was_extended;
hsize_t alignment=0, tmp=0, mis_align=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -4178,9 +4178,9 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* try to extend the block */
- extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr, (hsize_t)TEST_BLOCK_SIZE600, (hsize_t)TEST_BLOCK_SIZE200);
+ was_extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)addr, (hsize_t)TEST_BLOCK_SIZE600, (hsize_t)TEST_BLOCK_SIZE200);
- if (extended <=0) TEST_ERROR
+ if (was_extended <=0) TEST_ERROR
/* space should be decreased by 200, # of sections remain the same */
state.tot_space -= TEST_BLOCK_SIZE200;
diff --git a/test/trefer.c b/test/trefer.c
index c99d7ee..93c7dd4 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -493,7 +493,7 @@ test_reference_region(void)
hsize_t high[SPACE2_RANK]; /* Selection bounds */
hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
- hdset_reg_ref_t nvrbuf[3]={{0},{101},{1000000000}}; /* buffer with non-valid refs */
+ hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
*drbuf; /* Buffer for reading numeric data from disk */
uint8_t *tu8; /* Temporary pointer to uint8 data */
@@ -716,7 +716,7 @@ test_reference_region(void)
VERIFY(ret, 36, "H5Sget_select_npoints");
ret = (int)H5Sget_select_hyper_nblocks(sid2);
VERIFY(ret, 1, "H5Sget_select_hyper_nblocks");
- coords = HDmalloc(ret * SPACE2_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */
+ coords = (hsize_t *)HDmalloc(ret * SPACE2_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */
ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords);
CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
VERIFY(coords[0], 2, "Hyperslab Coordinates");
@@ -744,7 +744,7 @@ test_reference_region(void)
VERIFY(ret, 10, "H5Sget_select_npoints");
ret = (int)H5Sget_select_elem_npoints(sid2);
VERIFY(ret, 10, "H5Sget_select_elem_npoints");
- coords = HDmalloc(ret * SPACE2_RANK * sizeof(hsize_t)); /* allocate space for the element points */
+ coords = (hsize_t *)HDmalloc(ret * SPACE2_RANK * sizeof(hsize_t)); /* allocate space for the element points */
ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords);
CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
VERIFY(coords[0], coord1[0][0], "Element Coordinates");