MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / log_assert

Method log_assert

external/utf8-cpp-utils/test/doctest.h:5597–5624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5595 void subcase_end() override { xml.endElement(); }
5596
5597 void log_assert(const AssertData& rb) override {
5598 if(!rb.m_failed && !opt.success)
5599 return;
5600
5601 DOCTEST_LOCK_MUTEX(mutex)
5602
5603 xml.startElement("Expression")
5604 .writeAttribute("success", !rb.m_failed)
5605 .writeAttribute("type", assertString(rb.m_at))
5606 .writeAttribute("filename", skipPathFromFilename(rb.m_file))
5607 .writeAttribute("line", line(rb.m_line));
5608
5609 xml.scopedElement("Original").writeText(rb.m_expr);
5610
5611 if(rb.m_threw)
5612 xml.scopedElement("Exception").writeText(rb.m_exception.c_str());
5613
5614 if(rb.m_at & assertType::is_throws_as)
5615 xml.scopedElement("ExpectedException").writeText(rb.m_exception_type);
5616 if(rb.m_at & assertType::is_throws_with)
5617 xml.scopedElement("ExpectedExceptionString").writeText(rb.m_exception_string.c_str());
5618 if((rb.m_at & assertType::is_normal) && !rb.m_threw)
5619 xml.scopedElement("Expanded").writeText(rb.m_decomp.c_str());
5620
5621 log_contexts();
5622
5623 xml.endElement();
5624 }
5625
5626 void log_message(const MessageData& mb) override {
5627 DOCTEST_LOCK_MUTEX(mutex)

Callers

nothing calls this directly

Calls 2

skipPathFromFilenameFunction · 0.85
scopedElementMethod · 0.80

Tested by

no test coverage detected