1 | //===------- Offload API tests - olCreateQueue ----------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "../common/Fixtures.hpp" |
10 | #include <OffloadAPI.h> |
11 | #include <gtest/gtest.h> |
12 | |
13 | using olCreateQueueTest = OffloadDeviceTest; |
14 | OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olCreateQueueTest); |
15 | |
16 | TEST_P(olCreateQueueTest, Success) { |
17 | ol_queue_handle_t Queue = nullptr; |
18 | ASSERT_SUCCESS(olCreateQueue(Device, &Queue)); |
19 | ASSERT_NE(Queue, nullptr); |
20 | } |
21 | |
22 | TEST_P(olCreateQueueTest, InvalidNullHandleDevice) { |
23 | ol_queue_handle_t Queue = nullptr; |
24 | ASSERT_ERROR(OL_ERRC_INVALID_NULL_HANDLE, olCreateQueue(nullptr, &Queue)); |
25 | } |
26 | |
27 | TEST_P(olCreateQueueTest, InvalidNullPointerQueue) { |
28 | ASSERT_ERROR(OL_ERRC_INVALID_NULL_POINTER, olCreateQueue(Device, nullptr)); |
29 | } |
30 | |