xmsgeom  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
geoms.t.h
Go to the documentation of this file.
1 #pragma once
2 #ifdef CXX_TEST
3 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
10 
11 // 3. Standard Library Headers
12 
13 // 4. External Library Headers
14 #include <cxxtest/TestSuite.h>
15 #pragma warning(push)
16 #pragma warning(disable : 4103) // boost code: alignment change
17 #include <boost/timer/timer.hpp> // boost::timer::cpu_timer
18 #pragma warning(pop)
19 
20 // 5. Shared Headers
21 #include <xmscore/points/ptsfwd.h>
23 
24 // 6. Non-shared Headers
25 
26 //----- Namespace declaration --------------------------------------------------
27 
28 // namespace xms {
29 
31 class GeomsXmsngUnitTests : public CxxTest::TestSuite
32 {
33 public:
36 
38 
39 }; // class GeomsXmsngUnitTests
40 
43 {
44 public:
46  void DoTest();
47 
48 protected:
49  // You must override these
52  virtual void CheckPoint(const xms::Pt3d& a_pt) = 0;
55  virtual double MaxTime() = 0;
56 
57  // You don't have to override these
58  virtual void Setup();
59  virtual void CheckPoints();
60  virtual void GetResults();
61 
62 protected:
63  std::vector<xms::Pt3d> m_outPoly;
64  std::vector<xms::Pt3d> m_inPoly;
65  boost::timer::cpu_timer m_timer;
66  int m_count;
67  int m_status;
68 
69 private:
71 }; // GmPointInPolyUnitTests
72 
74 class GeomsXmsngIntermediateTests : public CxxTest::TestSuite
75 {
76 public:
77 #ifndef CXXTEST4
78  virtual const CxxTest::TestGroup& group();
79 #endif
80 
82 };
83 
84 //} // namespace xms
85 
86 #endif
virtual void Setup()
Setup the polygons.
Definition: geoms.cpp:2190
Tests for functions in geoms.cpp.
Definition: geoms.t.h:31
virtual const CxxTest::TestGroup & group()
Defines the test group.
Definition: geoms.cpp:2401
virtual void GetResults()
Get the timer results and do some assertions.
Definition: geoms.cpp:2219
virtual double MaxTime()=0
virtual void CheckPoint(const xms::Pt3d &a_pt)=0
boost::timer::cpu_timer m_timer
Timer.
Definition: geoms.t.h:65
int m_status
Status (in, out, on) of at least one pt.
Definition: geoms.t.h:67
void DoTest()
Run the test. This is the main function to call.
Definition: geoms.cpp:2181
XM_DISALLOW_COPY_AND_ASSIGN(GmPointInPolyUnitTests)
Hide compiler generated copy and assign.
GmPointInPolyUnitTests()
constructor
Definition: geoms.cpp:2170
void test_gmPointInPolygon2D_Speed()
Test lots of points for timing purposes. Only in release, not debug.
Definition: geoms.cpp:2384
void test_gmComputePolygonCentroid()
Definition: geoms.cpp:2354
int m_count
Number of points checked.
Definition: geoms.t.h:66
std::vector< xms::Pt3d > m_inPoly
Input polygon.
Definition: geoms.t.h:64
virtual void CheckPoints()
Check a lot of points to see if they are in the polys.
Definition: geoms.cpp:2197
Used for speed tests of various point in poly functions / classes.
Definition: geoms.t.h:42
void test_gmComputeCentroid()
Definition: geoms.cpp:2327
std::vector< xms::Pt3d > m_outPoly
Output polygon.
Definition: geoms.t.h:63
Intermediate tests for functions in geoms.cpp.
Definition: geoms.t.h:74