summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
authorlrknox <lrknox>2017-03-22 17:01:22 (GMT)
committerlrknox <lrknox>2017-03-22 17:01:22 (GMT)
commitd37561605bda978ef8e5de03997dca4e493e213b (patch)
treed64fe8f0c74ccc063323dfb3ae3fdb24fac55380 /c++/test
parent36a30ecfd288afdf8ea62a858644e622ce72fd58 (diff)
parentd605ce46b37a1ca33d1e474fda78009e9bdabb18 (diff)
downloadhdf5-d37561605bda978ef8e5de03997dca4e493e213b.zip
hdf5-d37561605bda978ef8e5de03997dca4e493e213b.tar.gz
hdf5-d37561605bda978ef8e5de03997dca4e493e213b.tar.bz2
Merge branch 'hdf5_1_10' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into hdf5_1_10
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/tfile.cpp54
-rw-r--r--c++/test/titerate.cpp6
-rw-r--r--c++/test/trefer.cpp24
-rw-r--r--c++/test/ttypes.cpp3
-rw-r--r--c++/test/tvlstr.cpp41
5 files changed, 68 insertions, 60 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index eb07657..715bb30 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -812,19 +812,17 @@ const H5std_string FILE7("tfile7.h5");
*
*-------------------------------------------------------------------------
*/
+const hsize_t FSP_SIZE_DEF = 4096;
+const hsize_t FSP_SIZE512 = 512;
static void test_file_info()
{
// Output message about test being performed
SUBTEST("File general information");
-#ifndef H5_NO_DEPRECATED_SYMBOLS
- hsize_t in_threshold = 2; // Free space section threshold to set */
- hsize_t out_threshold = 0; // Free space section threshold to get */
+ hsize_t out_threshold = 0; // Free space section threshold to get
+ hbool_t out_persist = FALSE;// Persist free-space read
// File space handling strategy
- H5F_file_space_type_t in_strategy = H5F_FILE_SPACE_ALL;
- // File space handling strategy
- H5F_file_space_type_t out_strategy = H5F_FILE_SPACE_DEFAULT;
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ H5F_fspace_strategy_t out_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR;
try {
// Create a file using default properties.
@@ -843,14 +841,30 @@ static void test_file_info()
// Create file creation property list.
FileCreatPropList fcpl;
+ // Retrieve file space information.
+ fcpl.getFileSpaceStrategy(out_strategy, out_persist, out_threshold);
+
+ // Verify file space information.
+ verify_val(out_strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(out_persist, FALSE, "H5File::getFileInfo", __LINE__, __FILE__);
+ verify_val(out_threshold, 1, "H5File::getFileInfo", __LINE__, __FILE__);
+
+ /* Retrieve file space page size */
+ hsize_t out_fsp_psize = fcpl.getFileSpacePagesize();
+ verify_val(out_fsp_psize, FSP_SIZE_DEF, "FileCreatPropList::getFileSpacePagesize", __LINE__, __FILE__);
+
// Set various file information.
fcpl.setUserblock(F2_USERBLOCK_SIZE);
fcpl.setSizes(F2_OFFSET_SIZE, F2_LENGTH_SIZE);
fcpl.setSymk(F2_SYM_INTERN_K, F2_SYM_LEAF_K);
fcpl.setIstorek(F2_ISTORE);
-#ifndef H5_NO_DEPRECATED_SYMBOLS
- fcpl.setFileSpace(in_strategy, in_threshold);
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+ hsize_t threshold = 5; // Free space section threshold to set
+ hbool_t persist = TRUE; // Persist free-space to set
+ H5F_fspace_strategy_t strategy = H5F_FSPACE_STRATEGY_PAGE;
+
+ fcpl.setFileSpaceStrategy(strategy, persist, threshold);
+ fcpl.setFileSpacePagesize(FSP_SIZE512);
// Creating a file with the non-default file creation property list
// should create a version 1 superblock
@@ -863,11 +877,7 @@ static void test_file_info()
// Get the file's version information.
file7.getFileInfo(finfo);
-#ifndef H5_NO_DEPRECATED_SYMBOLS
verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__);
-#else /* H5_NO_DEPRECATED_SYMBOLS */
- verify_val(finfo.super.version, 1, "H5File::getFileInfo", __LINE__, __FILE__);
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
@@ -882,11 +892,7 @@ static void test_file_info()
// Get the file's version information.
file7.getFileInfo(finfo);
-#ifndef H5_NO_DEPRECATED_SYMBOLS
verify_val(finfo.super.version, 2, "H5File::getFileInfo", __LINE__, __FILE__);
-#else /* H5_NO_DEPRECATED_SYMBOLS */
- verify_val(finfo.super.version, 1, "H5File::getFileInfo", __LINE__, __FILE__);
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
verify_val(finfo.free.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
verify_val(finfo.sohm.version, 0, "H5File::getFileInfo", __LINE__, __FILE__);
@@ -912,14 +918,14 @@ static void test_file_info()
VERIFY(nindexes, MISC11_NINDEXES, "H5Pget_shared_mesg_nindexes");
*/
-#ifndef H5_NO_DEPRECATED_SYMBOLS
// Get and verify the file space info from the creation property list */
- out_strategy = fcpl2.getFileSpaceStrategy();
- verify_val(static_cast<unsigned>(out_strategy), static_cast<unsigned>(in_strategy), "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
+ fcpl2.getFileSpaceStrategy(out_strategy, out_persist, out_threshold);
+ verify_val(out_strategy, strategy, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
+ verify_val(out_persist, persist, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
+ verify_val(out_threshold, threshold, "FileCreatPropList::getFileSpaceStrategy", __LINE__, __FILE__);
- out_threshold = fcpl2.getFileSpaceThreshold();
- verify_val(static_cast<unsigned>(out_threshold), static_cast<unsigned>(in_threshold), "FileCreatPropList::getFileSpaceThreshold", __LINE__, __FILE__);
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ out_fsp_psize = fcpl2.getFileSpacePagesize();
+ verify_val(out_fsp_psize, FSP_SIZE512, "FileCreatPropList::getFileSpacePagesize", __LINE__, __FILE__);
PASSED();
} // end of try block
diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp
index fce42fa..34e6892 100644
--- a/c++/test/titerate.cpp
+++ b/c++/test/titerate.cpp
@@ -503,9 +503,9 @@ void test_iterate()
FileAccPropList fapl;
fapl.setLibverBounds(H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
- test_iter_group(fapl); // Test iterating groups
- test_HDFFV_9920(); // Test the fix of HDFFV-9920
- //test_iter_attr(fapl); // Test iterating attributes
+ test_iter_group(fapl); // Test iterating groups
+ test_HDFFV_9920(); // Test the fix of HDFFV-9920
+ //test_iter_attr(fapl); // Test iterating attributes
} // test_iterate
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index d8a0d5f..c232809 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -16,7 +16,7 @@
/*****************************************************************************
FILE
trefer.cpp - HDF5 C++ testing the functionalities associated with the C
- Reference interface (H5R)
+ Reference interface (H5R)
***************************************************************************/
#ifdef OLD_HEADER_FILENAME
@@ -93,7 +93,7 @@ test_reference_params(void)
file1 = new H5File (FILE1, H5F_ACC_TRUNC);
// Create dataspace for datasets
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
DataSpace sid1(SPACE1_RANK, dims1);
// Create a group
@@ -172,7 +172,7 @@ test_reference_params(void)
catch (Exception& E)
{
issue_fail_msg("test_reference_param()",__LINE__,__FILE__,
- E.getCFuncName(), E.getCDetailMsg());
+ E.getCFuncName(), E.getCDetailMsg());
}
if(file1)
@@ -209,7 +209,7 @@ static void test_reference_obj(void)
file1 = new H5File (FILE1, H5F_ACC_TRUNC);
// Create dataspace for datasets
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
DataSpace sid1(SPACE1_RANK, dims1);
// Create dataset access property list
@@ -364,7 +364,7 @@ static void test_reference_obj(void)
catch (Exception& E)
{
issue_fail_msg("test_reference_obj()",__LINE__,__FILE__,
- E.getCFuncName(), E.getCDetailMsg());
+ E.getCFuncName(), E.getCDetailMsg());
}
if(file1)
@@ -493,7 +493,7 @@ test_reference_group(void)
catch (Exception& E)
{
issue_fail_msg("test_reference_group()",__LINE__,__FILE__,
- E.getCFuncName(), E.getCDetailMsg());
+ E.getCFuncName(), E.getCDetailMsg());
}
if(file1)
@@ -523,10 +523,10 @@ test_reference_region_1D(void)
SUBTEST("1-D Dataset Region Reference Functions");
try {
- hdset_reg_ref_t *wbuf, // buffer to write to disk
+ hdset_reg_ref_t *wbuf, // buffer to write to disk
*rbuf; // buffer read from disk
- uint8_t *dwbuf, // Buffer for writing numeric data to disk
- *drbuf; // Buffer for reading numeric data from disk
+ uint8_t *dwbuf, // Buffer for writing numeric data to disk
+ *drbuf; // Buffer for reading numeric data from disk
// Allocate write & read buffers
wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
@@ -538,7 +538,7 @@ test_reference_region_1D(void)
H5File file1(FILE2, H5F_ACC_TRUNC);
// Create dataspace for datasets
- hsize_t dims3[] = {SPACE3_DIM1};
+ hsize_t dims3[] = {SPACE3_DIM1};
DataSpace sid3(SPACE3_RANK, dims3);
// Create dataset access property list
@@ -558,7 +558,7 @@ test_reference_region_1D(void)
dset3.close();
// Create dataspace for datasets
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
DataSpace sid1(SPACE1_RANK, dims1);
// Create a dataset
@@ -785,7 +785,7 @@ test_reference_region_1D(void)
catch (Exception& E)
{
issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__,
- E.getCFuncName(), E.getCDetailMsg());
+ E.getCFuncName(), E.getCDetailMsg());
}
} /* test_reference_region_1D() */
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index 22db539..fee4115 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -272,9 +272,8 @@ static void test_query()
tcpl.close();
tid2.close();
- // Open the datatypes for query
+ // Open the datatypes for query. Testing both ways
- // Deprecated functions
tid1 = file.openCompType(CompT_NAME);
tid1.close();
tid2 = file.openEnumType(EnumT_NAME);
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 5dee1a2..859867b 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -57,7 +57,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info)
{
void *ret_value=NULL; // Pointer to return
size_t *mem_used=(size_t *)info; // Get the pointer to the memory used
- size_t extra; // Extra space needed
+ size_t extra; // Extra space needed
/*
* This weird contortion is required on the DEC Alpha to keep the
@@ -91,7 +91,7 @@ static void test_vlstr_free_custom(void *_mem, void *info)
{
unsigned char *mem;
size_t *mem_used=(size_t *)info; // Get the pointer to the memory used
- size_t extra; // Extra space needed
+ size_t extra; // Extra space needed
/*
* This weird contortion is required on the DEC Alpha to keep the
@@ -257,7 +257,7 @@ static void test_vlstring_array_dataset()
for (ii = 0; ii < SPACE1_DIM1; ii++)
{
if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0)
- TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]);
+ TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]);
HDfree(string_ds_check[ii]);
}
@@ -351,23 +351,26 @@ static void test_vlstrings_special()
hsize_t ii; // counting variable
for (ii=0; ii<SPACE1_DIM1; ii++)
if(rdata[ii]!=NULL)
- TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
+ TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Write dataset to disk, then read it back.
dataset.write(wdata, vlst);
dataset.read(rdata, vlst);
// Compare data read in.
- for (ii = 0; ii < SPACE1_DIM1; ii++) {
+ for (ii = 0; ii < SPACE1_DIM1; ii++)
+ {
size_t wlen = HDstrlen(wdata[ii]);
size_t rlen = HDstrlen(rdata[ii]);
- if(wlen != rlen) {
- TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen);
- continue;
+ if(wlen != rlen)
+ {
+ TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen);
+ continue;
} // end if
- if(HDstrcmp(wdata[ii],rdata[ii]) != 0) {
- TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]);
- continue;
+ if(HDstrcmp(wdata[ii],rdata[ii]) != 0)
+ {
+ TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]);
+ continue;
} // end if
} // end for
@@ -384,7 +387,7 @@ static void test_vlstrings_special()
// Create the property list and set the fill value for the second
// dataset.
DSetCreatPropList dcpl;
- char *fill = NULL; // Fill value
+ char *fill = NULL; // Fill value
dcpl.setFillValue(vlst, &fill);
dataset = file1.createDataSet("Dataset4", vlst, sid1, dcpl);
@@ -566,12 +569,12 @@ static void test_compact_vlstring()
hsize_t i;
for (i=0; i<SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i])!=strlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
- continue;
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ continue;
} // end if
if (HDstrcmp(wdata[i],rdata[i]) != 0) {
- TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
- continue;
+ TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
+ continue;
} // end if
} // end for
@@ -800,7 +803,7 @@ static void test_vlstring_array_attribute()
for (ii = 0; ii < SPACE1_DIM1; ii++)
{
if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0)
- TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]);
+ TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]);
HDfree(string_att_check[ii]); // note: no need for std::string test
}
@@ -821,7 +824,7 @@ static void test_vlstring_array_attribute()
/* Helper routine for test_vl_rewrite() */
static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space,
- char *name, char *data)
+ char *name, char *data)
{
DataSet dset;
try {
@@ -839,7 +842,7 @@ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space,
/* Helper routine for test_vl_rewrite() */
static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space,
- char *name, char *data)
+ char *name, char *data)
{
char *data_read;
DataSet dset;