From cf4619843db8ae27828fd2bdf31b1ef8be5757e0 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 24 Jan 2024 12:26:29 +0000 Subject: [PATCH] test: correct size for allocating fread buffer Signed-off-by: Mateusz Jablonski --- .../unit_test/os_interface/linux/drm_with_prelim_tests.cpp | 4 ++-- .../os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp index eff778cf8e..139998563d 100644 --- a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp @@ -135,7 +135,7 @@ TEST(IoctlHelperPrelimTest, whenVmUnbindIsCalledThenProperValueIsReturnedBasedOn TEST_F(IoctlHelperPrelimFixture, givenPrelimEnableEuDebugThenReturnCorrectValue) { VariableBackup mockFreadReturnBackup(&IoFunctions::mockFreadReturn, 1); - std::unique_ptr buffer = std::make_unique(IoFunctions::mockFwriteReturn); + std::unique_ptr buffer = std::make_unique(IoFunctions::mockFreadReturn); VariableBackup mockFreadBufferBackup(&IoFunctions::mockFreadBuffer, buffer.get()); buffer[0] = '1'; @@ -146,7 +146,7 @@ TEST_F(IoctlHelperPrelimFixture, givenPrelimEnableEuDebugThenReturnCorrectValue) TEST_F(IoctlHelperPrelimFixture, givenPrelimEnableEuDebugWithInvalidPathThenReturnDefaultValue) { VariableBackup mockFreadReturnBackup(&IoFunctions::mockFreadReturn, 1); - std::unique_ptr buffer = std::make_unique(IoFunctions::mockFwriteReturn); + std::unique_ptr buffer = std::make_unique(IoFunctions::mockFreadReturn); VariableBackup mockFreadBufferBackup(&IoFunctions::mockFreadBuffer, buffer.get()); buffer[0] = '1'; diff --git a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp index 53936c0029..1584ee1ace 100644 --- a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp @@ -242,7 +242,7 @@ TEST(IoctlHelperXeTest, GivenXeDriverThenDebugAttachReturnsTrue) { TEST(IoctlHelperXeTest, givenXeEnableEuDebugThenReturnCorrectValue) { VariableBackup mockFreadReturnBackup(&IoFunctions::mockFreadReturn, 1); - std::unique_ptr buffer = std::make_unique(IoFunctions::mockFwriteReturn); + std::unique_ptr buffer = std::make_unique(IoFunctions::mockFreadReturn); VariableBackup mockFreadBufferBackup(&IoFunctions::mockFreadBuffer, buffer.get()); auto executionEnvironment = std::make_unique(); @@ -260,7 +260,7 @@ TEST(IoctlHelperXeTest, givenXeEnableEuDebugThenReturnCorrectValue) { TEST(IoctlHelperXeTest, givenXeEnableEuDebugWithInvalidPathThenReturnCorrectValue) { VariableBackup mockFreadReturnBackup(&IoFunctions::mockFreadReturn, 1); - std::unique_ptr buffer = std::make_unique(IoFunctions::mockFwriteReturn); + std::unique_ptr buffer = std::make_unique(IoFunctions::mockFreadReturn); VariableBackup mockFreadBufferBackup(&IoFunctions::mockFreadBuffer, buffer.get()); auto executionEnvironment = std::make_unique();