MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / check_async_error

Function check_async_error

src/opr/test/indexing.cpp:584–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582namespace {
583
584void check_async_error(cg::AsyncExecutable* func, int nr_error) {
585 try {
586 func->execute().wait();
587 } catch (MegBrainError& exc) {
588 auto info = static_cast<const cg::OperatorNodeExcExtraInfo*>(exc.extra_info());
589 auto msg_expect = ssprintf("%d async err", nr_error);
590 ASSERT_TRUE(!strncmp(exc.what(), msg_expect.c_str(), msg_expect.size()))
591 << "bad exception message: " << exc.what() << "\nnr_error=" << nr_error;
592 mgb_log("caught exception: %s opr=%s{%s}", exc.what(), info->opr()->cname(),
593 info->opr()->dyn_typeinfo()->name);
594 return;
595 }
596 ASSERT_TRUE(0) << "exception not thrown";
597}
598
599} // anonymous namespace
600

Callers 1

TESTFunction · 0.85

Calls 7

extra_infoMethod · 0.80
waitMethod · 0.45
executeMethod · 0.45
whatMethod · 0.45
sizeMethod · 0.45
cnameMethod · 0.45
oprMethod · 0.45

Tested by

no test coverage detected