summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-19 04:40:37 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-19 04:40:37 (GMT)
commit34731511da3f3064b0f6e6681516be7b34d0bfbf (patch)
treea2103d5311bb7c51e520916523900f7f00abd4cb /c++/test
parentc89e53431bff1fd584aabbe6d326df7d69361219 (diff)
downloadhdf5-34731511da3f3064b0f6e6681516be7b34d0bfbf.zip
hdf5-34731511da3f3064b0f6e6681516be7b34d0bfbf.tar.gz
hdf5-34731511da3f3064b0f6e6681516be7b34d0bfbf.tar.bz2
Purpose: Add new C++ wrappers
Description: Because H5Pset_file_space and H5Pget_file_space are deprecated, changed to make wrappers for the new functions instead: H5Ps/get_file_space_strategy H5Ps/get_file_space_page_size New wrappers in FileCreatPropList: // Sets the strategy and the threshold value that the library will // will employ in managing file space. void setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const; // Returns the strategy that the library uses in managing file space. void getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hbool_t& persist, hsize_t& threshold) const; // Sets the file space page size for paged aggregation. void setFileSpacePagesize(hsize_t fsp_psize) const; // Returns the threshold value that the library uses in tracking free // space sections. hsize_t getFileSpacePagesize() const; Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/tfile.cpp46
1 files changed, 30 insertions, 16 deletions
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index eb07657..78fab09 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 */
- // File space handling strategy
- H5F_file_space_type_t in_strategy = H5F_FILE_SPACE_ALL;
+ 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 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
@@ -912,14 +926,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