Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
polygon_test.cc File Reference

Comprehensive test suite for polygon.H - 2D polygon operations. More...

#include <gtest/gtest.h>
#include <cmath>
#include <limits>
#include <vector>
#include <polygon.H>
Include dependency graph for polygon_test.cc:

Go to the source code of this file.

Classes

class  VertexTest
 
class  PolygonConstructionTest
 
class  PolygonExtremePointsTest
 
class  PolygonVertexAccessTest
 
class  PolygonSegmentAccessTest
 
class  PolygonVertexIteratorTest
 
class  PolygonSegmentIteratorTest
 
class  PolygonIntersectionTest
 
class  PolygonSelfIntersectionTest
 
class  PolygonColinearityTest
 
class  PolygonContainmentTest
 
class  PolygonRemoveVertexTest
 
class  PolygonFromTriangleTest
 
class  RegularPolygonConstructionTest
 
class  RegularPolygonVertexTest
 
class  RegularPolygonSegmentTest
 
class  RegularPolygonVertexIteratorTest
 
class  RegularPolygonSegmentIteratorTest
 
class  RegularPolygonExtremePointsTest
 
class  RegularPolygonRotationTest
 
class  PolygonFromRegularTest
 

Functions

bool approx_equal (const Geom_Number &a, const Geom_Number &b, double tol=EPSILON)
 
bool points_equal (const Point &a, const Point &b, double tol=EPSILON)
 
 TEST_F (VertexTest, DefaultConstruction)
 
 TEST_F (VertexTest, ConstructFromPoint)
 
 TEST_F (VertexTest, CopyConstruction)
 
 TEST_F (VertexTest, CopyAssignment)
 
 TEST_F (VertexTest, SelfAssignment)
 
 TEST_F (VertexTest, ToPointReturnsCorrectPointValue)
 
 TEST_F (VertexTest, DlinkToVertexConversion)
 
 TEST_F (VertexTest, DlinkToVertexConstConversion)
 
 TEST_F (PolygonConstructionTest, DefaultConstruction)
 
 TEST_F (PolygonConstructionTest, AddSingleVertex)
 
 TEST_F (PolygonConstructionTest, AddMultipleVertices)
 
 TEST_F (PolygonConstructionTest, ClosePolygon)
 
 TEST_F (PolygonConstructionTest, CloseWithTooFewVerticesThrows)
 
 TEST_F (PolygonConstructionTest, CannotAddVertexToClosedPolygon)
 
 TEST_F (PolygonConstructionTest, CannotCloseAlreadyClosedPolygon)
 
 TEST_F (PolygonConstructionTest, CopyConstruction)
 
 TEST_F (PolygonConstructionTest, MoveConstruction)
 
 TEST_F (PolygonConstructionTest, CopyAssignment)
 
 TEST_F (PolygonConstructionTest, MoveAssignment)
 
 TEST_F (PolygonConstructionTest, SelfCopyAssignment)
 
 TEST_F (PolygonConstructionTest, AddVertexWithCoordinates)
 
 TEST_F (PolygonExtremePointsTest, ExtremePointsSingleVertex)
 
 TEST_F (PolygonExtremePointsTest, ExtremePointsMultipleVertices)
 
 TEST_F (PolygonExtremePointsTest, NegativeCoordinates)
 
 TEST_F (PolygonVertexAccessTest, GetFirstVertex)
 
 TEST_F (PolygonVertexAccessTest, GetLastVertex)
 
 TEST_F (PolygonVertexAccessTest, GetFirstVertexEmptyPolygonThrows)
 
 TEST_F (PolygonVertexAccessTest, GetLastVertexEmptyPolygonThrows)
 
 TEST_F (PolygonVertexAccessTest, VertexBelongsToPolygon)
 
 TEST_F (PolygonVertexAccessTest, VertexDoesNotBelongToPolygon)
 
 TEST_F (PolygonVertexAccessTest, GetNextVertex)
 
 TEST_F (PolygonVertexAccessTest, GetPrevVertex)
 
 TEST_F (PolygonSegmentAccessTest, GetFirstSegment)
 
 TEST_F (PolygonSegmentAccessTest, GetLastSegment)
 
 TEST_F (PolygonSegmentAccessTest, GetFirstSegmentSingleVertexThrows)
 
 TEST_F (PolygonSegmentAccessTest, GetFirstSegmentEmptyPolygonThrows)
 
 TEST_F (PolygonVertexIteratorTest, IterateAllVertices)
 
 TEST_F (PolygonVertexIteratorTest, GetCurrentVertex)
 
 TEST_F (PolygonVertexIteratorTest, EmptyPolygonThrows)
 
 TEST_F (PolygonSegmentIteratorTest, OpenPolygonIteratesNMinus1Segments)
 
 TEST_F (PolygonSegmentIteratorTest, ClosedPolygonIteratesNSegments)
 
 TEST_F (PolygonSegmentIteratorTest, GetCurrentSegment)
 
 TEST_F (PolygonSegmentIteratorTest, EmptyPolygonThrows)
 
 TEST_F (PolygonSegmentIteratorTest, SingleVertexPolygonThrows)
 
 TEST_F (PolygonIntersectionTest, SegmentIntersectsPolygon)
 
 TEST_F (PolygonIntersectionTest, SegmentDoesNotIntersectPolygon)
 
 TEST_F (PolygonIntersectionTest, SegmentInsidePolygon)
 
 TEST_F (PolygonSelfIntersectionTest, ValidPolygonConstruction)
 
 TEST_F (PolygonSelfIntersectionTest, SelfIntersectingVertexThrows)
 
 TEST_F (PolygonSelfIntersectionTest, SelfIntersectingAddVertexThrows)
 
 TEST_F (PolygonColinearityTest, ColinearPointExtendsEdge)
 
 TEST_F (PolygonColinearityTest, PointInsideLastSegmentThrows)
 
 TEST_F (PolygonContainmentTest, PointInsidePolygon)
 
 TEST_F (PolygonContainmentTest, PointOutsidePolygon)
 
 TEST_F (PolygonContainmentTest, PointNearEdge)
 
 TEST_F (PolygonContainmentTest, OpenPolygonContainmentThrows)
 
 TEST_F (PolygonRemoveVertexTest, RemoveExistingVertex)
 
 TEST_F (PolygonRemoveVertexTest, RemoveNonExistingVertexThrows)
 
 TEST_F (PolygonFromTriangleTest, ConstructFromTriangle)
 
 TEST_F (PolygonFromTriangleTest, CorrectVerticesFromTriangle)
 
 TEST_F (RegularPolygonConstructionTest, DefaultConstruction)
 
 TEST_F (RegularPolygonConstructionTest, ConstructTriangle)
 
 TEST_F (RegularPolygonConstructionTest, ConstructSquare)
 
 TEST_F (RegularPolygonConstructionTest, ConstructHexagon)
 
 TEST_F (RegularPolygonConstructionTest, LessThanThreeSidesThrows)
 
 TEST_F (RegularPolygonConstructionTest, InvalidSideLengthAndAngleThrow)
 
 TEST_F (RegularPolygonConstructionTest, RadiusCalculation)
 
 TEST_F (RegularPolygonVertexTest, GetVertexInRange)
 
 TEST_F (RegularPolygonVertexTest, GetVertexOutOfRangeThrows)
 
 TEST_F (RegularPolygonVertexTest, GetFirstVertex)
 
 TEST_F (RegularPolygonVertexTest, GetLastVertex)
 
 TEST_F (RegularPolygonVertexTest, VerticesAreEquidistantFromCenter)
 
 TEST_F (RegularPolygonSegmentTest, GetFirstSegment)
 
 TEST_F (RegularPolygonSegmentTest, GetLastSegment)
 
 TEST_F (RegularPolygonSegmentTest, AllSidesEqualLength)
 
 TEST_F (RegularPolygonVertexIteratorTest, IterateAllVertices)
 
 TEST_F (RegularPolygonVertexIteratorTest, GetCurrentVertex)
 
 TEST_F (RegularPolygonVertexIteratorTest, NextWithoutCurrent)
 
 TEST_F (RegularPolygonVertexIteratorTest, GetCurrentVertexWithoutCurrent)
 
 TEST_F (RegularPolygonSegmentIteratorTest, IterateAllSegments)
 
 TEST_F (RegularPolygonSegmentIteratorTest, GetCurrentSegment)
 
 TEST_F (RegularPolygonSegmentIteratorTest, NextWithoutCurrent)
 
 TEST_F (RegularPolygonSegmentIteratorTest, GetCurrentSegmentWithoutCurrent)
 
 TEST_F (RegularPolygonExtremePointsTest, LowestPoint)
 
 TEST_F (RegularPolygonExtremePointsTest, HighestPoint)
 
 TEST_F (RegularPolygonExtremePointsTest, LeftmostPoint)
 
 TEST_F (RegularPolygonExtremePointsTest, RightmostPoint)
 
 TEST_F (RegularPolygonRotationTest, NoRotation)
 
 TEST_F (RegularPolygonRotationTest, RotationChangesVertexPositions)
 
 TEST_F (RegularPolygonRotationTest, AllVerticesAtSameRadiusAfterRotation)
 
 TEST_F (PolygonFromRegularTest, ConstructFromRegularPolygon)
 
 TEST_F (PolygonFromRegularTest, AssignFromRegularPolygon)
 
 TEST_F (PolygonFromRegularTest, VerticesMatch)
 
 TEST (PolygonTypeTraits, MoveConstructorIsNoexcept)
 
 TEST (PolygonTypeTraits, MoveAssignmentIsNoexcept)
 
 TEST (PolygonEdgeCases, PolygonWithManyVertices)
 
 TEST (PolygonEdgeCases, RegularPolygonWithManyVertices)
 
 TEST (PolygonEdgeCases, VerySmallPolygon)
 
 TEST (PolygonEdgeCases, NegativeCoordinatesPolygon)
 
 TEST (PolygonConvenienceMethods, AreaOfUnitSquare)
 
 TEST (PolygonConvenienceMethods, AreaOfClockwiseSquare)
 
 TEST (PolygonConvenienceMethods, AreaOfTriangle)
 
 TEST (PolygonConvenienceMethods, PerimeterOfUnitSquare)
 
 TEST (PolygonConvenienceMethods, PerimeterOf345Triangle)
 
 TEST (PolygonConvenienceMethods, CentroidOfUnitSquare)
 
 TEST (PolygonConvenienceMethods, CentroidOfTriangle)
 
 TEST (PolygonConvenienceMethods, IsConvexSquare)
 
 TEST (PolygonConvenienceMethods, IsConvexTriangle)
 
 TEST (PolygonConvenienceMethods, NonConvexLShape)
 
 TEST (PolygonConvenienceMethods, AreaThrowsForTooFewVertices)
 
 TEST (PolygonConvenienceMethods, PerimeterThrowsForSingleVertex)
 
 TEST (PolygonConvenienceMethods, CentroidThrowsForTooFewVertices)
 
 TEST (PolygonConvenienceMethods, IsConvexThrowsForTooFewVertices)
 
int main (int argc, char **argv)
 

Variables

constexpr double EPSILON = 1e-6
 

Detailed Description

Comprehensive test suite for polygon.H - 2D polygon operations.

Tests cover:

  • Vertex class: construction, assignment, navigation
  • Polygon class: construction, vertex management, iterators, self-intersection prevention, containment testing
  • Regular_Polygon class: construction, vertex computation, iterators
  • Edge cases: empty polygons, single vertices, colinearity
  • Move semantics and copy operations

Definition in file polygon_test.cc.

Function Documentation

◆ approx_equal()

bool approx_equal ( const Geom_Number &  a,
const Geom_Number &  b,
double  tol = EPSILON 
)

Definition at line 58 of file polygon_test.cc.

References __gmp_expr< mpq_t, mpq_t >::get_d().

Referenced by points_equal(), and TEST_F().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1487 of file polygon_test.cc.

◆ points_equal()

bool points_equal ( const Point &  a,
const Point &  b,
double  tol = EPSILON 
)

◆ TEST() [1/20]

TEST ( PolygonConvenienceMethods  ,
AreaOfClockwiseSquare   
)

◆ TEST() [2/20]

TEST ( PolygonConvenienceMethods  ,
AreaOfTriangle   
)

◆ TEST() [3/20]

TEST ( PolygonConvenienceMethods  ,
AreaOfUnitSquare   
)

◆ TEST() [4/20]

TEST ( PolygonConvenienceMethods  ,
AreaThrowsForTooFewVertices   
)

Definition at line 1448 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::area().

◆ TEST() [5/20]

TEST ( PolygonConvenienceMethods  ,
CentroidOfTriangle   
)

◆ TEST() [6/20]

TEST ( PolygonConvenienceMethods  ,
CentroidOfUnitSquare   
)

◆ TEST() [7/20]

TEST ( PolygonConvenienceMethods  ,
CentroidThrowsForTooFewVertices   
)

Definition at line 1465 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::centroid().

◆ TEST() [8/20]

TEST ( PolygonConvenienceMethods  ,
IsConvexSquare   
)

◆ TEST() [9/20]

TEST ( PolygonConvenienceMethods  ,
IsConvexThrowsForTooFewVertices   
)

Definition at line 1474 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::is_convex().

◆ TEST() [10/20]

TEST ( PolygonConvenienceMethods  ,
IsConvexTriangle   
)

◆ TEST() [11/20]

TEST ( PolygonConvenienceMethods  ,
NonConvexLShape   
)

◆ TEST() [12/20]

TEST ( PolygonConvenienceMethods  ,
PerimeterOf345Triangle   
)

◆ TEST() [13/20]

TEST ( PolygonConvenienceMethods  ,
PerimeterOfUnitSquare   
)

◆ TEST() [14/20]

TEST ( PolygonConvenienceMethods  ,
PerimeterThrowsForSingleVertex   
)

Definition at line 1457 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::perimeter().

◆ TEST() [15/20]

TEST ( PolygonEdgeCases  ,
NegativeCoordinatesPolygon   
)

◆ TEST() [16/20]

TEST ( PolygonEdgeCases  ,
PolygonWithManyVertices   
)

◆ TEST() [17/20]

◆ TEST() [18/20]

TEST ( PolygonEdgeCases  ,
VerySmallPolygon   
)

◆ TEST() [19/20]

TEST ( PolygonTypeTraits  ,
MoveAssignmentIsNoexcept   
)

Definition at line 1243 of file polygon_test.cc.

◆ TEST() [20/20]

TEST ( PolygonTypeTraits  ,
MoveConstructorIsNoexcept   
)

Definition at line 1238 of file polygon_test.cc.

◆ TEST_F() [1/93]

TEST_F ( PolygonColinearityTest  ,
ColinearPointExtendsEdge   
)

Definition at line 676 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::size().

◆ TEST_F() [2/93]

TEST_F ( PolygonColinearityTest  ,
PointInsideLastSegmentThrows   
)

Definition at line 687 of file polygon_test.cc.

References Aleph::Polygon::add_vertex().

◆ TEST_F() [3/93]

TEST_F ( PolygonConstructionTest  ,
AddMultipleVertices   
)

◆ TEST_F() [4/93]

TEST_F ( PolygonConstructionTest  ,
AddSingleVertex   
)

◆ TEST_F() [5/93]

◆ TEST_F() [6/93]

TEST_F ( PolygonConstructionTest  ,
CannotAddVertexToClosedPolygon   
)

Definition at line 238 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and create_triangle().

◆ TEST_F() [7/93]

TEST_F ( PolygonConstructionTest  ,
CannotCloseAlreadyClosedPolygon   
)

Definition at line 245 of file polygon_test.cc.

References Aleph::Polygon::close(), and create_triangle().

◆ TEST_F() [8/93]

TEST_F ( PolygonConstructionTest  ,
ClosePolygon   
)

◆ TEST_F() [9/93]

TEST_F ( PolygonConstructionTest  ,
CloseWithTooFewVerticesThrows   
)

Definition at line 223 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::close().

◆ TEST_F() [10/93]

TEST_F ( PolygonConstructionTest  ,
CopyAssignment   
)

◆ TEST_F() [11/93]

◆ TEST_F() [12/93]

TEST_F ( PolygonConstructionTest  ,
DefaultConstruction   
)

Definition at line 188 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [13/93]

TEST_F ( PolygonConstructionTest  ,
MoveAssignment   
)

Definition at line 285 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [14/93]

TEST_F ( PolygonConstructionTest  ,
MoveConstruction   
)

Definition at line 262 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [15/93]

TEST_F ( PolygonConstructionTest  ,
SelfCopyAssignment   
)

Definition at line 297 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [16/93]

TEST_F ( PolygonContainmentTest  ,
OpenPolygonContainmentThrows   
)

Definition at line 735 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::contains().

◆ TEST_F() [17/93]

TEST_F ( PolygonContainmentTest  ,
PointInsidePolygon   
)

Definition at line 717 of file polygon_test.cc.

◆ TEST_F() [18/93]

TEST_F ( PolygonContainmentTest  ,
PointNearEdge   
)

Definition at line 729 of file polygon_test.cc.

◆ TEST_F() [19/93]

TEST_F ( PolygonContainmentTest  ,
PointOutsidePolygon   
)

Definition at line 723 of file polygon_test.cc.

◆ TEST_F() [20/93]

◆ TEST_F() [21/93]

◆ TEST_F() [22/93]

◆ TEST_F() [23/93]

TEST_F ( PolygonFromRegularTest  ,
AssignFromRegularPolygon   
)

Definition at line 1205 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [24/93]

TEST_F ( PolygonFromRegularTest  ,
ConstructFromRegularPolygon   
)

Definition at line 1196 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [25/93]

◆ TEST_F() [26/93]

TEST_F ( PolygonFromTriangleTest  ,
ConstructFromTriangle   
)

Definition at line 783 of file polygon_test.cc.

References Aleph::Polygon::is_closed(), and Aleph::Polygon::size().

◆ TEST_F() [27/93]

TEST_F ( PolygonFromTriangleTest  ,
CorrectVerticesFromTriangle   
)

◆ TEST_F() [28/93]

TEST_F ( PolygonIntersectionTest  ,
SegmentDoesNotIntersectPolygon   
)

Definition at line 612 of file polygon_test.cc.

◆ TEST_F() [29/93]

TEST_F ( PolygonIntersectionTest  ,
SegmentInsidePolygon   
)

Definition at line 618 of file polygon_test.cc.

◆ TEST_F() [30/93]

TEST_F ( PolygonIntersectionTest  ,
SegmentIntersectsPolygon   
)

Definition at line 606 of file polygon_test.cc.

◆ TEST_F() [31/93]

TEST_F ( PolygonRemoveVertexTest  ,
RemoveExistingVertex   
)

Definition at line 763 of file polygon_test.cc.

◆ TEST_F() [32/93]

TEST_F ( PolygonRemoveVertexTest  ,
RemoveNonExistingVertexThrows   
)

Definition at line 771 of file polygon_test.cc.

◆ TEST_F() [33/93]

TEST_F ( PolygonSegmentAccessTest  ,
GetFirstSegment   
)

◆ TEST_F() [34/93]

TEST_F ( PolygonSegmentAccessTest  ,
GetFirstSegmentEmptyPolygonThrows   
)

Definition at line 477 of file polygon_test.cc.

References Aleph::Polygon::get_first_segment().

◆ TEST_F() [35/93]

TEST_F ( PolygonSegmentAccessTest  ,
GetFirstSegmentSingleVertexThrows   
)

◆ TEST_F() [36/93]

TEST_F ( PolygonSegmentAccessTest  ,
GetLastSegment   
)

Definition at line 461 of file polygon_test.cc.

References points_equal().

◆ TEST_F() [37/93]

TEST_F ( PolygonSegmentIteratorTest  ,
ClosedPolygonIteratesNSegments   
)

◆ TEST_F() [38/93]

TEST_F ( PolygonSegmentIteratorTest  ,
EmptyPolygonThrows   
)

Definition at line 573 of file polygon_test.cc.

◆ TEST_F() [39/93]

◆ TEST_F() [40/93]

TEST_F ( PolygonSegmentIteratorTest  ,
OpenPolygonIteratesNMinus1Segments   
)

◆ TEST_F() [41/93]

TEST_F ( PolygonSegmentIteratorTest  ,
SingleVertexPolygonThrows   
)

Definition at line 579 of file polygon_test.cc.

References Aleph::Polygon::add_vertex().

◆ TEST_F() [42/93]

TEST_F ( PolygonSelfIntersectionTest  ,
SelfIntersectingAddVertexThrows   
)

Definition at line 654 of file polygon_test.cc.

References Aleph::Polygon::add_vertex().

◆ TEST_F() [43/93]

TEST_F ( PolygonSelfIntersectionTest  ,
SelfIntersectingVertexThrows   
)

Definition at line 642 of file polygon_test.cc.

References Aleph::Polygon::add_vertex().

◆ TEST_F() [44/93]

TEST_F ( PolygonSelfIntersectionTest  ,
ValidPolygonConstruction   
)

Definition at line 630 of file polygon_test.cc.

References Aleph::Polygon::add_vertex(), and Aleph::Polygon::close().

◆ TEST_F() [45/93]

TEST_F ( PolygonVertexAccessTest  ,
GetFirstVertex   
)

Definition at line 380 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [46/93]

TEST_F ( PolygonVertexAccessTest  ,
GetFirstVertexEmptyPolygonThrows   
)

Definition at line 394 of file polygon_test.cc.

References Aleph::Polygon::get_first_vertex().

◆ TEST_F() [47/93]

TEST_F ( PolygonVertexAccessTest  ,
GetLastVertex   
)

Definition at line 387 of file polygon_test.cc.

◆ TEST_F() [48/93]

TEST_F ( PolygonVertexAccessTest  ,
GetLastVertexEmptyPolygonThrows   
)

Definition at line 400 of file polygon_test.cc.

References Aleph::Polygon::get_last_vertex().

◆ TEST_F() [49/93]

TEST_F ( PolygonVertexAccessTest  ,
GetNextVertex   
)

Definition at line 418 of file polygon_test.cc.

References Aleph::next().

◆ TEST_F() [50/93]

TEST_F ( PolygonVertexAccessTest  ,
GetPrevVertex   
)

Definition at line 427 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [51/93]

TEST_F ( PolygonVertexAccessTest  ,
VertexBelongsToPolygon   
)

Definition at line 406 of file polygon_test.cc.

◆ TEST_F() [52/93]

TEST_F ( PolygonVertexAccessTest  ,
VertexDoesNotBelongToPolygon   
)

Definition at line 412 of file polygon_test.cc.

◆ TEST_F() [53/93]

TEST_F ( PolygonVertexIteratorTest  ,
EmptyPolygonThrows   
)

Definition at line 519 of file polygon_test.cc.

◆ TEST_F() [54/93]

◆ TEST_F() [55/93]

TEST_F ( PolygonVertexIteratorTest  ,
IterateAllVertices   
)

Definition at line 501 of file polygon_test.cc.

References Aleph::count(), and Aleph::Dlink::Iterator::has_curr().

◆ TEST_F() [56/93]

TEST_F ( RegularPolygonConstructionTest  ,
ConstructHexagon   
)

◆ TEST_F() [57/93]

TEST_F ( RegularPolygonConstructionTest  ,
ConstructSquare   
)

◆ TEST_F() [58/93]

◆ TEST_F() [59/93]

◆ TEST_F() [60/93]

TEST_F ( RegularPolygonConstructionTest  ,
InvalidSideLengthAndAngleThrow   
)

Definition at line 854 of file polygon_test.cc.

◆ TEST_F() [61/93]

TEST_F ( RegularPolygonConstructionTest  ,
LessThanThreeSidesThrows   
)

Definition at line 847 of file polygon_test.cc.

◆ TEST_F() [62/93]

TEST_F ( RegularPolygonConstructionTest  ,
RadiusCalculation   
)

Definition at line 869 of file polygon_test.cc.

References EPSILON, and Aleph::Regular_Polygon::radius().

◆ TEST_F() [63/93]

TEST_F ( RegularPolygonExtremePointsTest  ,
HighestPoint   
)

Definition at line 1118 of file polygon_test.cc.

References Aleph::Point::highest_point(), points_equal(), and r.

◆ TEST_F() [64/93]

TEST_F ( RegularPolygonExtremePointsTest  ,
LeftmostPoint   
)

Definition at line 1127 of file polygon_test.cc.

References Aleph::Point::leftmost_point(), points_equal(), and r.

◆ TEST_F() [65/93]

TEST_F ( RegularPolygonExtremePointsTest  ,
LowestPoint   
)

Definition at line 1109 of file polygon_test.cc.

References Aleph::Point::lowest_point(), points_equal(), and r.

◆ TEST_F() [66/93]

TEST_F ( RegularPolygonExtremePointsTest  ,
RightmostPoint   
)

Definition at line 1136 of file polygon_test.cc.

References points_equal(), r, and Aleph::Point::rightmost_point().

◆ TEST_F() [67/93]

◆ TEST_F() [68/93]

◆ TEST_F() [69/93]

TEST_F ( RegularPolygonRotationTest  ,
RotationChangesVertexPositions   
)

◆ TEST_F() [70/93]

◆ TEST_F() [71/93]

◆ TEST_F() [72/93]

TEST_F ( RegularPolygonSegmentIteratorTest  ,
IterateAllSegments   
)

◆ TEST_F() [73/93]

◆ TEST_F() [74/93]

TEST_F ( RegularPolygonSegmentTest  ,
AllSidesEqualLength   
)

◆ TEST_F() [75/93]

TEST_F ( RegularPolygonSegmentTest  ,
GetFirstSegment   
)

◆ TEST_F() [76/93]

TEST_F ( RegularPolygonSegmentTest  ,
GetLastSegment   
)

Definition at line 962 of file polygon_test.cc.

References points_equal().

◆ TEST_F() [77/93]

TEST_F ( RegularPolygonVertexIteratorTest  ,
GetCurrentVertex   
)

◆ TEST_F() [78/93]

◆ TEST_F() [79/93]

TEST_F ( RegularPolygonVertexIteratorTest  ,
IterateAllVertices   
)

◆ TEST_F() [80/93]

◆ TEST_F() [81/93]

TEST_F ( RegularPolygonVertexTest  ,
GetFirstVertex   
)

Definition at line 904 of file polygon_test.cc.

References points_equal().

◆ TEST_F() [82/93]

TEST_F ( RegularPolygonVertexTest  ,
GetLastVertex   
)

Definition at line 912 of file polygon_test.cc.

References points_equal().

◆ TEST_F() [83/93]

TEST_F ( RegularPolygonVertexTest  ,
GetVertexInRange   
)

Definition at line 892 of file polygon_test.cc.

◆ TEST_F() [84/93]

TEST_F ( RegularPolygonVertexTest  ,
GetVertexOutOfRangeThrows   
)

Definition at line 898 of file polygon_test.cc.

◆ TEST_F() [85/93]

TEST_F ( RegularPolygonVertexTest  ,
VerticesAreEquidistantFromCenter   
)

◆ TEST_F() [86/93]

TEST_F ( VertexTest  ,
ConstructFromPoint   
)

Definition at line 94 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [87/93]

TEST_F ( VertexTest  ,
CopyAssignment   
)

Definition at line 110 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [88/93]

TEST_F ( VertexTest  ,
CopyConstruction   
)

Definition at line 101 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [89/93]

TEST_F ( VertexTest  ,
DefaultConstruction   
)

Definition at line 87 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [90/93]

TEST_F ( VertexTest  ,
DlinkToVertexConstConversion   
)

Definition at line 149 of file polygon_test.cc.

References Aleph::Vertex::dlink_to_vertex(), and Aleph::Point::get_x().

◆ TEST_F() [91/93]

TEST_F ( VertexTest  ,
DlinkToVertexConversion   
)

Definition at line 139 of file polygon_test.cc.

References Aleph::Vertex::dlink_to_vertex(), and Aleph::Point::get_x().

◆ TEST_F() [92/93]

TEST_F ( VertexTest  ,
SelfAssignment   
)

Definition at line 121 of file polygon_test.cc.

References Aleph::Point::get_x(), and Aleph::Point::get_y().

◆ TEST_F() [93/93]

TEST_F ( VertexTest  ,
ToPointReturnsCorrectPointValue   
)

Variable Documentation

◆ EPSILON

constexpr double EPSILON = 1e-6
constexpr

Definition at line 55 of file polygon_test.cc.

Referenced by TEST_F(), TEST_F(), TEST_F(), and TEST_F().