Skip to content

Commit

Permalink
#5444: Add another unit test covering patches facing both directions …
Browse files Browse the repository at this point in the history
…in orthoview
  • Loading branch information
codereader committed Dec 25, 2020
1 parent 5ee8379 commit 0e25f16
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/Selection.cpp
Expand Up @@ -162,6 +162,15 @@ void performBrushSelectionTest(const std::string& materialName)
performSelectionTest(brush);
}

void performPatchSelectionTest(const std::string& materialName)
{
auto worldspawn = GlobalMapModule().findOrInsertWorldspawn();
auto patch = algorithm::findFirstPatchWithMaterial(worldspawn, materialName);
EXPECT_TRUE(patch);

performSelectionTest(patch);
}

TEST_F(SelectionTest, BrushesFacingTowardsXYAreSelectable)
{
loadMap("selection_test.map");
Expand All @@ -177,4 +186,18 @@ TEST_F(SelectionTest, BrushesFacingAwayFromXYAreSelectable)
performBrushSelectionTest("textures/numbers/2");
}

TEST_F(SelectionTest, PatchesFacingTowardsXYAreSelectable)
{
loadMap("selection_test.map");

performPatchSelectionTest("textures/numbers/1");
}

TEST_F(SelectionTest, PatchesFacingAwayFromXYAreSelectable)
{
loadMap("selection_test.map");

performPatchSelectionTest("textures/numbers/2");
}

}

0 comments on commit 0e25f16

Please sign in to comment.