| 1840 | } |
| 1841 | |
| 1842 | bool ResultBuilder::log() { |
| 1843 | if(m_at & assertType::is_throws) { //!OCLINT bitwise operator in conditional |
| 1844 | m_failed = !m_threw; |
| 1845 | } else if((m_at & assertType::is_throws_as) && (m_at & assertType::is_throws_with)) { //!OCLINT |
| 1846 | m_failed = !m_threw_as || !m_exception_string.check(m_exception); |
| 1847 | } else if(m_at & assertType::is_throws_as) { //!OCLINT bitwise operator in conditional |
| 1848 | m_failed = !m_threw_as; |
| 1849 | } else if(m_at & assertType::is_throws_with) { //!OCLINT bitwise operator in conditional |
| 1850 | m_failed = !m_exception_string.check(m_exception); |
| 1851 | } else if(m_at & assertType::is_nothrow) { //!OCLINT bitwise operator in conditional |
| 1852 | m_failed = m_threw; |
| 1853 | } |
| 1854 | |
| 1855 | if(m_exception.size()) |
| 1856 | m_exception = "\"" + m_exception + "\""; |
| 1857 | |
| 1858 | if(is_running_in_test) { |
| 1859 | addAssert(m_at); |
| 1860 | DOCTEST_ITERATE_THROUGH_REPORTERS(log_assert, *this); |
| 1861 | |
| 1862 | if(m_failed) |
| 1863 | addFailedAssert(m_at); |
| 1864 | } else if(m_failed) { |
| 1865 | failed_out_of_a_testing_context(*this); |
| 1866 | } |
| 1867 | |
| 1868 | return m_failed && isDebuggerActive() && !getContextOptions()->no_breaks && |
| 1869 | (g_cs->currentTest == nullptr || !g_cs->currentTest->m_no_breaks); // break into debugger |
| 1870 | } |
| 1871 | |
| 1872 | void ResultBuilder::react() const { |
| 1873 | if(m_failed && checkIfShouldThrow(m_at)) |
no test coverage detected