MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / log_assert

Method log_assert

tests/framework/src/doctest.cpp:2507–2534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2505 void subcase_end() override { xml.endElement(); }
2506
2507 void log_assert(const AssertData& rb) override {
2508 if(!rb.m_failed && !opt.success)
2509 return;
2510
2511 DOCTEST_LOCK_MUTEX(mutex)
2512
2513 xml.startElement("Expression")
2514 .writeAttribute("success", !rb.m_failed)
2515 .writeAttribute("type", assertString(rb.m_at))
2516 .writeAttribute("filename", skipPathFromFilename(rb.m_file))
2517 .writeAttribute("line", line(rb.m_line));
2518
2519 xml.scopedElement("Original").writeText(rb.m_expr);
2520
2521 if(rb.m_threw)
2522 xml.scopedElement("Exception").writeText(rb.m_exception.c_str());
2523
2524 if(rb.m_at & assertType::is_throws_as)
2525 xml.scopedElement("ExpectedException").writeText(rb.m_exception_type);
2526 if(rb.m_at & assertType::is_throws_with)
2527 xml.scopedElement("ExpectedExceptionString").writeText(rb.m_exception_string.c_str());
2528 if((rb.m_at & assertType::is_normal) && !rb.m_threw)
2529 xml.scopedElement("Expanded").writeText(rb.m_decomp.c_str());
2530
2531 log_contexts();
2532
2533 xml.endElement();
2534 }
2535
2536 void log_message(const MessageData& mb) override {
2537 DOCTEST_LOCK_MUTEX(mutex)

Callers

nothing calls this directly

Calls 5

assertStringFunction · 0.85
skipPathFromFilenameFunction · 0.85
scopedElementMethod · 0.80
lineClass · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected