mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-10 07:08:04 +08:00
Stop using EXPECT_THAT
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5745c3d99d
commit
5f985a012a
@@ -9,6 +9,7 @@
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
||||
|
||||
#include "level_zero/core/source/device/device_imp.h"
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_device.h"
|
||||
#include "level_zero/tools/test/unit_tests/sources/debug/mock_debug_session.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
@@ -481,9 +481,9 @@ TEST(DebugSession, GivenLogsEnabledWhenPrintBitmaskCalledThenBitmaskIsPrinted) {
|
||||
|
||||
auto output = ::testing::internal::GetCapturedStdout();
|
||||
|
||||
EXPECT_THAT(output, testing::HasSubstr(std::string("\nINFO: Bitmask: ")));
|
||||
EXPECT_THAT(output, testing::HasSubstr(std::string("[0] = 0x0000404080808080")));
|
||||
EXPECT_THAT(output, testing::HasSubstr(std::string("[1] = 0x1111ffff1111ffff")));
|
||||
EXPECT_TRUE(hasSubstr(output, std::string("\nINFO: Bitmask: ")));
|
||||
EXPECT_TRUE(hasSubstr(output, std::string("[0] = 0x0000404080808080")));
|
||||
EXPECT_TRUE(hasSubstr(output, std::string("[1] = 0x1111ffff1111ffff")));
|
||||
}
|
||||
|
||||
TEST(DebugSession, GivenLogsDisabledWhenPrintBitmaskCalledThenBitmaskIsNotPrinted) {
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
#include "level_zero/tools/source/debug/linux/prelim/debug_session.h"
|
||||
#include "level_zero/tools/test/unit_tests/sources/debug/mock_debug_session.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
||||
|
||||
#include "common/StateSaveAreaHeader.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include <atomic>
|
||||
#include <fstream>
|
||||
#include <queue>
|
||||
@@ -827,9 +827,9 @@ TEST(DebugSessionTest, GivenLogsEnabledWhenPrintContextVmsCalledThenMapIsPrinted
|
||||
|
||||
auto map = ::testing::internal::GetCapturedStdout();
|
||||
|
||||
EXPECT_THAT(map, testing::HasSubstr(std::string("INFO: Context - VM map:")));
|
||||
EXPECT_THAT(map, testing::HasSubstr(std::string("Context = 0 : 1")));
|
||||
EXPECT_THAT(map, testing::HasSubstr(std::string("Context = 1 : 2")));
|
||||
EXPECT_TRUE(hasSubstr(map, std::string("INFO: Context - VM map:")));
|
||||
EXPECT_TRUE(hasSubstr(map, std::string("Context = 0 : 1")));
|
||||
EXPECT_TRUE(hasSubstr(map, std::string("Context = 1 : 2")));
|
||||
}
|
||||
|
||||
TEST(DebugSessionTest, GivenLogsDisabledWhenPrintContextVmsCalledThenMapIsiNotPrinted) {
|
||||
@@ -4825,7 +4825,7 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamEngineThenEventIs
|
||||
EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance);
|
||||
|
||||
auto infoMessage = ::testing::internal::GetCapturedStdout();
|
||||
EXPECT_THAT(infoMessage, testing::HasSubstr(std::string("I915_CONTEXT_PARAM_ENGINES ctx_id = 20 param = 10 value = 0")));
|
||||
EXPECT_TRUE(hasSubstr(infoMessage, std::string("I915_CONTEXT_PARAM_ENGINES ctx_id = 20 param = 10 value = 0")));
|
||||
}
|
||||
|
||||
TEST_F(DebugApiLinuxTest, GivenDebuggerErrorLogsWhenContextParamWithInvalidContextIsHandledThenErrorIsPrinted) {
|
||||
@@ -4895,7 +4895,7 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerInfoLogsWhenHandlingContextParamEventWith
|
||||
session->clientHandleToConnection[contextParamEvent.client_handle]->contextsCreated.find(77));
|
||||
|
||||
auto errorMessage = ::testing::internal::GetCapturedStdout();
|
||||
EXPECT_THAT(errorMessage, testing::HasSubstr(std::string("client_handle = 1 ctx_handle = 20\n\nINFO: I915_CONTEXT_PARAM UNHANDLED = 1\n")));
|
||||
EXPECT_TRUE(hasSubstr(errorMessage, std::string("client_handle = 1 ctx_handle = 20\n\nINFO: I915_CONTEXT_PARAM UNHANDLED = 1\n")));
|
||||
}
|
||||
|
||||
TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForInterruptThenProperIoctlsIsCalled) {
|
||||
@@ -5184,9 +5184,9 @@ TEST_F(DebugApiLinuxTest, givenEnginesEventHandledThenLrcToContextHandleMapIsFil
|
||||
EXPECT_EQ(40u, session->clientHandleToConnection[clientHandle]->lrcToContextHandle[5]);
|
||||
|
||||
auto infoMessage = ::testing::internal::GetCapturedStdout();
|
||||
EXPECT_THAT(infoMessage, testing::HasSubstr(std::string("ENGINES event: client_handle = 34, ctx_handle = 20, num_engines = 2 CREATE")));
|
||||
EXPECT_THAT(infoMessage, testing::HasSubstr(std::string("ENGINES event: client_handle = 34, ctx_handle = 40, num_engines = 4 CREATE")));
|
||||
EXPECT_THAT(infoMessage, testing::HasSubstr(std::string("ENGINES event: client_handle = 34, ctx_handle = 20, num_engines = 2 DESTROY")));
|
||||
EXPECT_TRUE(hasSubstr(infoMessage, std::string("ENGINES event: client_handle = 34, ctx_handle = 20, num_engines = 2 CREATE")));
|
||||
EXPECT_TRUE(hasSubstr(infoMessage, std::string("ENGINES event: client_handle = 34, ctx_handle = 40, num_engines = 4 CREATE")));
|
||||
EXPECT_TRUE(hasSubstr(infoMessage, std::string("ENGINES event: client_handle = 34, ctx_handle = 20, num_engines = 2 DESTROY")));
|
||||
}
|
||||
|
||||
using DebugApiLinuxAttentionTest = Test<DebugApiLinuxFixture>;
|
||||
|
||||
Reference in New Issue
Block a user