Skip to content

Commit

Permalink
#5643: Change unit test assertion now that redundant selection groups…
Browse files Browse the repository at this point in the history
… are purged during processing
  • Loading branch information
codereader committed Jun 22, 2021
1 parent 6d18eb9 commit f33fefa
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions test/MapMerging.cpp
Expand Up @@ -1374,8 +1374,8 @@ TEST_F(SelectionGroupMergeTest, BrushesKeptDuringMerge)
EXPECT_EQ(funcStatic7Groups.size(), 2); // has been grouped with func_static_8 (had one group before)
EXPECT_EQ(funcStatic8Groups.size(), 1); // has been grouped with func_static_7
EXPECT_EQ(brush7Groups.size(), 3); // one additional group with func_static_8
// The group of brush8 with func_static_8 should've been trimmed down but it's still there, so the count is 2
EXPECT_EQ(brush8Groups.size(), 2); // two groups remaining, with the second brush8.
// The 2 groups brush8 was a member of has been been merged down to 1, so the count is 1
EXPECT_EQ(brush8Groups.size(), 1); // one group remaining, with the second brush8.

auto& baseManager = merger->getBaseRoot()->getSelectionGroupManager();

Expand Down Expand Up @@ -1406,26 +1406,6 @@ TEST_F(SelectionGroupMergeTest, BrushesKeptDuringMerge)
EXPECT_FALSE(groupContains(firstGroup, func_static_7));
EXPECT_FALSE(groupContains(firstGroup, func_static_8));

secondGroup = baseManager.getSelectionGroup(brush8Groups[1]);
EXPECT_TRUE(groupContains(firstGroup, brush8));
EXPECT_FALSE(groupContains(firstGroup, brush7));
EXPECT_FALSE(groupContains(firstGroup, func_static_7));
EXPECT_FALSE(groupContains(firstGroup, func_static_8));

std::set<std::string> firstGroupNodes;
std::set<std::string> secondGroupNodes;
firstGroup->foreachNode([&](const scene::INodePtr& node)
{
firstGroupNodes.emplace(NodeUtils::GetGroupMemberFingerprint(node));
});
secondGroup->foreachNode([&](const scene::INodePtr& node)
{
secondGroupNodes.emplace(NodeUtils::GetGroupMemberFingerprint(node));
});

// These two groups are redundant after func_static_8 has dropped out
EXPECT_EQ(firstGroupNodes, secondGroupNodes);

// Run another merger, it shouldn't find any actions to take
merger = std::make_unique<SelectionGroupMerger>(merger->getSourceRoot(), merger->getBaseRoot());
merger->adjustBaseGroups();
Expand Down

0 comments on commit f33fefa

Please sign in to comment.