diff options
| author | Dentomologist <dentomologist@gmail.com> | 2021-01-22 11:34:45 -0800 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2021-01-22 11:49:59 -0800 |
| commit | 83f912b58af2d39265184aa5ca4c30050757fe9e (patch) | |
| tree | 530e76ec7873ea14e9ec55b8b53c14989d13184b /Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp | |
| parent | caff472dbf27fbcc5b3d28cbf5b1789592a9f857 (diff) | |
UnitTests: Add setup error checking
Check return value of calls to File::CreateTempDir() from CoreTiming,
FileSystem, and MMIO test classes to verify the test user directory
exists, and fail the tests otherwise.
Diffstat (limited to 'Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp')
| -rw-r--r-- | Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp b/Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp index b8b2b101e7..bacfc69658 100644 --- a/Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp +++ b/Source/UnitTests/Core/IOS/FS/FileSystemTest.cpp @@ -25,15 +25,31 @@ class FileSystemTest : public testing::Test protected: FileSystemTest() : m_profile_path{File::CreateTempDir()} { + if (UserDirectoryCreationFailed()) + { + return; + } UICommon::SetUserDirectory(m_profile_path); m_fs = IOS::HLE::Kernel{}.GetFS(); } virtual ~FileSystemTest() { + if (UserDirectoryCreationFailed()) + { + return; + } m_fs.reset(); File::DeleteDirRecursively(m_profile_path); } + void SetUp() + { + if (UserDirectoryCreationFailed()) + { + FAIL(); + } + } + bool UserDirectoryCreationFailed() const { return m_profile_path.empty(); } std::shared_ptr<FileSystem> m_fs; |
