Integrating latest 47acbe8
This commit is contained in:
@@ -25,8 +25,8 @@ UnitTest::ScopedTemporaryDirectory::ScopedTemporaryDirectory()
|
||||
|
||||
for (int i = 0; i < MaxAttempts; ++i)
|
||||
{
|
||||
auto randomFolder = AZ::Uuid::CreateRandom().ToString<AZStd::string>(false, false);
|
||||
AZStd::string testPath;
|
||||
auto randomFolder = AZ::Uuid::CreateRandom().ToString<AZStd::fixed_string<512>>(false, false);
|
||||
AZ::IO::FixedMaxPath testPath;
|
||||
#if !AZ_TRAIT_USE_POSIX_TEMP_FOLDER
|
||||
auto path = userTempFolder / ("UnitTest-" + randomFolder).c_str();
|
||||
testPath = path.string().c_str();
|
||||
@@ -42,7 +42,7 @@ UnitTest::ScopedTemporaryDirectory::ScopedTemporaryDirectory()
|
||||
#else
|
||||
m_tempDirectory = testPath;
|
||||
#endif
|
||||
m_directoryExists = AZ::IO::LocalFileIO::GetInstance()->CreatePath(m_tempDirectory.c_str());
|
||||
m_directoryExists = AZ::IO::SystemFile::CreateDir(m_tempDirectory.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ UnitTest::ScopedTemporaryDirectory::~ScopedTemporaryDirectory()
|
||||
{
|
||||
if (m_directoryExists)
|
||||
{
|
||||
AZ::IO::LocalFileIO::GetInstance()->DestroyPath(m_tempDirectory.c_str());
|
||||
AZ::IO::SystemFile::DeleteDir(m_tempDirectory.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzFramework/IO/LocalFileIO.h>
|
||||
#if !AZ_TRAIT_USE_POSIX_TEMP_FOLDER
|
||||
#include <filesystem>
|
||||
@@ -40,7 +40,7 @@ namespace UnitTest
|
||||
|
||||
private:
|
||||
bool m_directoryExists{ false };
|
||||
AZStd::string m_tempDirectory;
|
||||
AZ::IO::FixedMaxPath m_tempDirectory;
|
||||
#if !AZ_TRAIT_USE_POSIX_TEMP_FOLDER
|
||||
std::filesystem::path m_path;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user