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

Tests for Eepicgeom. More...

#include <gtest/gtest.h>
#include <sstream>
#include <cmath>
#include <eepicgeom.H>
Include dependency graph for eepicgeom_test.cc:

Go to the source code of this file.

Classes

class  EepicPlaneTest
 
class  EepicPlaneWithObjectsTest
 
class  ExtremePointsTest
 
class  SegmentVariantsTest
 
class  ArrowEdgeCaseTest
 
class  PolygonVariantsTest
 
class  EllipseVariantsTest
 
class  TextVariantsTest
 
class  RegularPolygonTest
 
class  EepicOutputFormatTest
 
class  SquarizeModeTest
 
class  CartesianAxisTest
 
class  CoordinateTransformTest
 
class  ThickVariantsTest
 
class  ThickPolygonVariantsTest
 
class  EdgeCaseTest
 

Functions

bool approx_equal (double a, double b, double tol=EPSILON)
 
 TEST_F (EepicPlaneTest, DefaultConstruction)
 
 TEST_F (EepicPlaneTest, ConstructionWithOffset)
 
 TEST_F (EepicPlaneTest, ResolutionSettings)
 
 TEST_F (EepicPlaneTest, ShadeThicknessSettings)
 
 TEST_F (EepicPlaneTest, ZoomPositiveFactor)
 
 TEST_F (EepicPlaneTest, ZoomFractionalFactor)
 
 TEST_F (EepicPlaneTest, ZoomInvalidFactor)
 
 TEST_F (EepicPlaneWithObjectsTest, DISABLED_AddSinglePoint)
 
 TEST_F (EepicPlaneWithObjectsTest, AddTwoPoints)
 
 TEST_F (EepicPlaneWithObjectsTest, AddSegment)
 
 TEST_F (EepicPlaneWithObjectsTest, AddArrow)
 
 TEST_F (EepicPlaneWithObjectsTest, AddEllipse)
 
 TEST_F (EepicPlaneWithObjectsTest, AddPolygon)
 
 TEST_F (EepicPlaneWithObjectsTest, AddTriangle)
 
 TEST_F (EepicPlaneWithObjectsTest, AddText)
 
 TEST_F (EepicPlaneWithObjectsTest, MultipleObjects)
 
 TEST_F (ExtremePointsTest, DISABLED_SinglePointExtremes)
 
 TEST_F (ExtremePointsTest, SegmentExtremes)
 
 TEST_F (ExtremePointsTest, MultipleObjectsExtremes)
 
 TEST_F (SegmentVariantsTest, ThickSegment)
 
 TEST_F (SegmentVariantsTest, DottedSegment)
 
 TEST_F (SegmentVariantsTest, DashSegment)
 
 TEST_F (SegmentVariantsTest, DottedArrow)
 
 TEST_F (SegmentVariantsTest, DashArrow)
 
 TEST_F (ArrowEdgeCaseTest, DiagonalArrow)
 
 TEST_F (ArrowEdgeCaseTest, DISABLED_HorizontalArrow)
 
 TEST_F (ArrowEdgeCaseTest, NearHorizontalArrow)
 
 TEST_F (ArrowEdgeCaseTest, DISABLED_VerticalArrow)
 
 TEST_F (ArrowEdgeCaseTest, NearVerticalArrow)
 
 TEST_F (PolygonVariantsTest, ShadePolygon)
 
 TEST_F (PolygonVariantsTest, DottedPolygon)
 
 TEST_F (PolygonVariantsTest, DashPolygon)
 
 TEST_F (PolygonVariantsTest, PolygonWithPoints)
 
 TEST_F (PolygonVariantsTest, Spline)
 
 TEST_F (PolygonVariantsTest, SplineArrow)
 
 TEST_F (EllipseVariantsTest, NormalEllipse)
 
 TEST_F (EllipseVariantsTest, ThickEllipse)
 
 TEST_F (EllipseVariantsTest, ShadeEllipse)
 
 TEST_F (EllipseVariantsTest, CircularEllipse)
 
 TEST_F (TextVariantsTest, LeftText)
 
 TEST_F (TextVariantsTest, RightText)
 
 TEST_F (TextVariantsTest, CenterText)
 
 TEST_F (TextVariantsTest, TextWithSpecialCharacters)
 
 TEST_F (RegularPolygonTest, RegularTriangle)
 
 TEST_F (RegularPolygonTest, RegularSquare)
 
 TEST_F (RegularPolygonTest, RegularHexagon)
 
 TEST_F (EepicOutputFormatTest, UnitLengthSetting)
 
 TEST_F (EepicOutputFormatTest, FillTypeSetting)
 
 TEST_F (EepicOutputFormatTest, PictureEnvironment)
 
 TEST_F (EepicOutputFormatTest, ThinLinesReset)
 
 TEST_F (EepicOutputFormatTest, ExtremePointsComments)
 
 TEST_F (SquarizeModeTest, DrawWithSquarize)
 
 TEST_F (SquarizeModeTest, DrawWithoutSquarize)
 
 TEST_F (CartesianAxisTest, WithCartesianAxis)
 
 TEST_F (CoordinateTransformTest, PointString)
 
 TEST_F (CoordinateTransformTest, HGeomNumberToEepic)
 
 TEST_F (CoordinateTransformTest, VGeomNumberToEepic)
 
 TEST (EepicPolymorphismTest, DISABLED_PointInPlane)
 
 TEST (EepicPolymorphismTest, SegmentInPlane)
 
 TEST (EepicPolymorphismTest, EllipseInPlane)
 
 TEST_F (ThickVariantsTest, ThickDashSegment)
 
 TEST_F (ThickVariantsTest, ThickArrow)
 
 TEST_F (ThickVariantsTest, ThickDashArrow)
 
 TEST_F (ThickPolygonVariantsTest, ThickSpline)
 
 TEST_F (ThickPolygonVariantsTest, ThickDashSpline)
 
 TEST_F (ThickPolygonVariantsTest, ThickShadePolygon)
 
 TEST_F (EdgeCaseTest, VerySmallCoordinates)
 
 TEST_F (EdgeCaseTest, VeryLargeCoordinates)
 
 TEST_F (EdgeCaseTest, NegativeCoordinates)
 
 TEST_F (EdgeCaseTest, DISABLED_ZeroLengthSegment)
 
 TEST_F (EdgeCaseTest, DISABLED_SingleVertexPolygon)
 
 TEST_F (EdgeCaseTest, TwoVertexPolygon)
 
 TEST (MemoryTest, PlaneDestruction)
 
 TEST (MemoryTest, DISABLED_MultipleDrawCalls)
 
 TEST (MemoryTest, MultipleDrawCallsWithSegment)
 
 TEST (IntegrationTest, ComplexDiagram)
 
 TEST (IntegrationTest, GraphStyleDiagram)
 
int main (int argc, char **argv)
 

Variables

bool tiny_keys = false
 Global flag to enable tiny font size for keys/labels.
 
constexpr double EPSILON = 1e-6
 

Detailed Description

Tests for Eepicgeom.

Comprehensive test suite for eepicgeom.H - EEPIC LaTeX drawing utilities.

Tests cover:

Definition in file eepicgeom_test.cc.

Function Documentation

◆ approx_equal()

bool approx_equal ( double  a,
double  b,
double  tol = EPSILON 
)

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1488 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST() [1/8]

TEST ( EepicPolymorphismTest  ,
DISABLED_PointInPlane   
)

◆ TEST() [2/8]

TEST ( EepicPolymorphismTest  ,
EllipseInPlane   
)

◆ TEST() [3/8]

TEST ( EepicPolymorphismTest  ,
SegmentInPlane   
)

◆ TEST() [4/8]

TEST ( IntegrationTest  ,
ComplexDiagram   
)

◆ TEST() [5/8]

TEST ( IntegrationTest  ,
GraphStyleDiagram   
)

Definition at line 1445 of file eepicgeom_test.cc.

References Eepic_Plane::draw(), Aleph::maps(), output, and put_in_plane().

◆ TEST() [6/8]

TEST ( MemoryTest  ,
DISABLED_MultipleDrawCalls   
)

Definition at line 1359 of file eepicgeom_test.cc.

References Eepic_Plane::draw(), Aleph::maps(), output, and put_in_plane().

◆ TEST() [7/8]

TEST ( MemoryTest  ,
MultipleDrawCallsWithSegment   
)

Definition at line 1376 of file eepicgeom_test.cc.

References Eepic_Plane::draw(), Aleph::maps(), output, and put_in_plane().

◆ TEST() [8/8]

TEST ( MemoryTest  ,
PlaneDestruction   
)

Definition at line 1336 of file eepicgeom_test.cc.

References Eepic_Plane::draw(), Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [1/69]

TEST_F ( ArrowEdgeCaseTest  ,
DiagonalArrow   
)

Definition at line 467 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [2/69]

TEST_F ( ArrowEdgeCaseTest  ,
DISABLED_HorizontalArrow   
)

Definition at line 484 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [3/69]

TEST_F ( ArrowEdgeCaseTest  ,
DISABLED_VerticalArrow   
)

Definition at line 519 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [4/69]

TEST_F ( ArrowEdgeCaseTest  ,
NearHorizontalArrow   
)

Definition at line 500 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [5/69]

TEST_F ( ArrowEdgeCaseTest  ,
NearVerticalArrow   
)

Definition at line 538 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [6/69]

TEST_F ( CartesianAxisTest  ,
WithCartesianAxis   
)

Definition at line 995 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [7/69]

TEST_F ( CoordinateTransformTest  ,
HGeomNumberToEepic   
)

Definition at line 1047 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST_F() [8/69]

TEST_F ( CoordinateTransformTest  ,
PointString   
)

Definition at line 1036 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST_F() [9/69]

TEST_F ( CoordinateTransformTest  ,
VGeomNumberToEepic   
)

Definition at line 1056 of file eepicgeom_test.cc.

References Aleph::maps(), and y.

◆ TEST_F() [10/69]

TEST_F ( EdgeCaseTest  ,
DISABLED_SingleVertexPolygon   
)

Definition at line 1302 of file eepicgeom_test.cc.

References Polygon::add_vertex(), Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [11/69]

TEST_F ( EdgeCaseTest  ,
DISABLED_ZeroLengthSegment   
)

Definition at line 1288 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [12/69]

TEST_F ( EdgeCaseTest  ,
NegativeCoordinates   
)

Definition at line 1274 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [13/69]

TEST_F ( EdgeCaseTest  ,
TwoVertexPolygon   
)

Definition at line 1317 of file eepicgeom_test.cc.

References Polygon::add_vertex(), Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [14/69]

TEST_F ( EdgeCaseTest  ,
VeryLargeCoordinates   
)

Definition at line 1261 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [15/69]

TEST_F ( EdgeCaseTest  ,
VerySmallCoordinates   
)

Definition at line 1248 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [16/69]

TEST_F ( EepicOutputFormatTest  ,
ExtremePointsComments   
)

Definition at line 918 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [17/69]

TEST_F ( EepicOutputFormatTest  ,
FillTypeSetting   
)

Definition at line 867 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [18/69]

TEST_F ( EepicOutputFormatTest  ,
PictureEnvironment   
)

Definition at line 882 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [19/69]

TEST_F ( EepicOutputFormatTest  ,
ThinLinesReset   
)

Definition at line 903 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [20/69]

TEST_F ( EepicOutputFormatTest  ,
UnitLengthSetting   
)

Definition at line 852 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [21/69]

TEST_F ( EepicPlaneTest  ,
ConstructionWithOffset   
)

Definition at line 97 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST_F() [22/69]

TEST_F ( EepicPlaneTest  ,
DefaultConstruction   
)

Definition at line 89 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST_F() [23/69]

TEST_F ( EepicPlaneTest  ,
ResolutionSettings   
)

Definition at line 105 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST_F() [24/69]

TEST_F ( EepicPlaneTest  ,
ShadeThicknessSettings   
)

Definition at line 114 of file eepicgeom_test.cc.

References Aleph::maps().

◆ TEST_F() [25/69]

TEST_F ( EepicPlaneTest  ,
ZoomFractionalFactor   
)

◆ TEST_F() [26/69]

TEST_F ( EepicPlaneTest  ,
ZoomInvalidFactor   
)

Definition at line 140 of file eepicgeom_test.cc.

References Aleph::maps(), and Eepic_Plane::zoom().

◆ TEST_F() [27/69]

TEST_F ( EepicPlaneTest  ,
ZoomPositiveFactor   
)

◆ TEST_F() [28/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddArrow   
)

Definition at line 209 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [29/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddEllipse   
)

Definition at line 224 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [30/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddPolygon   
)

◆ TEST_F() [31/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddSegment   
)

Definition at line 195 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [32/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddText   
)

Definition at line 271 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [33/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddTriangle   
)

Definition at line 255 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [34/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddTwoPoints   
)

Definition at line 179 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [35/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
DISABLED_AddSinglePoint   
)

Definition at line 164 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [36/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
MultipleObjects   
)

Definition at line 287 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [37/69]

TEST_F ( EllipseVariantsTest  ,
CircularEllipse   
)

Definition at line 700 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [38/69]

TEST_F ( EllipseVariantsTest  ,
NormalEllipse   
)

Definition at line 663 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [39/69]

TEST_F ( EllipseVariantsTest  ,
ShadeEllipse   
)

Definition at line 688 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [40/69]

TEST_F ( EllipseVariantsTest  ,
ThickEllipse   
)

Definition at line 675 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [41/69]

TEST_F ( ExtremePointsTest  ,
DISABLED_SinglePointExtremes   
)

Definition at line 323 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [42/69]

TEST_F ( ExtremePointsTest  ,
MultipleObjectsExtremes   
)

Definition at line 355 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [43/69]

TEST_F ( ExtremePointsTest  ,
SegmentExtremes   
)

Definition at line 339 of file eepicgeom_test.cc.

References Point::get_x(), Point::get_y(), Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [44/69]

TEST_F ( PolygonVariantsTest  ,
DashPolygon   
)

Definition at line 597 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [45/69]

TEST_F ( PolygonVariantsTest  ,
DottedPolygon   
)

Definition at line 585 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [46/69]

TEST_F ( PolygonVariantsTest  ,
PolygonWithPoints   
)

Definition at line 609 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [47/69]

TEST_F ( PolygonVariantsTest  ,
ShadePolygon   
)

Definition at line 573 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [48/69]

TEST_F ( PolygonVariantsTest  ,
Spline   
)

Definition at line 622 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [49/69]

TEST_F ( PolygonVariantsTest  ,
SplineArrow   
)

Definition at line 634 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [50/69]

TEST_F ( RegularPolygonTest  ,
RegularHexagon   
)

Definition at line 824 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [51/69]

TEST_F ( RegularPolygonTest  ,
RegularSquare   
)

Definition at line 811 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [52/69]

TEST_F ( RegularPolygonTest  ,
RegularTriangle   
)

Definition at line 798 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [53/69]

TEST_F ( SegmentVariantsTest  ,
DashArrow   
)

Definition at line 440 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [54/69]

TEST_F ( SegmentVariantsTest  ,
DashSegment   
)

Definition at line 414 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [55/69]

TEST_F ( SegmentVariantsTest  ,
DottedArrow   
)

Definition at line 426 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [56/69]

TEST_F ( SegmentVariantsTest  ,
DottedSegment   
)

Definition at line 402 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [57/69]

TEST_F ( SegmentVariantsTest  ,
ThickSegment   
)

Definition at line 390 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [58/69]

TEST_F ( SquarizeModeTest  ,
DrawWithoutSquarize   
)

Definition at line 966 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [59/69]

TEST_F ( SquarizeModeTest  ,
DrawWithSquarize   
)

Definition at line 952 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [60/69]

TEST_F ( TextVariantsTest  ,
CenterText   
)

Definition at line 756 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [61/69]

TEST_F ( TextVariantsTest  ,
LeftText   
)

Definition at line 732 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [62/69]

TEST_F ( TextVariantsTest  ,
RightText   
)

Definition at line 744 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [63/69]

TEST_F ( TextVariantsTest  ,
TextWithSpecialCharacters   
)

Definition at line 768 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [64/69]

TEST_F ( ThickPolygonVariantsTest  ,
ThickDashSpline   
)

Definition at line 1213 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [65/69]

TEST_F ( ThickPolygonVariantsTest  ,
ThickShadePolygon   
)

Definition at line 1225 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [66/69]

TEST_F ( ThickPolygonVariantsTest  ,
ThickSpline   
)

Definition at line 1200 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [67/69]

TEST_F ( ThickVariantsTest  ,
ThickArrow   
)

Definition at line 1153 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [68/69]

TEST_F ( ThickVariantsTest  ,
ThickDashArrow   
)

Definition at line 1165 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

◆ TEST_F() [69/69]

TEST_F ( ThickVariantsTest  ,
ThickDashSegment   
)

Definition at line 1140 of file eepicgeom_test.cc.

References Aleph::maps(), output, and put_in_plane().

Variable Documentation

◆ EPSILON

constexpr double EPSILON = 1e-6
constexpr

Definition at line 64 of file eepicgeom_test.cc.

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

◆ tiny_keys

bool tiny_keys = false

Global flag to enable tiny font size for keys/labels.

When set to true, text labels will be rendered using LaTeX's \tiny font size modifier. Useful for dense diagrams with many labels.

Definition at line 59 of file eepicgeom_test.cc.