Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_totals.cpp
Go to the documentation of this file.
1/*
2 * Created by Martin on 19/07/2017.
3 *
4 * Distributed under the Boost Software License, Version 1.0. (See accompanying
5 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 */
7
8#include "catch_totals.h"
9
10namespace Catch {
11
12 Counts Counts::operator - ( Counts const& other ) const {
14 diff.passed = passed - other.passed;
15 diff.failed = failed - other.failed;
16 diff.failedButOk = failedButOk - other.failedButOk;
17 return diff;
18 }
19
21 passed += other.passed;
22 failed += other.failed;
23 failedButOk += other.failedButOk;
24 return *this;
25 }
26
27 std::size_t Counts::total() const {
28 return passed + failed + failedButOk;
29 }
30 bool Counts::allPassed() const {
31 return failed == 0 && failedButOk == 0;
32 }
33 bool Counts::allOk() const {
34 return failed == 0;
35 }
36
37 Totals Totals::operator - ( Totals const& other ) const {
39 diff.assertions = assertions - other.assertions;
40 diff.testCases = testCases - other.testCases;
41 return diff;
42 }
43
45 assertions += other.assertions;
46 testCases += other.testCases;
47 return *this;
48 }
49
50 Totals Totals::delta( Totals const& prevTotals ) const {
51 Totals diff = *this - prevTotals;
52 if( diff.assertions.failed > 0 )
54 else if( diff.assertions.failedButOk > 0 )
55 ++diff.testCases.failedButOk;
56 else
57 ++diff.testCases.passed;
58 return diff;
59 }
60
61}
void diff(const std::string &a, const std::string &b)
Definition jmp.cpp:18
Counts & operator+=(Counts const &other)
std::size_t failed
bool allOk() const
bool allPassed() const
std::size_t total() const
Counts operator-(Counts const &other) const
std::size_t failedButOk
std::size_t passed
Totals delta(Totals const &prevTotals) const
Counts assertions
Totals operator-(Totals const &other) const
Totals & operator+=(Totals const &other)