| 1311 | { |
| 1312 | |
| 1313 | void checkBehaviourWithoutUnsavedChanges(std::function<void()> action) |
| 1314 | { |
| 1315 | std::string modRelativePath = "maps/altar.map"; |
| 1316 | GlobalCommandSystem().executeCommand("OpenMap", modRelativePath); |
| 1317 | |
| 1318 | FileSaveConfirmationHelper helper(radiant::FileSaveConfirmation::Action::SaveChanges); |
| 1319 | |
| 1320 | // The map has not been changed |
| 1321 | EXPECT_FALSE(GlobalMapModule().isModified()) << "Map was marked as modified after loading"; |
| 1322 | |
| 1323 | // Performing the action will not ask for save, since it hasn't been changed |
| 1324 | action(); |
| 1325 | |
| 1326 | EXPECT_FALSE(helper.messageReceived()) << "Map shouldn't have asked for save"; |
| 1327 | EXPECT_FALSE(GlobalMapModule().isModified()) << "New Map should be unmodified"; |
| 1328 | } |
| 1329 | |
| 1330 | void checkBehaviourDiscardingUnsavedChanges(const std::string& testProjectPath, std::function<void()> action, bool expectUnmodifiedMapAfterAction = true) |
| 1331 | { |
no test coverage detected