Skip to content

Commit f3366d6

Browse files
committed
TEST/UCP/DEVICE: Improve error detection
1 parent 61e00bb commit f3366d6

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

test/gtest/ucp/test_ucp_device.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ UCS_TEST_P(test_ucp_device, mapped_buffer_kernel_memcmp)
124124

125125
UCS_TEST_P(test_ucp_device, create_success)
126126
{
127-
scoped_log_handler wrap_err(wrap_errors_logger);
128127
mem_list list(sender(), receiver());
129128
ucp_device_mem_list_handle_h handle = nullptr;
130129

@@ -172,6 +171,8 @@ UCS_TEST_P(test_ucp_device, create_fail)
172171
ucp_device_mem_list_handle_h handle = nullptr;
173172
ucp_device_mem_list_params_t empty_params = {};
174173

174+
scoped_log_handler wrap_err(wrap_errors_logger);
175+
175176
ASSERT_EQ(UCS_ERR_INVALID_PARAM,
176177
ucp_device_mem_list_create(sender().ep(), NULL, &handle));
177178

test/gtest/uct/test_device.cc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@ class test_device : public uct_test {
2828
uct_test::init();
2929
status = uct_cuda_base_get_cuda_device(GetParam()->sys_device,
3030
&m_cuda_dev);
31-
if (status != UCS_OK) {
32-
return;
33-
}
31+
ASSERT_UCS_OK(status, << " sys_device "
32+
<< static_cast<int>(GetParam()->sys_device));
3433

3534
status = UCT_CUDADRV_FUNC_LOG_ERR(
3635
cuDevicePrimaryCtxRetain(&ctx, m_cuda_dev));
37-
if (status != UCS_OK) {
38-
return;
39-
}
36+
ASSERT_UCS_OK(status);
4037

4138
status = UCT_CUDADRV_FUNC_LOG_ERR(cuCtxPushCurrent(ctx));
42-
if (status != UCS_OK) {
43-
return;
44-
}
39+
ASSERT_UCS_OK(status);
4540

4641
m_receiver = uct_test::create_entity(0);
4742
m_entities.push_back(m_receiver);

0 commit comments

Comments
 (0)