Skip to content

Commit c006425

Browse files
RossBruntonbb-ur
authored andcommitted
Small fixes for urEventGetProfilingInfo tests (#19855)
These tests now better handle the query being unsupported.
1 parent 9b97f71 commit c006425

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

test/conformance/event/urEventGetProfilingInfo.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ TEST_P(urEventGetProfilingInfoTest, InvalidNullHandle) {
158158

159159
const ur_profiling_info_t property_name = UR_PROFILING_INFO_COMMAND_QUEUED;
160160
size_t property_size;
161-
ASSERT_SUCCESS(urEventGetProfilingInfo(event, property_name, 0, nullptr,
162-
&property_size));
161+
ASSERT_SUCCESS_OR_OPTIONAL_QUERY(
162+
urEventGetProfilingInfo(event, property_name, 0, nullptr, &property_size),
163+
UR_PROFILING_INFO_COMMAND_QUEUED);
163164
ASSERT_NE(property_size, 0);
164165

165166
ASSERT_EQ_RESULT(urEventGetProfilingInfo(nullptr, property_name, 0, nullptr,
@@ -270,7 +271,8 @@ TEST_P(urEventGetProfilingInfoInvalidQueue, ProfilingInfoNotAvailable) {
270271

271272
const ur_profiling_info_t property_name = UR_PROFILING_INFO_COMMAND_QUEUED;
272273
size_t property_size;
273-
ASSERT_EQ_RESULT(
274-
urEventGetProfilingInfo(event, property_name, 0, nullptr, &property_size),
275-
UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE);
274+
auto res =
275+
urEventGetProfilingInfo(event, property_name, 0, nullptr, &property_size);
276+
ASSERT_TRUE(res == UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE ||
277+
res == UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION);
276278
}

0 commit comments

Comments
 (0)