~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/bFTGL/test/FTTesselation-Test.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <cppunit/extensions/HelperMacros.h>
 
2
#include <cppunit/TestCaller.h>
 
3
#include <cppunit/TestCase.h>
 
4
#include <cppunit/TestSuite.h>
 
5
 
 
6
#include "FTVectoriser.h"
 
7
 
 
8
 
 
9
class FTTesselationTest : public CppUnit::TestCase
 
10
{
 
11
    CPPUNIT_TEST_SUITE( FTTesselationTest);
 
12
        CPPUNIT_TEST( testAddPoint);
 
13
        CPPUNIT_TEST( testGetPoint);
 
14
    CPPUNIT_TEST_SUITE_END();
 
15
        
 
16
    public:
 
17
        FTTesselationTest() : CppUnit::TestCase( "FTTesselation Test")
 
18
        {}
 
19
        
 
20
        FTTesselationTest( const std::string& name) : CppUnit::TestCase(name)
 
21
        {}
 
22
 
 
23
        void testAddPoint()
 
24
        {
 
25
            FTTesselation tesselation( 1);
 
26
            
 
27
            CPPUNIT_ASSERT( tesselation.PointCount() == 0);
 
28
            
 
29
            tesselation.AddPoint(  10, 3, 0.7);
 
30
            tesselation.AddPoint( -53, 2000, 23);
 
31
            tesselation.AddPoint(  77, -2.4, 765);
 
32
            tesselation.AddPoint( 117.5,  0.02, -99);
 
33
 
 
34
            CPPUNIT_ASSERT( tesselation.PointCount() == 4);
 
35
            
 
36
            tesselation.AddPoint(  10, 3, -0.87);
 
37
            tesselation.AddPoint( 117.5, 0.02, 34.76);
 
38
            tesselation.AddPoint(   0.27, 44.4, 3000);
 
39
            tesselation.AddPoint(  10, 3, 0);
 
40
 
 
41
            CPPUNIT_ASSERT( tesselation.PointCount() == 8);
 
42
        }
 
43
        
 
44
        
 
45
        void testGetPoint()
 
46
        {
 
47
            FTTesselation tesselation(1);
 
48
            
 
49
            CPPUNIT_ASSERT( tesselation.PointCount() == 0);
 
50
            
 
51
            tesselation.AddPoint(  10, 3, 0.7);
 
52
            tesselation.AddPoint( -53, 2000, 23);
 
53
            tesselation.AddPoint(  77, -2.4, 765);
 
54
            tesselation.AddPoint( 117.5,  0.02, -99);
 
55
 
 
56
            CPPUNIT_ASSERT( tesselation.PointCount() == 4);
 
57
            CPPUNIT_ASSERT( tesselation.Point(2) == FTPoint( 77, -2.4, 765));
 
58
            CPPUNIT_ASSERT( tesselation.Point(20) != FTPoint( 77, -2.4, 765));
 
59
        }
 
60
        
 
61
        
 
62
        void setUp() 
 
63
        {}
 
64
        
 
65
        
 
66
        void tearDown() 
 
67
        {}
 
68
        
 
69
    private:
 
70
};
 
71
 
 
72
CPPUNIT_TEST_SUITE_REGISTRATION( FTTesselationTest);
 
73