Test Lrca initialization

- debug mode LRI must be present

Change-Id: Idd9f9a85b9610177cb7ca378e37178ce333aa8b2
This commit is contained in:
Hoppe, Mateusz
2018-11-13 10:11:10 +01:00
committed by sys_ocldev
parent b728526c4e
commit e5a8616d26
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
#
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(IGDRCL_SRCS_aub_mem_dump_tests
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/lrca_helper_tests.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_aub_mem_dump_tests})

View File

@@ -0,0 +1,31 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/aub_mem_dump/aub_mem_dump.h"
#include "test.h"
#include <memory>
using namespace AubMemDump;
TEST(LrcaHelper, WhenLrcaHelperIsInitializedThenLrcaIncludesDebugModeLri) {
LrcaHelper helper(0x2000);
auto lrcaBufferSize = helper.sizeLRCA / sizeof(uint32_t);
auto lrca = std::unique_ptr<uint32_t[]>(new uint32_t[lrcaBufferSize]);
helper.initialize(reinterpret_cast<void *>(lrca.get()));
bool debugModeLriFound = false;
for (uint32_t i = 0; i < lrcaBufferSize; i += 2) {
if (lrca[i] == 0x20d8 && lrca[i + 1] == 0x00200020) {
debugModeLriFound = true;
break;
}
}
EXPECT_TRUE(debugModeLriFound);
}