2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2018-09-18 09:11:08 +02:00
|
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2018-08-27 11:58:31 +02:00
|
|
|
#include "runtime/os_interface/os_context.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
#include "runtime/os_interface/os_interface.h"
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
|
|
namespace OCLRT {
|
|
|
|
|
|
|
|
|
|
TEST(OsInterfaceTest, GivenLinuxWhenare64kbPagesEnabledThenFalse) {
|
|
|
|
|
EXPECT_FALSE(OSInterface::are64kbPagesEnabled());
|
|
|
|
|
}
|
2018-04-20 14:44:14 +02:00
|
|
|
|
|
|
|
|
TEST(OsInterfaceTest, GivenLinuxOsInterfaceWhenDeviceHandleQueriedthenZeroIsReturned) {
|
|
|
|
|
OSInterface osInterface;
|
|
|
|
|
EXPECT_EQ(0u, osInterface.getDeviceHandle());
|
|
|
|
|
}
|
2018-08-27 11:58:31 +02:00
|
|
|
|
|
|
|
|
TEST(OsContextTest, WhenOsContextIsCreatedThenImplIsAvailable) {
|
|
|
|
|
OSInterface osInterface;
|
2018-09-12 07:47:55 +02:00
|
|
|
auto osContext = std::make_unique<OsContext>(&osInterface, 0u);
|
2018-08-27 11:58:31 +02:00
|
|
|
EXPECT_NE(nullptr, osContext->get());
|
|
|
|
|
}
|
2018-09-12 07:47:55 +02:00
|
|
|
} // namespace OCLRT
|