MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / TEST

Function TEST

test/cpp/phi/api/test_phi_exception.cc:21–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace tests {
20
21TEST(PD_THROW, empty) {
22 bool caught_exception = false;
23 try {
24 PD_THROW();
25 } catch (const std::exception& e) {
26 caught_exception = true;
27 std::string err_msg = e.what();
28 EXPECT_TRUE(err_msg.find("An error occurred.") != std::string::npos);
29#if _WIN32
30 EXPECT_TRUE(err_msg.find("test\\cpp\\phi\\api\\test_phi_exception.cc") !=
31 std::string::npos);
32#else
33 EXPECT_TRUE(err_msg.find("test/cpp/phi/api/test_phi_exception.cc") !=
34 std::string::npos);
35#endif
36 }
37 EXPECT_TRUE(caught_exception);
38}
39
40TEST(PD_THROW, non_empty) {
41 bool caught_exception = false;

Callers

nothing calls this directly

Calls 2

whatMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected