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

Comprehensive test suite for eepicgeom.H - EEPIC LaTeX drawing utilities. 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, 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, 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, HorizontalArrow)
 
 TEST_F (ArrowEdgeCaseTest, NearHorizontalArrow)
 
 TEST_F (ArrowEdgeCaseTest, 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, 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, ZeroLengthSegment)
 
 TEST_F (EdgeCaseTest, SingleVertexPolygon)
 
 TEST_F (EdgeCaseTest, TwoVertexPolygon)
 
 TEST (MemoryTest, PlaneDestruction)
 
 TEST (MemoryTest, 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

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 1471 of file eepicgeom_test.cc.

◆ TEST() [1/8]

◆ TEST() [2/8]

TEST ( EepicPolymorphismTest  ,
PointInPlane   
)

◆ TEST() [3/8]

TEST ( EepicPolymorphismTest  ,
SegmentInPlane   
)

◆ TEST() [4/8]

TEST ( IntegrationTest  ,
ComplexDiagram   
)

◆ TEST() [5/8]

TEST ( IntegrationTest  ,
GraphStyleDiagram   
)

Definition at line 1428 of file eepicgeom_test.cc.

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

◆ TEST() [6/8]

TEST ( MemoryTest  ,
MultipleDrawCalls   
)

Definition at line 1342 of file eepicgeom_test.cc.

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

◆ TEST() [7/8]

TEST ( MemoryTest  ,
MultipleDrawCallsWithSegment   
)

Definition at line 1359 of file eepicgeom_test.cc.

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

◆ TEST() [8/8]

TEST ( MemoryTest  ,
PlaneDestruction   
)

Definition at line 1320 of file eepicgeom_test.cc.

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

◆ TEST_F() [1/69]

TEST_F ( ArrowEdgeCaseTest  ,
DiagonalArrow   
)

Definition at line 459 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [2/69]

TEST_F ( ArrowEdgeCaseTest  ,
HorizontalArrow   
)

Definition at line 476 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [3/69]

TEST_F ( ArrowEdgeCaseTest  ,
NearHorizontalArrow   
)

Definition at line 492 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [4/69]

TEST_F ( ArrowEdgeCaseTest  ,
NearVerticalArrow   
)

Definition at line 525 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [5/69]

TEST_F ( ArrowEdgeCaseTest  ,
VerticalArrow   
)

Definition at line 508 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [6/69]

TEST_F ( CartesianAxisTest  ,
WithCartesianAxis   
)

Definition at line 982 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [7/69]

TEST_F ( CoordinateTransformTest  ,
HGeomNumberToEepic   
)

Definition at line 1034 of file eepicgeom_test.cc.

◆ TEST_F() [8/69]

TEST_F ( CoordinateTransformTest  ,
PointString   
)

Definition at line 1023 of file eepicgeom_test.cc.

◆ TEST_F() [9/69]

TEST_F ( CoordinateTransformTest  ,
VGeomNumberToEepic   
)

Definition at line 1043 of file eepicgeom_test.cc.

References y.

◆ TEST_F() [10/69]

TEST_F ( EdgeCaseTest  ,
NegativeCoordinates   
)

Definition at line 1261 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [11/69]

TEST_F ( EdgeCaseTest  ,
SingleVertexPolygon   
)

Definition at line 1287 of file eepicgeom_test.cc.

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

◆ TEST_F() [12/69]

TEST_F ( EdgeCaseTest  ,
TwoVertexPolygon   
)

Definition at line 1301 of file eepicgeom_test.cc.

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

◆ TEST_F() [13/69]

TEST_F ( EdgeCaseTest  ,
VeryLargeCoordinates   
)

Definition at line 1248 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [14/69]

TEST_F ( EdgeCaseTest  ,
VerySmallCoordinates   
)

Definition at line 1235 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [15/69]

TEST_F ( EdgeCaseTest  ,
ZeroLengthSegment   
)

Definition at line 1275 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [16/69]

TEST_F ( EepicOutputFormatTest  ,
ExtremePointsComments   
)

Definition at line 905 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [17/69]

TEST_F ( EepicOutputFormatTest  ,
FillTypeSetting   
)

Definition at line 854 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [18/69]

TEST_F ( EepicOutputFormatTest  ,
PictureEnvironment   
)

Definition at line 869 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [19/69]

TEST_F ( EepicOutputFormatTest  ,
ThinLinesReset   
)

Definition at line 890 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [20/69]

TEST_F ( EepicOutputFormatTest  ,
UnitLengthSetting   
)

Definition at line 839 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [21/69]

TEST_F ( EepicPlaneTest  ,
ConstructionWithOffset   
)

Definition at line 92 of file eepicgeom_test.cc.

◆ TEST_F() [22/69]

TEST_F ( EepicPlaneTest  ,
DefaultConstruction   
)

Definition at line 84 of file eepicgeom_test.cc.

◆ TEST_F() [23/69]

TEST_F ( EepicPlaneTest  ,
ResolutionSettings   
)

Definition at line 100 of file eepicgeom_test.cc.

◆ TEST_F() [24/69]

TEST_F ( EepicPlaneTest  ,
ShadeThicknessSettings   
)

Definition at line 109 of file eepicgeom_test.cc.

◆ TEST_F() [25/69]

TEST_F ( EepicPlaneTest  ,
ZoomFractionalFactor   
)

◆ TEST_F() [26/69]

TEST_F ( EepicPlaneTest  ,
ZoomInvalidFactor   
)

Definition at line 135 of file eepicgeom_test.cc.

References Eepic_Plane::zoom().

◆ TEST_F() [27/69]

TEST_F ( EepicPlaneTest  ,
ZoomPositiveFactor   
)

◆ TEST_F() [28/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddArrow   
)

Definition at line 201 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [29/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddEllipse   
)

Definition at line 216 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [30/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddPolygon   
)

◆ TEST_F() [31/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddSegment   
)

Definition at line 187 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [32/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddSinglePoint   
)

Definition at line 157 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [33/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddText   
)

Definition at line 263 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [34/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddTriangle   
)

Definition at line 247 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [35/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
AddTwoPoints   
)

Definition at line 171 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [36/69]

TEST_F ( EepicPlaneWithObjectsTest  ,
MultipleObjects   
)

Definition at line 279 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [37/69]

TEST_F ( EllipseVariantsTest  ,
CircularEllipse   
)

Definition at line 687 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [38/69]

TEST_F ( EllipseVariantsTest  ,
NormalEllipse   
)

Definition at line 650 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [39/69]

TEST_F ( EllipseVariantsTest  ,
ShadeEllipse   
)

Definition at line 675 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [40/69]

TEST_F ( EllipseVariantsTest  ,
ThickEllipse   
)

Definition at line 662 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [41/69]

TEST_F ( ExtremePointsTest  ,
MultipleObjectsExtremes   
)

Definition at line 347 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [42/69]

TEST_F ( ExtremePointsTest  ,
SegmentExtremes   
)

◆ TEST_F() [43/69]

TEST_F ( ExtremePointsTest  ,
SinglePointExtremes   
)

Definition at line 315 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [44/69]

TEST_F ( PolygonVariantsTest  ,
DashPolygon   
)

Definition at line 584 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [45/69]

TEST_F ( PolygonVariantsTest  ,
DottedPolygon   
)

Definition at line 572 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [46/69]

TEST_F ( PolygonVariantsTest  ,
PolygonWithPoints   
)

Definition at line 596 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [47/69]

TEST_F ( PolygonVariantsTest  ,
ShadePolygon   
)

Definition at line 560 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [48/69]

TEST_F ( PolygonVariantsTest  ,
Spline   
)

Definition at line 609 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [49/69]

TEST_F ( PolygonVariantsTest  ,
SplineArrow   
)

Definition at line 621 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [50/69]

TEST_F ( RegularPolygonTest  ,
RegularHexagon   
)

Definition at line 811 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [51/69]

TEST_F ( RegularPolygonTest  ,
RegularSquare   
)

Definition at line 798 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [52/69]

TEST_F ( RegularPolygonTest  ,
RegularTriangle   
)

Definition at line 785 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [53/69]

TEST_F ( SegmentVariantsTest  ,
DashArrow   
)

Definition at line 432 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [54/69]

TEST_F ( SegmentVariantsTest  ,
DashSegment   
)

Definition at line 406 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [55/69]

TEST_F ( SegmentVariantsTest  ,
DottedArrow   
)

Definition at line 418 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [56/69]

TEST_F ( SegmentVariantsTest  ,
DottedSegment   
)

Definition at line 394 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [57/69]

TEST_F ( SegmentVariantsTest  ,
ThickSegment   
)

Definition at line 382 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [58/69]

TEST_F ( SquarizeModeTest  ,
DrawWithoutSquarize   
)

Definition at line 953 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [59/69]

TEST_F ( SquarizeModeTest  ,
DrawWithSquarize   
)

Definition at line 939 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [60/69]

TEST_F ( TextVariantsTest  ,
CenterText   
)

Definition at line 743 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [61/69]

TEST_F ( TextVariantsTest  ,
LeftText   
)

Definition at line 719 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [62/69]

TEST_F ( TextVariantsTest  ,
RightText   
)

Definition at line 731 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [63/69]

TEST_F ( TextVariantsTest  ,
TextWithSpecialCharacters   
)

Definition at line 755 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [64/69]

TEST_F ( ThickPolygonVariantsTest  ,
ThickDashSpline   
)

Definition at line 1200 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [65/69]

TEST_F ( ThickPolygonVariantsTest  ,
ThickShadePolygon   
)

Definition at line 1212 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [66/69]

TEST_F ( ThickPolygonVariantsTest  ,
ThickSpline   
)

Definition at line 1187 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [67/69]

TEST_F ( ThickVariantsTest  ,
ThickArrow   
)

Definition at line 1140 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [68/69]

TEST_F ( ThickVariantsTest  ,
ThickDashArrow   
)

Definition at line 1152 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

◆ TEST_F() [69/69]

TEST_F ( ThickVariantsTest  ,
ThickDashSegment   
)

Definition at line 1127 of file eepicgeom_test.cc.

References output, and Aleph::put_in_plane().

Variable Documentation

◆ EPSILON

constexpr double EPSILON = 1e-6
constexpr

Definition at line 59 of file eepicgeom_test.cc.

Referenced by 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 54 of file eepicgeom_test.cc.