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

Comprehensive unit tests for line.H. More...

#include <gtest/gtest.h>
#include <cmath>
#include <line.H>
Include dependency graph for line_test.cc:

Go to the source code of this file.

Classes

class  LineConstructorTest
 
class  LineEvaluationTest
 
class  LinePropertyTest
 
class  LineIntersectionTest
 
class  LinePerpendicularTest
 
class  LineDistanceTest
 
class  LineContainsTest
 
class  LineEqualityTest
 
class  LineStringTest
 
class  LineEdgeCaseTest
 
class  LineConstexprTest
 
class  LineIntegrationTest
 

Functions

 TEST_F (LineConstructorTest, DefaultConstructor)
 
 TEST_F (LineConstructorTest, SlopeInterceptConstructor)
 
 TEST_F (LineConstructorTest, PointSlopeConstructor)
 
 TEST_F (LineConstructorTest, TwoPointConstructor)
 
 TEST_F (LineConstructorTest, TwoPointConstructorNegativeSlope)
 
 TEST_F (LineConstructorTest, TwoPointConstructorHorizontal)
 
 TEST_F (LineConstructorTest, TwoPointConstructorVerticalThrows)
 
 TEST_F (LineConstructorTest, TwoPointConstructorSamePointThrows)
 
 TEST_F (LineEvaluationTest, EvaluateAtZero)
 
 TEST_F (LineEvaluationTest, EvaluateAtPositive)
 
 TEST_F (LineEvaluationTest, EvaluateAtNegative)
 
 TEST_F (LineEvaluationTest, EvaluateHorizontalLine)
 
 TEST_F (LineEvaluationTest, XAtY)
 
 TEST_F (LineEvaluationTest, XAtYHorizontalThrows)
 
 TEST_F (LinePropertyTest, SlopeGetter)
 
 TEST_F (LinePropertyTest, YInterceptGetter)
 
 TEST_F (LinePropertyTest, IsHorizontal)
 
 TEST_F (LinePropertyTest, IsParallelTo)
 
 TEST_F (LinePropertyTest, IsPerpendicularTo)
 
 TEST_F (LineIntersectionTest, SimpleIntersection)
 
 TEST_F (LineIntersectionTest, IntersectionAtOrigin)
 
 TEST_F (LineIntersectionTest, IntersectionNegativeCoordinates)
 
 TEST_F (LineIntersectionTest, IntersectionWithHorizontal)
 
 TEST_F (LineIntersectionTest, ParallelLinesThrow)
 
 TEST_F (LineIntersectionTest, IdenticalLinesThrow)
 
 TEST_F (LinePerpendicularTest, PerpendicularThrough)
 
 TEST_F (LinePerpendicularTest, PerpendicularThroughOrigin)
 
 TEST_F (LinePerpendicularTest, PerpendicularToHorizontalThrows)
 
 TEST_F (LineDistanceTest, DistanceToPointOnLine)
 
 TEST_F (LineDistanceTest, DistanceToHorizontalLine)
 
 TEST_F (LineDistanceTest, DistanceToSlantedLine)
 
 TEST_F (LineContainsTest, ContainsPointOnLine)
 
 TEST_F (LineContainsTest, DoesNotContainPointOffLine)
 
 TEST_F (LineContainsTest, ContainsPointWithTolerance)
 
 TEST_F (LineEqualityTest, EqualLines)
 
 TEST_F (LineEqualityTest, NearlyEqualLines)
 
 TEST_F (LineEqualityTest, DifferentSlope)
 
 TEST_F (LineEqualityTest, DifferentIntercept)
 
 TEST_F (LineStringTest, ToString)
 
 TEST_F (LineStringTest, StreamOutput)
 
 TEST_F (LineEdgeCaseTest, VeryLargeSlope)
 
 TEST_F (LineEdgeCaseTest, VerySmallSlope)
 
 TEST_F (LineEdgeCaseTest, NegativeYIntercept)
 
 TEST_F (LineEdgeCaseTest, NegativeSlope)
 
 TEST_F (LineEdgeCaseTest, PointsInReverseOrder)
 
 TEST_F (LineConstexprTest, DefaultConstructorValues)
 
 TEST_F (LineConstexprTest, SlopeInterceptConstructorValues)
 
 TEST_F (LineConstexprTest, EvaluationValues)
 
 TEST (LineTypeTraits, NoDiscardAttribute)
 
 TEST_F (LineIntegrationTest, TriangleFromThreeLines)
 
 TEST_F (LineIntegrationTest, LineFromPointsAndIntersection)
 
 TEST_F (LineIntegrationTest, PerpendicularBisector)
 
int main (int argc, char **argv)
 

Detailed Description

Comprehensive unit tests for line.H.

Definition in file line_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 623 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp().

◆ TEST()

TEST ( LineTypeTraits  ,
NoDiscardAttribute   
)

◆ TEST_F() [1/51]

TEST_F ( LineConstexprTest  ,
DefaultConstructorValues   
)

◆ TEST_F() [2/51]

TEST_F ( LineConstexprTest  ,
EvaluationValues   
)

◆ TEST_F() [3/51]

TEST_F ( LineConstexprTest  ,
SlopeInterceptConstructorValues   
)

◆ TEST_F() [4/51]

TEST_F ( LineConstructorTest  ,
DefaultConstructor   
)

◆ TEST_F() [5/51]

◆ TEST_F() [6/51]

◆ TEST_F() [7/51]

◆ TEST_F() [8/51]

◆ TEST_F() [9/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorNegativeSlope   
)

◆ TEST_F() [10/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorSamePointThrows   
)

Definition at line 125 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp().

◆ TEST_F() [11/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorVerticalThrows   
)

Definition at line 119 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp().

◆ TEST_F() [12/51]

TEST_F ( LineContainsTest  ,
ContainsPointOnLine   
)

◆ TEST_F() [13/51]

TEST_F ( LineContainsTest  ,
ContainsPointWithTolerance   
)

◆ TEST_F() [14/51]

TEST_F ( LineContainsTest  ,
DoesNotContainPointOffLine   
)

◆ TEST_F() [15/51]

TEST_F ( LineDistanceTest  ,
DistanceToHorizontalLine   
)

◆ TEST_F() [16/51]

TEST_F ( LineDistanceTest  ,
DistanceToPointOnLine   
)

◆ TEST_F() [17/51]

TEST_F ( LineDistanceTest  ,
DistanceToSlantedLine   
)

◆ TEST_F() [18/51]

TEST_F ( LineEdgeCaseTest  ,
NegativeSlope   
)

◆ TEST_F() [19/51]

TEST_F ( LineEdgeCaseTest  ,
NegativeYIntercept   
)

◆ TEST_F() [20/51]

◆ TEST_F() [21/51]

TEST_F ( LineEdgeCaseTest  ,
VeryLargeSlope   
)

◆ TEST_F() [22/51]

TEST_F ( LineEdgeCaseTest  ,
VerySmallSlope   
)

◆ TEST_F() [23/51]

TEST_F ( LineEqualityTest  ,
DifferentIntercept   
)

Definition at line 434 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, and l2.

◆ TEST_F() [24/51]

TEST_F ( LineEqualityTest  ,
DifferentSlope   
)

Definition at line 425 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, and l2.

◆ TEST_F() [25/51]

TEST_F ( LineEqualityTest  ,
EqualLines   
)

Definition at line 408 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, and l2.

◆ TEST_F() [26/51]

TEST_F ( LineEqualityTest  ,
NearlyEqualLines   
)

Definition at line 417 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, and l2.

◆ TEST_F() [27/51]

TEST_F ( LineEvaluationTest  ,
EvaluateAtNegative   
)

◆ TEST_F() [28/51]

TEST_F ( LineEvaluationTest  ,
EvaluateAtPositive   
)

◆ TEST_F() [29/51]

TEST_F ( LineEvaluationTest  ,
EvaluateAtZero   
)

◆ TEST_F() [30/51]

TEST_F ( LineEvaluationTest  ,
EvaluateHorizontalLine   
)

◆ TEST_F() [31/51]

◆ TEST_F() [32/51]

TEST_F ( LineEvaluationTest  ,
XAtYHorizontalThrows   
)

◆ TEST_F() [33/51]

TEST_F ( LineIntegrationTest  ,
LineFromPointsAndIntersection   
)

◆ TEST_F() [34/51]

TEST_F ( LineIntegrationTest  ,
PerpendicularBisector   
)

◆ TEST_F() [35/51]

TEST_F ( LineIntegrationTest  ,
TriangleFromThreeLines   
)

◆ TEST_F() [36/51]

TEST_F ( LineIntersectionTest  ,
IdenticalLinesThrow   
)

Definition at line 291 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, and l2.

◆ TEST_F() [37/51]

TEST_F ( LineIntersectionTest  ,
IntersectionAtOrigin   
)

◆ TEST_F() [38/51]

TEST_F ( LineIntersectionTest  ,
IntersectionNegativeCoordinates   
)

◆ TEST_F() [39/51]

TEST_F ( LineIntersectionTest  ,
IntersectionWithHorizontal   
)

◆ TEST_F() [40/51]

TEST_F ( LineIntersectionTest  ,
ParallelLinesThrow   
)

Definition at line 283 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, and l2.

◆ TEST_F() [41/51]

TEST_F ( LineIntersectionTest  ,
SimpleIntersection   
)

◆ TEST_F() [42/51]

TEST_F ( LinePerpendicularTest  ,
PerpendicularThrough   
)

◆ TEST_F() [43/51]

TEST_F ( LinePerpendicularTest  ,
PerpendicularThroughOrigin   
)

◆ TEST_F() [44/51]

TEST_F ( LinePerpendicularTest  ,
PerpendicularToHorizontalThrows   
)

◆ TEST_F() [45/51]

TEST_F ( LinePropertyTest  ,
IsHorizontal   
)

◆ TEST_F() [46/51]

TEST_F ( LinePropertyTest  ,
IsParallelTo   
)

Definition at line 208 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, l2, and l3.

◆ TEST_F() [47/51]

TEST_F ( LinePropertyTest  ,
IsPerpendicularTo   
)

Definition at line 219 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp(), l1, l2, and l3.

◆ TEST_F() [48/51]

TEST_F ( LinePropertyTest  ,
SlopeGetter   
)

◆ TEST_F() [49/51]

TEST_F ( LinePropertyTest  ,
YInterceptGetter   
)

◆ TEST_F() [50/51]

TEST_F ( LineStringTest  ,
StreamOutput   
)

Definition at line 459 of file line_test.cc.

References Aleph::divide_and_conquer_partition_dp().

◆ TEST_F() [51/51]

TEST_F ( LineStringTest  ,
ToString   
)