diff --git a/test/conformance/event/urEventCreateWithNativeHandle.cpp b/test/conformance/event/urEventCreateWithNativeHandle.cpp index d35214fc4d..fbfe143ac6 100644 --- a/test/conformance/event/urEventCreateWithNativeHandle.cpp +++ b/test/conformance/event/urEventCreateWithNativeHandle.cpp @@ -56,3 +56,27 @@ TEST_P(urEventCreateWithNativeHandleTest, SuccessWithProperties) { sizeof(ur_execution_info_t), &exec_info, nullptr)); } + +TEST_P(urEventCreateWithNativeHandleTest, InvalidNullHandle) { + ur_native_handle_t native_event = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urEventGetNativeHandle(event, &native_event)); + + uur::raii::Event evt = nullptr; + ASSERT_EQ_RESULT( + urEventCreateWithNativeHandle(native_event, nullptr, nullptr, evt.ptr()), + UR_RESULT_ERROR_INVALID_NULL_HANDLE); +} + +TEST_P(urEventCreateWithNativeHandleTest, InvalidNullPointer) { + ur_native_handle_t native_event = 0; + + UUR_ASSERT_SUCCESS_OR_UNSUPPORTED( + urEventGetNativeHandle(event, &native_event)); + + uur::raii::Event evt = nullptr; + ASSERT_EQ_RESULT( + urEventCreateWithNativeHandle(native_event, context, nullptr, nullptr), + UR_RESULT_ERROR_INVALID_NULL_POINTER); +} diff --git a/test/conformance/event/urEventGetProfilingInfo.cpp b/test/conformance/event/urEventGetProfilingInfo.cpp index f19b8af551..16723df5cf 100644 --- a/test/conformance/event/urEventGetProfilingInfo.cpp +++ b/test/conformance/event/urEventGetProfilingInfo.cpp @@ -215,3 +215,41 @@ TEST_P(urEventGetProfilingInfoForWaitWithBarrier, Success) { ASSERT_GE(complete_value, submit_value); } + +struct urEventGetProfilingInfoInvalidQueue : uur::urQueueTest { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp()); + ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_WRITE_ONLY, size, + nullptr, &buffer)); + + input.assign(count, 42); + ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, false, 0, size, + input.data(), 0, nullptr, &event)); + ASSERT_SUCCESS(urEventWait(1, &event)); + } + + void TearDown() override { + if (buffer) { + EXPECT_SUCCESS(urMemRelease(buffer)); + } + UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::TearDown()); + }; + + const size_t count = 1024; + const size_t size = sizeof(uint32_t) * count; + ur_mem_handle_t buffer = nullptr; + ur_event_handle_t event = nullptr; + std::vector input; +}; + +UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEventGetProfilingInfoInvalidQueue); + +TEST_P(urEventGetProfilingInfoInvalidQueue, ProfilingInfoNotAvailable) { + UUR_KNOWN_FAILURE_ON(uur::NativeCPU{}); + + const ur_profiling_info_t property_name = UR_PROFILING_INFO_COMMAND_QUEUED; + size_t property_size; + ASSERT_EQ_RESULT( + urEventGetProfilingInfo(event, property_name, 0, nullptr, &property_size), + UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE); +} diff --git a/test/conformance/event/urEventSetCallback.cpp b/test/conformance/event/urEventSetCallback.cpp index e53b61b961..7479b50a2a 100644 --- a/test/conformance/event/urEventSetCallback.cpp +++ b/test/conformance/event/urEventSetCallback.cpp @@ -189,4 +189,11 @@ TEST_P(urEventSetCallbackNegativeTest, InvalidEnumeration) { UR_RESULT_ERROR_INVALID_ENUMERATION); } +TEST_P(urEventSetCallbackNegativeTest, UnsupportedEnumeration) { + ASSERT_EQ_RESULT( + urEventSetCallback(event, ur_execution_info_t::UR_EXECUTION_INFO_QUEUED, + emptyCallback, nullptr), + UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION); +} + UUR_INSTANTIATE_DEVICE_TEST_SUITE(urEventSetCallbackNegativeTest);