Skip to content

Commit 6d50420

Browse files
committed
fix sampler test fixture
1 parent e161516 commit 6d50420

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

+10-3
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,22 @@ template <class T> struct urSamplerTestWithParam : urContextTestWithParam<T> {
263263
UR_SAMPLER_ADDRESSING_MODE_CLAMP, /* addressing mode */
264264
UR_SAMPLER_FILTER_MODE_LINEAR, /* filterMode */
265265
};
266-
ASSERT_SUCCESS(urSamplerCreate(this->context, &sampler_desc, &sampler));
266+
auto ret = urSamplerCreate(this->context, &sampler_desc, &sampler);
267+
if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE ||
268+
ret == UR_RESULT_ERROR_UNINITIALIZED) {
269+
GTEST_SKIP() << "urSamplerCreate not supported";
270+
}
267271
}
268272

269273
void TearDown() override {
270-
EXPECT_SUCCESS(urSamplerRelease(sampler));
274+
if (sampler) {
275+
EXPECT_SUCCESS(urSamplerRelease(sampler));
276+
}
277+
271278
UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam<T>::TearDown());
272279
}
273280

274-
ur_sampler_handle_t sampler;
281+
ur_sampler_handle_t sampler = nullptr;
275282
ur_sampler_desc_t sampler_desc;
276283
};
277284

0 commit comments

Comments
 (0)