Files
compute-runtime/unit_tests/platform/platform_negative_tests.cpp
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00

33 lines
734 B
C++

/*
* Copyright (C) 2017-2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/options.h"
#include "runtime/platform/platform.h"
#include "unit_tests/helpers/variable_backup.h"
#include "test.h"
using namespace OCLRT;
namespace OCLRT {
extern bool getDevicesResult;
}; // namespace OCLRT
struct PlatformNegativeTest : public ::testing::Test {
void SetUp() override {
pPlatform.reset(new Platform());
}
std::unique_ptr<Platform> pPlatform;
};
TEST_F(PlatformNegativeTest, GivenPlatformWhenGetDevicesFailedThenFalseIsReturned) {
VariableBackup<decltype(getDevicesResult)> bkp(&getDevicesResult, false);
auto ret = pPlatform->initialize();
EXPECT_FALSE(ret);
}