mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
test: create dedicated mock object for timestamp packet
Related-To: NEO-6871 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ab69e87a5e
commit
a54c947866
@@ -81,6 +81,7 @@ set(NEO_CORE_tests_mocks
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_tbx_csr.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_tbx_stream.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_timestamp_container.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_timestamp_packet.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ult_device_factory.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ult_device_factory.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_gmm_client_context.cpp
|
||||
|
||||
33
shared/test/common/mocks/mock_timestamp_packet.h
Normal file
33
shared/test/common/mocks/mock_timestamp_packet.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class MockTimestampPackets32 : public TimestampPackets<uint32_t> {
|
||||
public:
|
||||
using typename TimestampPackets<uint32_t>::Packet;
|
||||
using TimestampPackets<uint32_t>::packets;
|
||||
|
||||
void setTagToReadyState() {
|
||||
initialize();
|
||||
|
||||
uint32_t zeros[4] = {};
|
||||
|
||||
for (uint32_t i = 0; i < TimestampPacketSizeControl::preferredPacketCount; i++) {
|
||||
assignDataToAllTimestamps(i, zeros);
|
||||
}
|
||||
}
|
||||
|
||||
void setToNonReadyState() {
|
||||
packets[0].contextEnd = 1;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user