MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / TEST_F

Function TEST_F

test/SelectionAlgorithm.cpp:10–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8{
9
10TEST_F(RadiantTest, SelectItemsByModel)
11{
12 loadMap("select_items_by_model.map");
13
14 auto staticMeshPath = "models/just_a_static_mesh.ase";
15 auto md5MeshPath = "just_an_md5.md5mesh";
16
17 GlobalSelectionSystem().setSelectedAll(false);
18 ASSERT_TRUE(GlobalSelectionSystem().getSelectionInfo().totalCount == 0);
19
20 // Select the two entities with the regular "model" "" spawnarg
21 GlobalCommandSystem().executeCommand("SelectItemsByModel", { staticMeshPath });
22 ASSERT_TRUE(GlobalSelectionSystem().getSelectionInfo().entityCount == 2);
23
24 // Deselect the two entities with the regular "model" "" spawnarg
25 GlobalCommandSystem().executeCommand("DeselectItemsByModel", { staticMeshPath });
26 ASSERT_TRUE(GlobalSelectionSystem().getSelectionInfo().totalCount == 0);
27
28 // Select the three entities that reference the md5 mesh through a model def
29 GlobalCommandSystem().executeCommand("SelectItemsByModel", { md5MeshPath });
30 ASSERT_TRUE(GlobalSelectionSystem().getSelectionInfo().entityCount == 3);
31
32 GlobalCommandSystem().executeCommand("DeselectItemsByModel", { md5MeshPath });
33 ASSERT_TRUE(GlobalSelectionSystem().getSelectionInfo().totalCount == 0);
34}
35
36}

Callers

nothing calls this directly

Calls 2

setSelectedAllMethod · 0.45
executeCommandMethod · 0.45

Tested by

no test coverage detected