MCPcopy Create free account
hub / github.com/apache/tvm-ffi / TEST

Function TEST

tests/cpp/test_error.cc:30–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28void ThrowRuntimeError() { TVM_FFI_THROW(RuntimeError) << "test0"; }
29
30TEST(Error, Backtrace) {
31 EXPECT_THROW(
32 {
33 try {
34 ThrowRuntimeError();
35 } catch (const Error& error) {
36 EXPECT_EQ(error.message(), "test0");
37 EXPECT_EQ(error.kind(), "RuntimeError");
38 std::string full_message = error.FullMessage();
39 EXPECT_NE(full_message.find("line"), std::string::npos);
40 EXPECT_NE(full_message.find("ThrowRuntimeError"), std::string::npos);
41 EXPECT_NE(full_message.find("RuntimeError: test0"), std::string::npos);
42 throw;
43 }
44 },
45 ::tvm::ffi::Error);
46}
47
48TEST(CheckError, Backtrace) {
49 EXPECT_THROW(

Callers

nothing calls this directly

Calls 11

ThrowRuntimeErrorFunction · 0.85
FullMessageMethod · 0.80
cause_chainMethod · 0.80
extra_contextMethod · 0.80
ErrorClass · 0.50
messageMethod · 0.45
kindMethod · 0.45
findMethod · 0.45
valueMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected