MCPcopy Create free account
hub / github.com/NVIDIA/DALI / TEST

Function TEST

dali/core/error_test.cc:21–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace dali {
20
21TEST(Error, EnforceFailed) {
22 std::string file_and_line;
23 std::string message = "Test message";
24 try {
25 // the two statements below must be in one line!
26 file_and_line = FILE_AND_LINE; DALI_ENFORCE(!"Always fail", message);
27 FAIL() << "Exception was expeceted";
28 } catch (DALIException &e) {
29 std::string msg = e.what();
30 EXPECT_NE(e.GetFileAndLine().find(file_and_line), std::string::npos)
31 << "File/line spec not found in error `what()`, which is:\n" << msg;
32 EXPECT_NE(msg.find(message), std::string::npos)
33 << "Original message not found in error `what()`, which is:\n" << msg;
34 } catch (...) {
35 FAIL() << "Expected DALIException, got other exception";
36 }
37}
38
39TEST(Error, CudaError) {
40 try {

Callers

nothing calls this directly

Calls 8

CUDA_CALLFunction · 0.85
cuInitCheckedFunction · 0.85
is_rt_apiMethod · 0.80
is_drv_apiMethod · 0.80
rt_errorMethod · 0.80
drv_errorMethod · 0.80
whatMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected