From a2aad265bf944b4996a8e638723ebdff77aea185 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Fri, 2 Dec 2022 12:54:10 +0100 Subject: [PATCH] ULT build: fix building unit tests when aubstream is not available Signed-off-by: Mateusz Jablonski --- .../aub_center_using_aubstream_stubs_tests.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp b/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp index 19b992646e..6178952d54 100644 --- a/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp +++ b/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp @@ -6,13 +6,12 @@ */ #include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/source/gmm_helper/gmm_helper.h" -#include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/options.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_aub_center.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "aubstream/aubstream.h" #include "gtest/gtest.h" @@ -31,9 +30,10 @@ TEST(AubCenter, GivenUseAubStreamAndTbxServerIpDebugVariableSetWhenAubCenterIsCr DebugManager.flags.TbxServer.set("10.10.10.10"); VariableBackup backup(&aub_stream_stubs::tbxServerIp); - GmmHelper gmmHelper(nullptr, defaultHwInfo.get()); + MockExecutionEnvironment executionEnvironment{}; + auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0]; - MockAubCenter aubCenter(defaultHwInfo.get(), gmmHelper, false, "", CommandStreamReceiverType::CSR_TBX); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_TBX); EXPECT_STREQ("10.10.10.10", aub_stream_stubs::tbxServerIp.c_str()); } @@ -48,9 +48,10 @@ TEST(AubCenter, GivenUseAubStreamAndTbxServerPortDebugVariableSetWhenAubCenterIs uint16_t port = 1234u; EXPECT_NE(port, aub_stream_stubs::tbxServerPort); - GmmHelper gmmHelper(nullptr, defaultHwInfo.get()); + MockExecutionEnvironment executionEnvironment{}; + auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0]; - MockAubCenter aubCenter(defaultHwInfo.get(), gmmHelper, false, "", CommandStreamReceiverType::CSR_TBX); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_TBX); EXPECT_EQ(port, aub_stream_stubs::tbxServerPort); } @@ -63,8 +64,9 @@ TEST(AubCenter, GivenUseAubStreamAndTbxFrontdoorModeDebugVariableSetWhenAubCente EXPECT_FALSE(aub_stream_stubs::tbxFrontdoorMode); - GmmHelper gmmHelper(nullptr, defaultHwInfo.get()); + MockExecutionEnvironment executionEnvironment{}; + auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0]; - MockAubCenter aubCenter(defaultHwInfo.get(), gmmHelper, false, "", CommandStreamReceiverType::CSR_TBX); + MockAubCenter aubCenter(rootDeviceEnvironment, false, "", CommandStreamReceiverType::CSR_TBX); EXPECT_TRUE(aub_stream_stubs::tbxFrontdoorMode); }