1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#if defined(_WIN32)
#include "shared/source/os_interface/os_library.h"
#include "shared/source/os_interface/windows/gdi_interface.h"
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
#include "test.h"
#include "gtest/gtest.h"
TEST(GdiInterface, WhenGdiIsCreatedThenItIsInitialized) {
NEO::Gdi gdi;
ASSERT_TRUE(gdi.isInitialized());
}
TEST(GdiInterface, GivenInvalidGdiDllNameWhenCreatingGdiThenGdiIsNotInitialized) {
const char *oldName = Os::gdiDllName;
Os::gdiDllName = "surely_not_exists_.dll";
NEO::Gdi gdi;
EXPECT_FALSE(gdi.isInitialized());
Os::gdiDllName = oldName;
}
TEST(GdiInterface, givenGdiOverridePathWhenGdiInterfaceIsCalledThenOverridePathIsUsed) {
const char *oldName = Os::gdiDllName;
DebugManagerStateRestore dbgRestorer;
Os::gdiDllName = "surely_not_exists_.dll";
DebugManager.flags.OverrideGdiPath.set(oldName);
NEO::Gdi gdi;
EXPECT_TRUE(gdi.isInitialized());
Os::gdiDllName = oldName;
}
TEST(ThkWrapperTest, givenThkWrapperWhenConstructedThenmFuncIsInitialized) {
NEO::ThkWrapper<void *> wrapper;
EXPECT_EQ(nullptr, wrapper.mFunc);
}
#endif
|