Commit 92c8b17e authored by Stefan Philips's avatar Stefan Philips

[ADD] Test for mean function

[ADD] Test for median function
parent 81f11b36
......@@ -643,6 +643,30 @@ public:
ss << val;
TS_ASSERT_EQUALS( ss.str(), expected );
}
/**
* Test the mean calculation.
*/
void testMean( void )
{
WValue< double > val( 3 );
val[0] = 1.0;
val[1] = 2.0;
val[2] = 3.0;
TS_ASSERT_EQUALS( val.mean(), 2.0 );
}
/**
* Test the median calculation.
*/
void testMedian( void )
{
WValue< double > val( 3 );
val[0] = 1.0;
val[1] = 2.0;
val[2] = 3.0;
TS_ASSERT_EQUALS( val.mean(), 2.0 );
}
};
#endif // WVALUE_TEST_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment