diff options
| author | 2018-07-18 21:07:11 -0400 | |
|---|---|---|
| committer | 2018-07-18 18:07:11 -0700 | |
| commit | 29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef (patch) | |
| tree | 3202e2ce55ab6387a4ca366a509eccdd963434c3 /src/tests | |
| parent | Merge pull request #683 from DarkLordZach/touch (diff) | |
| download | yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.gz yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.tar.xz yuzu-29aff8d5ab46c8d0199aa4bfa7eeff5d4fa2d7ef.zip | |
Virtual Filesystem 2: Electric Boogaloo (#676)
* Virtual Filesystem
* Fix delete bug and documentate
* Review fixes + other stuff
* Fix puyo regression
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/tests/core/file_sys/path_parser.cpp | 38 |
2 files changed, 0 insertions, 39 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 12f1b93e0..6a0a62ecc 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt | |||
| @@ -3,7 +3,6 @@ add_executable(tests | |||
| 3 | core/arm/arm_test_common.cpp | 3 | core/arm/arm_test_common.cpp |
| 4 | core/arm/arm_test_common.h | 4 | core/arm/arm_test_common.h |
| 5 | core/core_timing.cpp | 5 | core/core_timing.cpp |
| 6 | core/file_sys/path_parser.cpp | ||
| 7 | core/memory/memory.cpp | 6 | core/memory/memory.cpp |
| 8 | glad.cpp | 7 | glad.cpp |
| 9 | tests.cpp | 8 | tests.cpp |
diff --git a/src/tests/core/file_sys/path_parser.cpp b/src/tests/core/file_sys/path_parser.cpp deleted file mode 100644 index 2b543e438..000000000 --- a/src/tests/core/file_sys/path_parser.cpp +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <catch.hpp> | ||
| 6 | #include "common/file_util.h" | ||
| 7 | #include "core/file_sys/path_parser.h" | ||
| 8 | |||
| 9 | namespace FileSys { | ||
| 10 | |||
| 11 | TEST_CASE("PathParser", "[core][file_sys]") { | ||
| 12 | REQUIRE(!PathParser(Path(std::vector<u8>{})).IsValid()); | ||
| 13 | REQUIRE(!PathParser(Path("a")).IsValid()); | ||
| 14 | REQUIRE(!PathParser(Path("/|")).IsValid()); | ||
| 15 | REQUIRE(PathParser(Path("/a")).IsValid()); | ||
| 16 | REQUIRE(!PathParser(Path("/a/b/../../c/../../d")).IsValid()); | ||
| 17 | REQUIRE(PathParser(Path("/a/b/../c/../../d")).IsValid()); | ||
| 18 | REQUIRE(PathParser(Path("/")).IsRootDirectory()); | ||
| 19 | REQUIRE(!PathParser(Path("/a")).IsRootDirectory()); | ||
| 20 | REQUIRE(PathParser(Path("/a/..")).IsRootDirectory()); | ||
| 21 | } | ||
| 22 | |||
| 23 | TEST_CASE("PathParser - Host file system", "[core][file_sys]") { | ||
| 24 | std::string test_dir = "./test"; | ||
| 25 | FileUtil::CreateDir(test_dir); | ||
| 26 | FileUtil::CreateDir(test_dir + "/z"); | ||
| 27 | FileUtil::CreateEmptyFile(test_dir + "/a"); | ||
| 28 | |||
| 29 | REQUIRE(PathParser(Path("/a")).GetHostStatus(test_dir) == PathParser::FileFound); | ||
| 30 | REQUIRE(PathParser(Path("/b")).GetHostStatus(test_dir) == PathParser::NotFound); | ||
| 31 | REQUIRE(PathParser(Path("/z")).GetHostStatus(test_dir) == PathParser::DirectoryFound); | ||
| 32 | REQUIRE(PathParser(Path("/a/c")).GetHostStatus(test_dir) == PathParser::FileInPath); | ||
| 33 | REQUIRE(PathParser(Path("/b/c")).GetHostStatus(test_dir) == PathParser::PathNotFound); | ||
| 34 | |||
| 35 | FileUtil::DeleteDirRecursively(test_dir); | ||
| 36 | } | ||
| 37 | |||
| 38 | } // namespace FileSys | ||