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

Function checkBehaviourWithoutUnsavedChanges

test/MapSavingLoading.cpp:1313–1328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1311{
1312
1313void 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
1330void checkBehaviourDiscardingUnsavedChanges(const std::string& testProjectPath, std::function<void()> action, bool expectUnmodifiedMapAfterAction = true)
1331{

Callers 1

TEST_FFunction · 0.85

Calls 3

executeCommandMethod · 0.45
isModifiedMethod · 0.45
messageReceivedMethod · 0.45

Tested by

no test coverage detected