brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1011 B · aa9e372 Raw
33 lines · cpp
1//===------- Offload API tests - olDestroyQueue ---------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "../common/Fixtures.hpp"10#include <OffloadAPI.h>11#include <gtest/gtest.h>12 13using olDestroyQueueTest = OffloadQueueTest;14OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olDestroyQueueTest);15 16TEST_P(olDestroyQueueTest, Success) {17  ASSERT_SUCCESS(olDestroyQueue(Queue));18  Queue = nullptr;19}20 21TEST_P(olDestroyQueueTest, SuccessDelayedResolution) {22  ManuallyTriggeredTask Manual;23  ASSERT_SUCCESS(Manual.enqueue(Queue));24  ASSERT_SUCCESS(olDestroyQueue(Queue));25  Queue = nullptr;26 27  ASSERT_SUCCESS(Manual.trigger());28}29 30TEST_P(olDestroyQueueTest, InvalidNullHandle) {31  ASSERT_ERROR(OL_ERRC_INVALID_NULL_HANDLE, olDestroyQueue(nullptr));32}33