Skip to content

Commit

Permalink
#5108: Add unit test checking whether opening a file from a mod PK4 i…
Browse files Browse the repository at this point in the history
…s working
  • Loading branch information
codereader committed Nov 21, 2020
1 parent b51b6b7 commit 8fd53aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/MapSavingLoading.cpp
Expand Up @@ -157,6 +157,21 @@ TEST_F(MapLoadingTest, openMapFromMapsFolder)
checkAltarScene();
}

TEST_F(MapLoadingTest, openMapFromModPak)
{
std::string modRelativePath = "maps/altar_in_pk4.map";

// The map is located in maps/ folder within the altar.pk4, check that it doesn't physically exist
fs::path mapPath = _context.getTestResourcePath();
mapPath /= modRelativePath;
EXPECT_FALSE(os::fileOrDirExists(mapPath));

GlobalCommandSystem().executeCommand("OpenMap", modRelativePath);

// Check if the scene contains what we expect
checkAltarScene();
}

TEST_F(MapLoadingTest, openNonExistentMap)
{
std::string mapName = "idontexist.map";
Expand Down
Binary file modified test/resources/tdm/altar.pk4
Binary file not shown.

0 comments on commit 8fd53aa

Please sign in to comment.