code coverage should be maxed - around 99.2%
diff --git a/doctest/doctest.h b/doctest/doctest.h
index 5ab474d..283c0e8 100644
--- a/doctest/doctest.h
+++ b/doctest/doctest.h
@@ -989,7 +989,7 @@
void setResult(const Result& res) { m_result = res; }
template <int comparison, typename L, typename R>
- void binary_assert(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
+ void binary_assert(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
m_result.m_passed = RelationalComparator<comparison, L, R>()(lhs, rhs);
m_result.m_decomposition = stringifyBinaryExpr(lhs, ", ", rhs);
}
@@ -1016,7 +1016,8 @@
template <int comparison, typename L, typename R>
int fast_binary_assert(assertType::Enum assert_type, const char* file, int line,
- const char* lhs_str, const char* rhs_str, const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
+ const char* lhs_str, const char* rhs_str, const DOCTEST_REF_WRAP(L) lhs,
+ const DOCTEST_REF_WRAP(R) rhs) {
String expr = String(lhs_str) + ", " + rhs_str;
const char* expr_str = expr.c_str();
ResultBuilder rb(assert_type, file, line, expr_str);
@@ -1709,7 +1710,6 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cassert>
#include <limits>
#include <utility>
#include <sstream>
@@ -2166,7 +2166,6 @@
case assertType::DT_FAST_WARN_UNARY_FALSE : return "FAST_WARN_UNARY_FALSE";
case assertType::DT_FAST_CHECK_UNARY_FALSE : return "FAST_CHECK_UNARY_FALSE";
case assertType::DT_FAST_REQUIRE_UNARY_FALSE: return "FAST_REQUIRE_UNARY_FALSE";
- default: assert(false);
// clang-format on
}
return "";
diff --git a/doctest/parts/doctest_fwd.h b/doctest/parts/doctest_fwd.h
index aecd624..0b1c0ba 100644
--- a/doctest/parts/doctest_fwd.h
+++ b/doctest/parts/doctest_fwd.h
@@ -986,7 +986,7 @@
void setResult(const Result& res) { m_result = res; }
template <int comparison, typename L, typename R>
- void binary_assert(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
+ void binary_assert(const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
m_result.m_passed = RelationalComparator<comparison, L, R>()(lhs, rhs);
m_result.m_decomposition = stringifyBinaryExpr(lhs, ", ", rhs);
}
@@ -1013,7 +1013,8 @@
template <int comparison, typename L, typename R>
int fast_binary_assert(assertType::Enum assert_type, const char* file, int line,
- const char* lhs_str, const char* rhs_str, const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs) {
+ const char* lhs_str, const char* rhs_str, const DOCTEST_REF_WRAP(L) lhs,
+ const DOCTEST_REF_WRAP(R) rhs) {
String expr = String(lhs_str) + ", " + rhs_str;
const char* expr_str = expr.c_str();
ResultBuilder rb(assert_type, file, line, expr_str);
diff --git a/doctest/parts/doctest_impl.h b/doctest/parts/doctest_impl.h
index 61b02b9..575b32a 100644
--- a/doctest/parts/doctest_impl.h
+++ b/doctest/parts/doctest_impl.h
@@ -83,7 +83,6 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cassert>
#include <limits>
#include <utility>
#include <sstream>
@@ -540,7 +539,6 @@
case assertType::DT_FAST_WARN_UNARY_FALSE : return "FAST_WARN_UNARY_FALSE";
case assertType::DT_FAST_CHECK_UNARY_FALSE : return "FAST_CHECK_UNARY_FALSE";
case assertType::DT_FAST_REQUIRE_UNARY_FALSE: return "FAST_REQUIRE_UNARY_FALSE";
- default: assert(false);
// clang-format on
}
return "";
diff --git a/scripts/code_coverage_source/test.cpp b/scripts/code_coverage_source/test.cpp
index 942d071..c6ae9d5 100644
--- a/scripts/code_coverage_source/test.cpp
+++ b/scripts/code_coverage_source/test.cpp
@@ -110,7 +110,7 @@
FAST_REQUIRE_UNARY(1);
FAST_WARN_UNARY_FALSE(0);
FAST_CHECK_UNARY_FALSE(0);
- FAST_REQUIRE_UNARY_FALSE(0);
+ FAST_REQUIRE_UNARY_FALSE(1);
}
TEST_CASE("throws") { throws(true); }
diff --git a/scripts/code_coverage_source/test_output/filter_1.txt b/scripts/code_coverage_source/test_output/filter_1.txt
index 186bfa5..46701cc 100644
--- a/scripts/code_coverage_source/test_output/filter_1.txt
+++ b/scripts/code_coverage_source/test_output/filter_1.txt
@@ -34,5 +34,14 @@
REQUIRE_THROWS_AS( throws(false), bool )
===============================================================================
-[doctest] test cases: 2 | 1 passed | 1 failed | 4 skipped
-[doctest] assertions: 53 | 46 passed | 7 failed |
+test.cpp(50)
+assertions - all of them
+
+test.cpp(113) FAILED!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+
+===============================================================================
+[doctest] test cases: 2 | 0 passed | 2 failed | 4 skipped
+[doctest] assertions: 53 | 45 passed | 8 failed |
diff --git a/scripts/code_coverage_source/test_output/filter_5.txt b/scripts/code_coverage_source/test_output/filter_5.txt
index 2488920..ceb5e91 100644
--- a/scripts/code_coverage_source/test_output/filter_5.txt
+++ b/scripts/code_coverage_source/test_output/filter_5.txt
@@ -34,11 +34,20 @@
REQUIRE_THROWS_AS( throws(false), bool )
===============================================================================
+test.cpp(50)
+assertions - all of them
+
+test.cpp(113) FAILED!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+
+===============================================================================
test.cpp(116)
throws
TEST CASE FAILED! (threw exception)
===============================================================================
-[doctest] test cases: 3 | 1 passed | 2 failed | 3 skipped
-[doctest] assertions: 53 | 46 passed | 7 failed |
+[doctest] test cases: 3 | 0 passed | 3 failed | 3 skipped
+[doctest] assertions: 53 | 45 passed | 8 failed |
diff --git a/scripts/code_coverage_source/test_output/first_last.txt b/scripts/code_coverage_source/test_output/first_last.txt
index 8d5c645..ef6253f 100644
--- a/scripts/code_coverage_source/test_output/first_last.txt
+++ b/scripts/code_coverage_source/test_output/first_last.txt
@@ -44,5 +44,14 @@
REQUIRE_THROWS_AS( throws(false), bool )
===============================================================================
-[doctest] test cases: 6 | 4 passed | 2 failed | 0 skipped
-[doctest] assertions: 59 | 51 passed | 8 failed |
+test.cpp(50)
+assertions - all of them
+
+test.cpp(113) FAILED!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+
+===============================================================================
+[doctest] test cases: 6 | 3 passed | 3 failed | 0 skipped
+[doctest] assertions: 59 | 50 passed | 9 failed |
diff --git a/scripts/code_coverage_source/test_output/order_1.txt b/scripts/code_coverage_source/test_output/order_1.txt
index 5f7f5a2..d6f0214 100644
--- a/scripts/code_coverage_source/test_output/order_1.txt
+++ b/scripts/code_coverage_source/test_output/order_1.txt
@@ -44,11 +44,20 @@
REQUIRE_THROWS_AS( throws(false), bool )
===============================================================================
+test.cpp(50)
+assertions - all of them
+
+test.cpp(113) FAILED!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+
+===============================================================================
test.cpp(116)
throws
TEST CASE FAILED! (threw exception)
===============================================================================
-[doctest] test cases: 6 | 3 passed | 3 failed | 0 skipped
-[doctest] assertions: 59 | 51 passed | 8 failed |
+[doctest] test cases: 6 | 2 passed | 4 failed | 0 skipped
+[doctest] assertions: 59 | 50 passed | 9 failed |
diff --git a/scripts/code_coverage_source/test_output/order_2.txt b/scripts/code_coverage_source/test_output/order_2.txt
index e422f55..abfdac5 100644
--- a/scripts/code_coverage_source/test_output/order_2.txt
+++ b/scripts/code_coverage_source/test_output/order_2.txt
@@ -34,6 +34,15 @@
REQUIRE_THROWS_AS( throws(false), bool )
===============================================================================
+test.cpp(50)
+assertions - all of them
+
+test.cpp(113) FAILED!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+with expansion:
+ FAST_REQUIRE_UNARY_FALSE( 1 )
+
+===============================================================================
test.cpp(6)
subcases
2
@@ -50,5 +59,5 @@
TEST CASE FAILED! (threw exception)
===============================================================================
-[doctest] test cases: 6 | 3 passed | 3 failed | 0 skipped
-[doctest] assertions: 59 | 51 passed | 8 failed |
+[doctest] test cases: 6 | 2 passed | 4 failed | 0 skipped
+[doctest] assertions: 59 | 50 passed | 9 failed |
diff --git a/scripts/code_coverage_source/test_output/successful.txt b/scripts/code_coverage_source/test_output/successful.txt
index bea9f57..b3b7704 100644
--- a/scripts/code_coverage_source/test_output/successful.txt
+++ b/scripts/code_coverage_source/test_output/successful.txt
@@ -357,10 +357,10 @@
with expansion:
FAST_CHECK_UNARY_FALSE( 0 )
-test.cpp(113) PASSED!
- FAST_REQUIRE_UNARY_FALSE( 0 )
+test.cpp(113) FAILED!
+ FAST_REQUIRE_UNARY_FALSE( 1 )
with expansion:
- FAST_REQUIRE_UNARY_FALSE( 0 )
+ FAST_REQUIRE_UNARY_FALSE( 1 )
===============================================================================
test.cpp(116)
@@ -369,5 +369,5 @@
TEST CASE FAILED! (threw exception)
===============================================================================
-[doctest] test cases: 4 | 1 passed | 3 failed | 2 skipped
-[doctest] assertions: 54 | 46 passed | 8 failed |
+[doctest] test cases: 4 | 0 passed | 4 failed | 2 skipped
+[doctest] assertions: 54 | 45 passed | 9 failed |