Skip to content

Commit 9ca6913

Browse files
committed
[CTS] skip image tests if images are not supported
1 parent 50ef8c9 commit 9ca6913

File tree

4 files changed

+11
-26
lines changed

4 files changed

+11
-26
lines changed

test/conformance/memory/memory_adapter_level_zero_v2.match

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ TEST_P(urMemImageCreateTestWithImageFormatParam, Success) {
110110
}
111111
}
112112

113+
if (res == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
114+
GTEST_SKIP() << "urMemImageCreate not supported";
115+
}
116+
113117
if (!is_primary_image_format &&
114118
res == UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT) {
115119
GTEST_SKIP();

test/conformance/memory/urMemImageCreateWithNativeHandle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemImageCreateWithNativeHandleTest);
1010

1111
TEST_P(urMemImageCreateWithNativeHandleTest, Success) {
1212
ur_native_handle_t native_handle = 0;
13-
ASSERT_SUCCESS(urMemGetNativeHandle(image, device, &native_handle));
13+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(urMemGetNativeHandle(image, device, &native_handle));
1414

1515
ur_mem_handle_t mem = nullptr;
1616
ASSERT_SUCCESS(urMemImageCreateWithNativeHandle(

test/conformance/testing/include/uur/fixtures.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ struct urMemImageTest : urContextTest {
208208
if (!imageSupported) {
209209
GTEST_SKIP();
210210
}
211-
ASSERT_SUCCESS(urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE,
212-
&image_format, &image_desc, nullptr,
213-
&image));
211+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
212+
urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE, &image_format,
213+
&image_desc, nullptr, &image));
214214
}
215215

216216
void TearDown() override {
@@ -322,8 +322,9 @@ template <class T> struct urMemImageTestWithParam : urContextTestWithParam<T> {
322322
if (!imageSupported) {
323323
GTEST_SKIP();
324324
}
325-
ASSERT_SUCCESS(urMemImageCreate(this->context, UR_MEM_FLAG_READ_WRITE,
326-
&format, &desc, nullptr, &image));
325+
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
326+
urMemImageCreate(this->context, UR_MEM_FLAG_READ_WRITE, &format,
327+
&desc, nullptr, &image));
327328
ASSERT_NE(nullptr, image);
328329
}
329330

0 commit comments

Comments
 (0)