From d709c0e783c4fd89382725ba3a468bce63362192 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 26 Oct 2020 15:34:23 +0100 Subject: Remove unneeded failed count variable. --- uunit.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/uunit.h b/uunit.h index c4c53ee..44dc2a0 100644 --- a/uunit.h +++ b/uunit.h @@ -59,7 +59,6 @@ public: static int runTests(std::ofstream& out) { std::size_t test_num{0}; - std::size_t failed{0}; std::list failed_tests; std::list successful_tests; @@ -83,7 +82,6 @@ public: result.func = test.name; result.failure_type = "Assertion"; failed_tests.push_back(result); - ++failed; continue; } catch(...) @@ -109,7 +107,6 @@ public: } result.failure_type = "Exception"; failed_tests.push_back(result); - ++failed; continue; } std::cout << "."; @@ -159,7 +156,7 @@ public: out << " " << std::endl; out << "" << std::endl; - return failed == 0 ? 0 : 1; + return failed_tests.size() == 0 ? 0 : 1; } protected: -- cgit v1.2.3