diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-05-13 11:00:33 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-05-13 11:00:33 (GMT) |
commit | 8b1a53896565cafca3795d139a37148f89bf928d (patch) | |
tree | c4df84bc37434a0d4df14e73d65723c77e32d7ed /c++/test | |
parent | 77eb59b4343c9c9d6786cf620ea4d9c498af279f (diff) | |
download | hdf5-8b1a53896565cafca3795d139a37148f89bf928d.zip hdf5-8b1a53896565cafca3795d139a37148f89bf928d.tar.gz hdf5-8b1a53896565cafca3795d139a37148f89bf928d.tar.bz2 |
Add H5Lexists wrappers
Description:
Added wrappers H5Location::exists() for H5Lexists.
Added new class LinkAccPropList to be used by H5Location::exists()
Rearranged source files in Makefile.am
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/tattr.cpp | 11 | ||||
-rw-r--r-- | c++/test/tlinks.cpp | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index bb33b2b..70c4003 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1561,11 +1561,20 @@ static void test_attr_exists() // Open a group. Group group = fid1.openGroup(GROUP1_NAME); - // Check for existence of attribute + // Check for existence of attribute, Group::attrExists attr_exists = group.attrExists(ATTR2_NAME); if (attr_exists == false) throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + // Open attribute + Attribute attr = group.openAttribute(ATTR2_NAME); + + // Test the existence of a name using attribute as location, + // Attribute::nameExists + bool name_exists = attr.nameExists(GROUP1_NAME); + if (name_exists == false) + throw InvalidActionException("Attribute::nameExists", "group GROUP1_NAME should exist but does not"); + PASSED(); } // end try block diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index bb1ea17..0786bb5 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -422,10 +422,10 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); // Verify link existence - if(H5Lexists(file.getId(), "dset1", H5P_DEFAULT) != TRUE) - throw InvalidActionException("H5Lexists", "dset1 doesn't exist"); - if(H5Lexists(file.getId(), "grp1/soft", H5P_DEFAULT) != TRUE) - throw InvalidActionException("H5Lexists", "grp1/soft doesn't exist"); + if(file.nameExists("dset1", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "dset1 doesn't exist"); + if(file.nameExists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "grp1/soft doesn't exist"); // Verify link values H5std_string softlink_val = file.getLinkval("grp1/soft"); |