1 #include "TestStatistics.h"
2 
TestStatistics()3 TestStatistics::TestStatistics()
4 {
5 }
6 
~TestStatistics()7 TestStatistics::~TestStatistics()
8 {
9 }
10 
run()11 void TestStatistics::run()
12 {
13   testAll();
14 }
15 
testAll()16 void TestStatistics::testAll()
17 {
18   std::vector<double> data;
19   data.push_back(20.48);
20   data.push_back(20.32);
21   data.push_back(20.57);
22   data.push_back(19.73);
23 
24   _test( closeEnough(Statistics::sum(data), 81.1, 0.0001));
25 
26   _test( closeEnough(Statistics::average(data), 20.275, 0.0001));
27 
28   _test( closeEnough(Statistics::sumOfSquares(data,20.275), 0.4281, 0.0001));
29 
30   std::cout << Statistics::sumOfSquares(data, 20.275) << std::endl;
31   _test( closeEnough(Statistics::variance(data), 0.1427, 0.0001));
32 
33 }
34