summaryrefslogtreecommitdiffstats
path: root/c++/test/tlinks.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-14 03:53:43 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-14 03:53:43 (GMT)
commita48c9c4024e7ede0021e1a9d8c1d4c197333e0d0 (patch)
tree4f69e727c624eafc5c1a812e24cc27b71175d69f /c++/test/tlinks.cpp
parent56e5b4ed05fb3bad51c226ec5b567871a45e0bce (diff)
downloadhdf5-a48c9c4024e7ede0021e1a9d8c1d4c197333e0d0.zip
hdf5-a48c9c4024e7ede0021e1a9d8c1d4c197333e0d0.tar.gz
hdf5-a48c9c4024e7ede0021e1a9d8c1d4c197333e0d0.tar.bz2
Purpose: Add new C++ wrappers
Description: Added wrappers for H5Iis_valid, H5Ps/get_nlinks, H5Tget_create_plist, H5Oopen, H5Oclose and H5Pset_virtual // Checks if the given ID is valid. static bool isValid(hid_t an_id); // Sets the number of soft or user-defined links that can be // traversed before a failure occurs. void setNumLinks(size_t nlinks) const; // Gets the number of soft or user-defined link traversals allowed size_t getNumLinks() const; // Returns a copy of the creation property list of a datatype. PropList getCreatePlist() const; // Opens an object within a group or a file, i.e., root group. hid_t getObjId(const char* name,...); hid_t getObjId(const H5std_string& name,...); // Closes an object opened by getObjId(). void closeObjId(hid_t obj_id) const; // Maps elements of a virtual dataset to elements of the source dataset. void setVirtual(const DataSpace& vspace, const char *src_fname,...); void setVirtual(const DataSpace& vspace, const H5std_string src_fname,...); Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/test/tlinks.cpp')
-rw-r--r--c++/test/tlinks.cpp54
1 files changed, 50 insertions, 4 deletions
diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp
index c217718..0bf6ebf 100644
--- a/c++/test/tlinks.cpp
+++ b/c++/test/tlinks.cpp
@@ -142,11 +142,8 @@ const char *FILENAME[] = {
#define H5L_DIM2 100
/* Creation order macros */
-#define CORDER_GROUP_NAME "corder_group"
#define CORDER_SOFT_GROUP_NAME "corder_soft_group"
#define CORDER_NLINKS 18
-#define CORDER_ITER_STOP 3
-#define CORDER_EST_ENTRY_LEN 9
/* Timestamp macros */
#define TIMESTAMP_GROUP_1 "timestamp1"
@@ -341,7 +338,7 @@ static const char *FILENAME[] = {
static void test_basic_links(hid_t fapl_id, hbool_t new_format)
{
hsize_t size[1] = {1};
- char filename[NAME_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
// Use the file access template id to create a file access prop. list.
FileAccPropList fapl(fapl_id);
@@ -441,6 +438,55 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format)
/*-------------------------------------------------------------------------
+ * Function: test_num_links
+ *
+ * Purpose Test setting and getting limit of number of links
+ *
+ * Return Success: 0
+ *
+ * Failure: -1
+ *
+ * Programmer Binh-Minh Ribler
+ * October 16, 2009
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void test_num_links(hid_t fapl_id, hbool_t new_format)
+{
+ char filename[NAME_BUF_SIZE];
+
+ if(new_format)
+ SUBTEST("Setting number of links (w/new group format)")
+ else
+ SUBTEST("Setting number of links")
+
+ try
+ {
+ // Use the file access template id to create a file access prop. list.
+ FileAccPropList fapl(fapl_id);
+
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+ H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl);
+
+ LinkAccPropList lapl;
+ size_t nlinks = 5;
+ lapl.setNumLinks(nlinks);
+
+ // Read it back and verify
+ size_t read_nlinks = lapl.getNumLinks();
+ verify_val(read_nlinks, nlinks, "LinkAccPropList::setNumLinks", __LINE__, __FILE__);
+
+ PASSED();
+ } // end of try block
+ catch (Exception& E)
+ {
+ issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+} // test_num_links
+
+/*-------------------------------------------------------------------------
* Function: test_links
*
* Purpose Test links