~sharpie/geos/3.3.2

« back to all changes in this revision

Viewing changes to tests/unit/algorithm/CGAlgorithms/isPointInRingTest.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-03-27 15:54:54 UTC
  • mfrom: (1.2.1 upstream) (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090327155454-o3u9j86rzrtcp5vl
Tags: 3.1.0-1
* New upstream release.
* This version includes also a missing header inclusion, which caused FTBFS
  on armel. (Closes: #520447)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: isPointInRingTest.cpp 1820 2006-09-06 16:54:23Z mloskot $
 
1
// $Id: isPointInRingTest.cpp 2184 2008-09-16 20:13:55Z mloskot $
2
2
// 
3
3
// Test Suite for CGAlgorithms::isPointInRing() function
4
4
 
5
 
// TUT
6
 
#include <tut.h>
7
 
// STL
8
 
#include <string>
9
5
// GEOS
10
6
#include <geos/algorithm/CGAlgorithms.h>
11
7
#include <geos/geom/Polygon.h>
 
8
#include <geos/geom/Geometry.h>
 
9
#include <geos/geom/CoordinateSequence.h>
12
10
#include <geos/geom/Coordinate.h>
13
 
#include <geos/geom/Geometry.h>
14
11
#include <geos/io/WKTReader.h>
 
12
// TUT
 
13
#include <tut.h>
 
14
// STL
 
15
#include <string>
 
16
#include <cassert>
15
17
 
16
18
using namespace geos::algorithm;
17
19
 
25
27
    {
26
28
            typedef std::auto_ptr<geos::geom::Geometry> GeomPtr;
27
29
 
 
30
        geos::geom::CoordinateSequence* cs_;
28
31
        geos::io::WKTReader reader_;
29
 
 
30
 
        test_ispointinring_data() {}
 
32
        
 
33
        test_ispointinring_data()
 
34
            : cs_(0)
 
35
        {
 
36
            assert(0 == cs_);
 
37
        }
 
38
        
 
39
        ~test_ispointinring_data()
 
40
        {
 
41
            delete cs_;
 
42
            cs_ = 0;
 
43
        }
31
44
    };
32
45
 
33
46
    typedef test_group<test_ispointinring_data> group;
49
62
 
50
63
        geos::geom::Coordinate pt(10, 10);
51
64
 
52
 
        bool isInRing = CGAlgorithms::isPointInRing(pt, geom->getCoordinates());
 
65
        cs_ = geom->getCoordinates();
 
66
        bool isInRing = CGAlgorithms::isPointInRing(pt, cs_);
53
67
 
54
68
        ensure_equals( true, isInRing );
55
69
    }
66
80
 
67
81
        geos::geom::Coordinate pt(0, 0);
68
82
 
69
 
        bool isInRing = CGAlgorithms::isPointInRing(pt, geom->getCoordinates());
 
83
        cs_ = geom->getCoordinates();
 
84
        bool isInRing = CGAlgorithms::isPointInRing(pt, cs_);
70
85
 
71
86
        ensure_equals( true, isInRing );
72
87
    }
73
88
 
74
 
 
75
89
} // namespace tut
 
90