Skip to content

Commit

Permalink
Enshrine observable, but quirky behaviour. (#855)
Browse files Browse the repository at this point in the history
This isn't desired behaviour. However, it's non-obvious and users might
rely on it. Hence, it's being tested.
  • Loading branch information
1uc authored Nov 21, 2023
1 parent 08bea33 commit 32aa01d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/tests_high_five_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2508,6 +2508,23 @@ TEST_CASE("HighFivePropertyObjects") {
CHECK(plist_g2.isValid());
}

TEST_CASE("HighFivePropertyObjectsQuirks") {
auto pl1 = LinkCreateProps::Default();
auto pl2 = pl1;
// As usual shallow copying semantics apply:
CHECK(pl1.getId() == pl2.getId());

// Then one adds something and the link is broken:
pl2.add(CreateIntermediateGroup(true));
CHECK(pl1.getId() == H5P_DEFAULT);

// but once it's not a "special" value, regular shallow copy semantic
// return:
auto pl3 = pl2;
pl3.add(CreateIntermediateGroup(false));
CHECK(pl3.getId() == pl2.getId());
}

TEST_CASE("HighFiveLinkCreationOrderProperty") {
{ // For file
const std::string file_name("h5_keep_creation_order_file.h5");
Expand Down

0 comments on commit 32aa01d

Please sign in to comment.