summaryrefslogtreecommitdiff
path: root/offload/unittests/OffloadAPI/init/olInit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'offload/unittests/OffloadAPI/init/olInit.cpp')
-rw-r--r--offload/unittests/OffloadAPI/init/olInit.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/offload/unittests/OffloadAPI/init/olInit.cpp b/offload/unittests/OffloadAPI/init/olInit.cpp
new file mode 100644
index 000000000000..8e27e77cd0fb
--- /dev/null
+++ b/offload/unittests/OffloadAPI/init/olInit.cpp
@@ -0,0 +1,22 @@
+//===------- Offload API tests - olInit -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// NOTE: For this test suite, the implicit olInit/olShutDown doesn't happen, so
+// tests have to do it themselves
+
+#include "../common/Fixtures.hpp"
+#include <OffloadAPI.h>
+#include <gtest/gtest.h>
+
+struct olInitTest : ::testing::Test {};
+
+TEST_F(olInitTest, Uninitialized) {
+ ASSERT_ERROR(OL_ERRC_UNINITIALIZED,
+ olIterateDevices(
+ [](ol_device_handle_t, void *) { return false; }, nullptr));
+}