Method to get attention bitmask from threads vector

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-07-23 10:10:58 +00:00
committed by Compute-Runtime-Automation
parent 9bca773b91
commit c4950eb892
11 changed files with 47 additions and 6 deletions

View File

@@ -7,6 +7,7 @@
set(NEO_CORE_test_macros
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/header${BRANCH_DIR_SUFFIX}/test.h
${CMAKE_CURRENT_SOURCE_DIR}/matchers.h
${CMAKE_CURRENT_SOURCE_DIR}/test_checks_shared.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_checks_shared.h
)

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "gmock/gmock.h"
#include <cstdint>
#include <string.h>
MATCHER_P2(MemCompare, memory, size, "") {
return memcmp(arg, memory, size) == 0;
}
MATCHER_P(MemoryZeroed, size, "") {
size_t sizeLeft = (size_t)size;
bool memoryZeroed = true;
while (--sizeLeft) {
uint8_t *pMem = (uint8_t *)arg;
if (pMem[sizeLeft] != 0) {
memoryZeroed = false;
break;
}
}
return memoryZeroed;
}