diff options
Diffstat (limited to 'c++/test/tattr.cpp')
-rw-r--r-- | c++/test/tattr.cpp | 11 |
1 files changed, 10 insertions, 1 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 |