From 278eb36d44c6796a6b6cd3f23ffbec7dcefb5a26 Mon Sep 17 00:00:00 2001 From: Arek G Date: Fri, 28 Nov 2025 12:09:23 +0000 Subject: [PATCH] test: Mock filesystem in ults 10/n Related-To: NEO-15069 Signed-off-by: Arek G --- .../unit_tests/sources/debugger/test_module_with_debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp index f9f23fa11d..72acf23824 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp @@ -351,7 +351,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinDebugDataWhenInitializingMo } HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenDumpElfFlagAndZebinWhenInitializingModuleThenDebugElfIsDumpedToFile) { - USE_REAL_FILE_SYSTEM(); + FORBID_REAL_FILE_SYSTEM_CALLS(); DebugManagerStateRestore stateRestore; debugManager.flags.DebuggerLogBitmask.set(NEO::DebugVariables::DEBUGGER_LOG_BITMASK::DUMP_ELF); @@ -393,6 +393,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenDumpElfFlagAndZebinWhenInitializ std::string fileName = "dumped_debug_module.elf"; EXPECT_FALSE(virtualFileExists(fileName)); + VariableBackup mockFopenToNullAsNotNeededHere{&NEO::IoFunctions::fopenPtr, [](const char *filename, const char *mode) -> FILE * { return nullptr; }}; EXPECT_EQ(moduleMock->initialize(&moduleDesc, neoDevice), ZE_RESULT_SUCCESS); EXPECT_TRUE(virtualFileExists(fileName)); removeVirtualFile(fileName.c_str());