2 EasyUnit : Simple C++ Unit testing framework
3 Copyright (C) 2004 Barthelemy Dagenais
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 barthelemy@prologique.com
23 #include "testresult.h"
26 TestResult::TestResult()
31 TestResult::~TestResult()
35 int TestResult::getTotalSuccesses() const
37 return totalSuccesses_
;
40 int TestResult::getTotalErrors() const
45 int TestResult::getTotalFailures() const
47 return totalFailures_
;
51 int TestResult::getSuccesses() const
56 int TestResult::getFailures() const
61 int TestResult::getErrors() const
66 int TestResult::getTestCaseCount() const
68 return testCaseCount_
;
71 int TestResult::getTestRanCount() const
76 int TestResult::getTestCaseRanCount() const
78 return testCaseRanCount_
;
81 TestCase
* TestResult::getTestCases() const
86 void TestResult::setTestCases(TestCase
*testCases
, int testCaseCount
)
88 testCases_
= testCases
;
89 testCaseCount_
= testCaseCount
;
92 void TestResult::addResult(TestCase
*testCase
)
94 int tcSuccesses
= testCase
->getSuccessesCount();
95 int tcErrors
= testCase
->getErrorsCount();
96 int tcFailures
= testCase
->getFailuresCount();
100 totalSuccesses_
+= tcSuccesses
;
101 totalErrors_
+= tcErrors
;
102 totalFailures_
+= tcFailures
;
103 testRanCount_
+= testCase
->getTestsCount();
105 if (tcErrors
== 0 && tcFailures
== 0) {
108 else if (tcErrors
> 0) {