~mc.../inkscape/inkscape

« back to all changes in this revision

Viewing changes to cxxtest/sample/DeltaTest.h

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __DELTATEST_H
 
2
#define __DELTATEST_H
 
3
 
 
4
#include <cxxtest/TestSuite.h>
 
5
#include <math.h>
 
6
 
 
7
class DeltaTest : public CxxTest::TestSuite
 
8
{
 
9
    double _pi, _delta;
 
10
    
 
11
public:
 
12
    void setUp()
 
13
    {
 
14
        _pi = 3.1415926535;
 
15
        _delta = 0.0001;
 
16
    }
 
17
 
 
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
};
 
26
 
 
27
#endif // __DELTATEST_H