2018-02-16 14:26:48 +01:00
|
|
|
/*
|
2019-02-27 11:39:32 +01:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2018-02-16 14:26:48 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-02-16 14:26:48 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "runtime/helpers/options.h"
|
|
|
|
|
#include "runtime/platform/platform.h"
|
|
|
|
|
#include "test.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "unit_tests/helpers/variable_backup.h"
|
2018-02-16 14:26:48 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
using namespace NEO;
|
2018-02-16 14:26:48 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-02-16 14:26:48 +01:00
|
|
|
extern bool getDevicesResult;
|
2019-03-26 11:59:46 +01:00
|
|
|
}; // namespace NEO
|
2018-02-16 14:26:48 +01:00
|
|
|
|
|
|
|
|
struct PlatformNegativeTest : public ::testing::Test {
|
|
|
|
|
void SetUp() override {
|
2018-06-26 12:49:00 +02:00
|
|
|
pPlatform.reset(new Platform());
|
2018-02-16 14:26:48 +01:00
|
|
|
}
|
|
|
|
|
|
2018-06-26 12:49:00 +02:00
|
|
|
std::unique_ptr<Platform> pPlatform;
|
2018-02-16 14:26:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TEST_F(PlatformNegativeTest, GivenPlatformWhenGetDevicesFailedThenFalseIsReturned) {
|
2018-03-05 13:43:24 +01:00
|
|
|
VariableBackup<decltype(getDevicesResult)> bkp(&getDevicesResult, false);
|
2018-02-16 14:26:48 +01:00
|
|
|
|
2018-06-20 18:25:40 +02:00
|
|
|
auto ret = pPlatform->initialize();
|
2018-02-16 14:26:48 +01:00
|
|
|
EXPECT_FALSE(ret);
|
|
|
|
|
}
|