aboutsummaryrefslogtreecommitdiff
path: root/test/cxxtest/sample/DeltaTest.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/cxxtest/sample/DeltaTest.h')
-rw-r--r--test/cxxtest/sample/DeltaTest.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/cxxtest/sample/DeltaTest.h b/test/cxxtest/sample/DeltaTest.h
new file mode 100644
index 0000000000..7223c3af25
--- /dev/null
+++ b/test/cxxtest/sample/DeltaTest.h
@@ -0,0 +1,27 @@
+#ifndef __DELTATEST_H
+#define __DELTATEST_H
+
+#include <cxxtest/TestSuite.h>
+#include <math.h>
+
+class DeltaTest : public CxxTest::TestSuite
+{
+ double _pi, _delta;
+
+public:
+ void setUp()
+ {
+ _pi = 3.1415926535;
+ _delta = 0.0001;
+ }
+
+ void testSine()
+ {
+ TS_ASSERT_DELTA( sin(0.0), 0.0, _delta );
+ TS_ASSERT_DELTA( sin(_pi / 6), 0.5, _delta );
+ TS_ASSERT_DELTA( sin(_pi / 2), 1.0, _delta );
+ TS_ASSERT_DELTA( sin(_pi), 0.0, _delta );
+ }
+};
+
+#endif // __DELTATEST_H