Files
compute-runtime/unit_tests/platform/platform_negative_tests.cpp
Mateusz Jablonski c739500047 Pass execution environment to Platform
Related-To: NEO-4208
Change-Id: Iec8c6bedfd4a3fce160651768fb45f74cf3a36e8
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-02-10 10:08:55 +01:00

31 lines
751 B
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/unit_tests/helpers/ult_hw_config.h"
#include "runtime/platform/platform.h"
#include "test.h"
#include "unit_tests/helpers/variable_backup.h"
#include "unit_tests/mocks/mock_platform.h"
using namespace NEO;
struct PlatformNegativeTest : public ::testing::Test {
void SetUp() override {
pPlatform.reset(new MockPlatform());
}
std::unique_ptr<Platform> pPlatform;
};
TEST_F(PlatformNegativeTest, GivenPlatformWhenGetDevicesFailedThenFalseIsReturned) {
VariableBackup<UltHwConfig> backup{&ultHwConfig};
ultHwConfig.mockedGetDevicesFuncResult = false;
auto ret = pPlatform->initialize();
EXPECT_FALSE(ret);
}