Files
compute-runtime/unit_tests/aub/aub_center_using_aubstream_stubs_tests.cpp
Filip Hazubski 8b57d28116 clang-format: enable sorting includes
Include files are now grouped and sorted in following order:
1. Header file of the class the current file implements
2. Project files
3. Third party files
4. Standard library

Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2019-02-27 11:50:07 +01:00

57 lines
1.9 KiB
C++

/*
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/hw_info.h"
#include "runtime/helpers/options.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/helpers/variable_backup.h"
#include "unit_tests/mocks/mock_aub_center.h"
#include "gtest/gtest.h"
#include "third_party/aub_stream/headers/options.h"
using namespace OCLRT;
namespace aub_stream_stubs {
extern uint16_t tbxServerPort;
extern std::string tbxServerIp;
} // namespace aub_stream_stubs
TEST(AubCenter, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubManagerIsNotCreated) {
DebugManagerStateRestore restorer;
DebugManager.flags.UseAubStream.set(true);
MockAubCenter aubCenter(platformDevices[0], false, "test", CommandStreamReceiverType::CSR_AUB);
EXPECT_EQ(nullptr, aubCenter.aubManager.get());
}
TEST(AubCenter, GivenUseAubStreamAndTbxServerIpDebugVariableSetWhenAubCenterIsCreatedThenServerIpIsModified) {
DebugManagerStateRestore restorer;
DebugManager.flags.UseAubStream.set(true);
DebugManager.flags.TbxServer.set("10.10.10.10");
VariableBackup<std::string> backup(&aub_stream_stubs::tbxServerIp);
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_TBX);
EXPECT_STREQ("10.10.10.10", aub_stream_stubs::tbxServerIp.c_str());
}
TEST(AubCenter, GivenUseAubStreamAndTbxServerPortDebugVariableSetWhenAubCenterIsCreatedThenServerIpIsModified) {
DebugManagerStateRestore restorer;
DebugManager.flags.UseAubStream.set(true);
DebugManager.flags.TbxPort.set(1234);
VariableBackup<uint16_t> backup(&aub_stream_stubs::tbxServerPort);
uint16_t port = 1234u;
EXPECT_NE(port, aub_stream_stubs::tbxServerPort);
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_TBX);
EXPECT_EQ(port, aub_stream_stubs::tbxServerPort);
}