| 8 | { |
| 9 | |
| 10 | TEST_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 | } |
nothing calls this directly
no test coverage detected