Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove error_category_for and errc_for tests #745

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 0 additions & 118 deletions tests/exceptions/exceptions_constructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,124 +202,6 @@ TEST_CASE("Constructors for sycl::exception with sycl::errc error codes",
}
}

#ifdef SYCL_BACKEND_OPENCL
// !FIXME Disabled until issue
// https://github.com/KhronosGroup/SYCL-Docs/issues/182 is not resolved.
DISABLED_FOR_TEST_CASE(DPCPP)
("Constructors for sycl::exception with OpenCL error code", "[exception]")({
auto prefer_open_cl = [](const sycl::device& d) -> int {
return d.get_backend() == sycl::backend::opencl;
};

sycl::device open_cl_device{prefer_open_cl};
const sycl::context ctx(open_cl_device);

if (ctx.get_backend() != sycl::backend::opencl) {
WARN("OpenCL backend is not supported on this device.");
return;
}

const std::string what_arg_str = "test";

int err_val = 0;
auto err_code = static_cast<sycl::errc_for<sycl::backend::opencl>>(err_val);
auto std_errc = std::error_code(
err_code, sycl::error_category_for<sycl::backend::opencl>());

SECTION("exception(std::error_code ec, const std::string& what_arg)") {
sycl::exception e(std_errc, what_arg_str);
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str);
}
SECTION("exception(std::error_code ec, const char* what_arg)") {
sycl::exception e(std_errc, what_arg_str.c_str());
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str);
}
SECTION("exception(std::error_code ec)") {
sycl::exception e(std_errc);
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>());
}

SECTION(
"exception(int ev, const std::error_category& ecat, const std::string& "
"what_arg)") {
sycl::exception e(err_val,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str);
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str);
}
SECTION(
"exception(int ev, const std::error_category& ecat, const char* "
"what_arg)") {
sycl::exception e(err_val,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str.c_str());
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str);
}
SECTION("exception(int ev, const std::error_category& ecat)") {
sycl::exception e(err_val,
sycl::error_category_for<sycl::backend::opencl>());
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>());
}

SECTION(
"exception(context ctx, std::error_code ec, const std::string& "
"what_arg)") {
sycl::exception e(ctx, std_errc, what_arg_str);
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str, ctx);
}
SECTION("exception(context ctx, std::error_code ec, const char* what_arg)") {
sycl::exception e(ctx, std_errc, what_arg_str.c_str());
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str, ctx);
}
SECTION("exception(context ctx, std::error_code ec)") {
sycl::exception e(ctx, std_errc);
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(), ctx);
}

SECTION(
"exception(context ctx, int ev,const std::error_category& ecat, const "
"std::string& what_arg)") {
sycl::exception e(ctx, err_val,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str);
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str, ctx);
}
SECTION(
"exception(context ctx, int ev,const std::error_category& ecat, const "
"char* what_arg)") {
sycl::exception e(ctx, err_val,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str.c_str());
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(),
what_arg_str, ctx);
}
SECTION("exception(context ctx, int ev,const std::error_category& ecat)") {
sycl::exception e(ctx, err_val,
sycl::error_category_for<sycl::backend::opencl>());
check_exception(e, std_errc,
sycl::error_category_for<sycl::backend::opencl>(), ctx);
}
});
#endif

TEST_CASE("sycl::exception is derived from std::exception", "[exception]") {
CHECK(std::is_base_of_v<std::exception, sycl::exception>);
}
Expand Down
96 changes: 0 additions & 96 deletions tests/exceptions/exceptions_errc_for.cpp

This file was deleted.