Files
compute-runtime/unit_tests/os_interface/linux/drm_residency_handler_tests.cpp
Zbigniew Zdanowicz 0ad068e680 Correct declaration of DrmResidencyHandlerTest class
Change-Id: I53c527954c44dcd7061975064365a1052d4fb5d1
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2019-07-23 15:55:18 -07:00

35 lines
1.0 KiB
C++

/*
* Copyright (C) 2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/os_interface/linux/drm_residency_handler.h"
#include "test.h"
#include "unit_tests/mocks/mock_graphics_allocation.h"
#include <memory>
using namespace NEO;
struct DrmResidencyHandlerTest : public ::testing::Test {
void SetUp() override {
drmResidencyHandler = std::make_unique<DrmResidencyHandler>();
}
MockGraphicsAllocation graphicsAllocation;
std::unique_ptr<DrmResidencyHandler> drmResidencyHandler;
};
TEST_F(DrmResidencyHandlerTest, whenMakingResidentAllocaionExpectMakeResidentFail) {
EXPECT_FALSE(drmResidencyHandler->makeResident(graphicsAllocation));
EXPECT_FALSE(drmResidencyHandler->isResident(graphicsAllocation));
}
TEST_F(DrmResidencyHandlerTest, whenEvictingResidentAllocationExpectEvictFalse) {
EXPECT_FALSE(drmResidencyHandler->makeResident(graphicsAllocation));
EXPECT_FALSE(drmResidencyHandler->evict(graphicsAllocation));
EXPECT_FALSE(drmResidencyHandler->isResident(graphicsAllocation));
}