refactor: use virtualFileSystem in ULTs

reducing the number of tests that have interactions with filesystem.
writeDataToFile() saves filename and content in std::map.
fileExistsHasSize() checks if file was previously written to virtualFileSystem
loadDataFromVirtualFile() fetches data from std::map based on filename

Related-To: NEO-7006
Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
This commit is contained in:
Marcel Skierkowski
2024-12-12 15:55:13 +00:00
committed by Compute-Runtime-Automation
parent 9f23867d30
commit e27a6dc280
18 changed files with 160 additions and 107 deletions

View File

@@ -25,7 +25,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
FullyEnabledFileLogger fileLogger(testFile, flags);
// Log file not created
bool logFileCreated = fileExists(fileLogger.getLogFileName());
bool logFileCreated = virtualFileExists(fileLogger.getLogFileName());
EXPECT_FALSE(logFileCreated);
auto executionEnvironment = std::unique_ptr<ExecutionEnvironment>(MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u));
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
@@ -82,7 +82,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIs
FullyEnabledFileLogger fileLogger(testFile, flags);
// Log file not created
bool logFileCreated = fileExists(fileLogger.getLogFileName());
bool logFileCreated = virtualFileExists(fileLogger.getLogFileName());
EXPECT_FALSE(logFileCreated);
auto executionEnvironment = std::unique_ptr<ExecutionEnvironment>(MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), 0u));