From 7df01a8695e46e7e8cce603782f0e16caf54169b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Mar 2017 04:50:26 +0300 Subject: Fix tests running without physfs. --- src/integrity_unittest.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/integrity_unittest.cc') diff --git a/src/integrity_unittest.cc b/src/integrity_unittest.cc index 58e22772a..73ee5cee3 100644 --- a/src/integrity_unittest.cc +++ b/src/integrity_unittest.cc @@ -221,7 +221,7 @@ TEST_CASE("integrity tests", "integrity") VirtFs::addZipToSearchPath("data/test/test.zip", Append_false); VirtFs::addZipToSearchPath("../data/test/test.zip", Append_false); Image *const image = Loader::getImage( - "hide.png"); + "dir/hide.png"); VirtFs::removeZipFromSearchPath("data/test/test.zip"); VirtFs::removeZipFromSearchPath("../data/test/test.zip"); REQUIRE(image != nullptr); @@ -259,7 +259,11 @@ TEST_CASE("integrity tests", "integrity") SDL_RWclose(rw); VirtFs::removeZipFromSearchPath("data/test/test.zip"); VirtFs::removeZipFromSearchPath("../data/test/test.zip"); + VirtFs::addDirToSearchPath("data/test", Append_true); + VirtFs::addDirToSearchPath("../data/test", Append_true); REQUIRE(compareBuffers(buf) == true); + VirtFs::removeDirFromSearchPath("data/test"); + VirtFs::removeDirFromSearchPath("../data/test"); } #ifdef USE_PHYSFS @@ -403,7 +407,11 @@ TEST_CASE("integrity tests", "integrity") VirtFs::removeZipFromSearchPath("data/test/test.zip"); VirtFs::removeZipFromSearchPath("../data/test/test.zip"); + VirtFs::addDirToSearchPath("data/test", Append_true); + VirtFs::addDirToSearchPath("../data/test", Append_true); REQUIRE(compareBuffers(buf) == true); + VirtFs::removeDirFromSearchPath("data/test"); + VirtFs::removeDirFromSearchPath("../data/test"); } #endif // USE_PHYSFS @@ -439,7 +447,11 @@ TEST_CASE("integrity tests", "integrity") SDL_RWclose(rw); VirtFs::removeZipFromSearchPath("data/test/test.zip"); VirtFs::removeZipFromSearchPath("../data/test/test.zip"); + VirtFs::addDirToSearchPath("data/test", Append_true); + VirtFs::addDirToSearchPath("../data/test", Append_true); REQUIRE(compareBuffers(buf) == true); + VirtFs::removeDirFromSearchPath("data/test"); + VirtFs::removeDirFromSearchPath("../data/test"); } SECTION("integrity Loader::getImage test 8") @@ -498,6 +510,8 @@ TEST_CASE("integrity tests", "integrity") delete client; client = nullptr; + VirtFs::removeDirFromSearchPath("data"); + VirtFs::removeDirFromSearchPath("../data"); delete2(logger); // VirtFs::deinit(); } -- cgit v1.2.3-70-g09d2