Fix compilation issues

Change-Id: I0a4d14052c63eb277c7719fae3696050f596539d
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-09-03 09:39:39 +02:00
committed by sys_ocldev
parent 288193c6b4
commit 20c9cb2d57

View File

@ -74,14 +74,10 @@ extern const HardwareInfo **platformDevices;
} }
using namespace NEO; using namespace NEO;
struct GmmInterfaceTest : public ::testing::Test { struct GmmInterfaceTest : public ::testing::Test {
const char *empty = "";
void SetUp() override { VariableBackup<const char *> gmmDllNameBackup = {&Os::gmmDllName, empty};
gmmDllNameBackup = std::make_unique<VariableBackup<const char *>>(&Os::gmmDllName, ""); VariableBackup<const char *> gmmEntryNameBackup = {&Os::gmmEntryName, mockGmmEntryName};
gmmEntryNameBackup = std::make_unique<VariableBackup<const char *>>(&Os::gmmEntryName, mockGmmEntryName);
}
std::unique_ptr<VariableBackup<const char *>> gmmDllNameBackup;
std::unique_ptr<VariableBackup<const char *>> gmmEntryNameBackup;
}; };
TEST_F(GmmInterfaceTest, givenValidGmmLibWhenCreateGmmHelperThenEverythingWorksFine) { TEST_F(GmmInterfaceTest, givenValidGmmLibWhenCreateGmmHelperThenEverythingWorksFine) {
@ -90,7 +86,7 @@ TEST_F(GmmInterfaceTest, givenValidGmmLibWhenCreateGmmHelperThenEverythingWorksF
} }
TEST_F(GmmInterfaceTest, givenInvalidGmmLibNameWhenCreateGmmHelperThenThrowException) { TEST_F(GmmInterfaceTest, givenInvalidGmmLibNameWhenCreateGmmHelperThenThrowException) {
std::unique_ptr<GmmHelper> gmmHelper; std::unique_ptr<GmmHelper> gmmHelper;
*gmmDllNameBackup = "invalidName"; gmmDllNameBackup = "invalidName";
EXPECT_THROW(gmmHelper.reset(new GmmHelper(*platformDevices)), std::exception); EXPECT_THROW(gmmHelper.reset(new GmmHelper(*platformDevices)), std::exception);
} }
TEST_F(GmmInterfaceTest, givenGmmLibWhenOpenGmmFunctionFailsThenThrowException) { TEST_F(GmmInterfaceTest, givenGmmLibWhenOpenGmmFunctionFailsThenThrowException) {