1 #ifndef __DELTATEST_H
2 #define __DELTATEST_H
4 #include <cxxtest/TestSuite.h>
5 #include <math.h>
7 class DeltaTest : public CxxTest::TestSuite
8 {
9 double _pi, _delta;
11 public:
12 void setUp()
13 {
14 _pi = 3.1415926535;
15 _delta = 0.0001;
16 }
18 void testSine()
19 {
20 TS_ASSERT_DELTA( sin(0.0), 0.0, _delta );
21 TS_ASSERT_DELTA( sin(_pi / 6), 0.5, _delta );
22 TS_ASSERT_DELTA( sin(_pi / 2), 1.0, _delta );
23 TS_ASSERT_DELTA( sin(_pi), 0.0, _delta );
24 }
25 };
27 #endif // __DELTATEST_H