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, ConstexprDefaultConstructor)
 
 TEST_F (LineConstexprTest, ConstexprSlopeInterceptConstructor)
 
 TEST_F (LineConstexprTest, ConstexprEvaluation)
 
 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 622 of file line_test.cc.

References Aleph::maps().

◆ TEST()

TEST ( LineTypeTraits  ,
NoDiscardAttribute   
)

◆ TEST_F() [1/51]

TEST_F ( LineConstexprTest  ,
ConstexprDefaultConstructor   
)

Definition at line 524 of file line_test.cc.

References Aleph::LineEq::m, and Aleph::LineEq::y0.

◆ TEST_F() [2/51]

TEST_F ( LineConstexprTest  ,
ConstexprEvaluation   
)

Definition at line 538 of file line_test.cc.

References y.

◆ TEST_F() [3/51]

TEST_F ( LineConstexprTest  ,
ConstexprSlopeInterceptConstructor   
)

Definition at line 531 of file line_test.cc.

References Aleph::LineEq::m, and Aleph::LineEq::y0.

◆ TEST_F() [4/51]

TEST_F ( LineConstructorTest  ,
DefaultConstructor   
)

Definition at line 49 of file line_test.cc.

References Aleph::LineEq::m, Aleph::maps(), and Aleph::LineEq::y0.

◆ TEST_F() [5/51]

TEST_F ( LineConstructorTest  ,
PointSlopeConstructor   
)

Definition at line 74 of file line_test.cc.

References Aleph::maps(), Aleph::LineEq::slope(), and Aleph::LineEq::y_intercept().

◆ TEST_F() [6/51]

TEST_F ( LineConstructorTest  ,
SlopeInterceptConstructor   
)

Definition at line 62 of file line_test.cc.

References Aleph::maps(), Aleph::LineEq::slope(), and Aleph::LineEq::y_intercept().

◆ TEST_F() [7/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructor   
)

Definition at line 87 of file line_test.cc.

References Aleph::maps(), Aleph::LineEq::slope(), and Aleph::LineEq::y_intercept().

◆ TEST_F() [8/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorHorizontal   
)

◆ TEST_F() [9/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorNegativeSlope   
)

Definition at line 100 of file line_test.cc.

References Aleph::maps(), Aleph::LineEq::slope(), and Aleph::LineEq::y_intercept().

◆ TEST_F() [10/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorSamePointThrows   
)

Definition at line 125 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [11/51]

TEST_F ( LineConstructorTest  ,
TwoPointConstructorVerticalThrows   
)

Definition at line 119 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [12/51]

TEST_F ( LineContainsTest  ,
ContainsPointOnLine   
)

Definition at line 376 of file line_test.cc.

References Aleph::LineEq::contains_point(), and Aleph::maps().

◆ TEST_F() [13/51]

TEST_F ( LineContainsTest  ,
ContainsPointWithTolerance   
)

Definition at line 393 of file line_test.cc.

References Aleph::LineEq::contains_point(), and Aleph::maps().

◆ TEST_F() [14/51]

TEST_F ( LineContainsTest  ,
DoesNotContainPointOffLine   
)

Definition at line 385 of file line_test.cc.

References Aleph::LineEq::contains_point(), and Aleph::maps().

◆ TEST_F() [15/51]

TEST_F ( LineDistanceTest  ,
DistanceToHorizontalLine   
)

Definition at line 349 of file line_test.cc.

References Aleph::LineEq::distance_to(), and Aleph::maps().

◆ TEST_F() [16/51]

TEST_F ( LineDistanceTest  ,
DistanceToPointOnLine   
)

Definition at line 341 of file line_test.cc.

References Aleph::LineEq::distance_to(), and Aleph::maps().

◆ TEST_F() [17/51]

TEST_F ( LineDistanceTest  ,
DistanceToSlantedLine   
)

Definition at line 360 of file line_test.cc.

References Aleph::LineEq::distance_to(), and Aleph::maps().

◆ TEST_F() [18/51]

TEST_F ( LineEdgeCaseTest  ,
NegativeSlope   
)

Definition at line 499 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [19/51]

TEST_F ( LineEdgeCaseTest  ,
NegativeYIntercept   
)

Definition at line 491 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [20/51]

TEST_F ( LineEdgeCaseTest  ,
PointsInReverseOrder   
)

Definition at line 508 of file line_test.cc.

References Aleph::maps(), Aleph::LineEq::slope(), and Aleph::LineEq::y_intercept().

◆ TEST_F() [21/51]

TEST_F ( LineEdgeCaseTest  ,
VeryLargeSlope   
)

Definition at line 475 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [22/51]

TEST_F ( LineEdgeCaseTest  ,
VerySmallSlope   
)

Definition at line 483 of file line_test.cc.

References Aleph::LineEq::is_horizontal(), and Aleph::maps().

◆ TEST_F() [23/51]

TEST_F ( LineEqualityTest  ,
DifferentIntercept   
)

Definition at line 434 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [24/51]

TEST_F ( LineEqualityTest  ,
DifferentSlope   
)

Definition at line 425 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [25/51]

TEST_F ( LineEqualityTest  ,
EqualLines   
)

Definition at line 408 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [26/51]

TEST_F ( LineEqualityTest  ,
NearlyEqualLines   
)

Definition at line 417 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [27/51]

TEST_F ( LineEvaluationTest  ,
EvaluateAtNegative   
)

Definition at line 150 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [28/51]

TEST_F ( LineEvaluationTest  ,
EvaluateAtPositive   
)

Definition at line 143 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [29/51]

TEST_F ( LineEvaluationTest  ,
EvaluateAtZero   
)

Definition at line 137 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [30/51]

TEST_F ( LineEvaluationTest  ,
EvaluateHorizontalLine   
)

Definition at line 157 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [31/51]

TEST_F ( LineEvaluationTest  ,
XAtY   
)

Definition at line 165 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::x_at().

◆ TEST_F() [32/51]

TEST_F ( LineEvaluationTest  ,
XAtYHorizontalThrows   
)

Definition at line 173 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::x_at().

◆ TEST_F() [33/51]

TEST_F ( LineIntegrationTest  ,
LineFromPointsAndIntersection   
)

Definition at line 585 of file line_test.cc.

References Aleph::LineEq::intersection(), Aleph::maps(), and y.

◆ TEST_F() [34/51]

TEST_F ( LineIntegrationTest  ,
PerpendicularBisector   
)

Definition at line 601 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [35/51]

TEST_F ( LineIntegrationTest  ,
TriangleFromThreeLines   
)

Definition at line 566 of file line_test.cc.

References Aleph::LineEq::intersection(), Aleph::maps(), and y1().

◆ TEST_F() [36/51]

TEST_F ( LineIntersectionTest  ,
IdenticalLinesThrow   
)

Definition at line 291 of file line_test.cc.

References Aleph::LineEq::intersection(), and Aleph::maps().

◆ TEST_F() [37/51]

TEST_F ( LineIntersectionTest  ,
IntersectionAtOrigin   
)

Definition at line 248 of file line_test.cc.

References Aleph::LineEq::intersection(), Aleph::maps(), and y.

◆ TEST_F() [38/51]

TEST_F ( LineIntersectionTest  ,
IntersectionNegativeCoordinates   
)

Definition at line 259 of file line_test.cc.

References Aleph::LineEq::intersection(), Aleph::maps(), and y.

◆ TEST_F() [39/51]

TEST_F ( LineIntersectionTest  ,
IntersectionWithHorizontal   
)

Definition at line 271 of file line_test.cc.

References Aleph::LineEq::intersection(), Aleph::maps(), and y.

◆ TEST_F() [40/51]

TEST_F ( LineIntersectionTest  ,
ParallelLinesThrow   
)

Definition at line 283 of file line_test.cc.

References Aleph::LineEq::intersection(), and Aleph::maps().

◆ TEST_F() [41/51]

TEST_F ( LineIntersectionTest  ,
SimpleIntersection   
)

Definition at line 236 of file line_test.cc.

References Aleph::LineEq::intersection(), Aleph::maps(), and y.

◆ TEST_F() [42/51]

TEST_F ( LinePerpendicularTest  ,
PerpendicularThrough   
)

◆ TEST_F() [43/51]

TEST_F ( LinePerpendicularTest  ,
PerpendicularThroughOrigin   
)

Definition at line 317 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::perpendicular_through().

◆ TEST_F() [44/51]

TEST_F ( LinePerpendicularTest  ,
PerpendicularToHorizontalThrows   
)

Definition at line 327 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::perpendicular_through().

◆ TEST_F() [45/51]

TEST_F ( LinePropertyTest  ,
IsHorizontal   
)

Definition at line 197 of file line_test.cc.

References Aleph::LineEq::is_horizontal(), and Aleph::maps().

◆ TEST_F() [46/51]

TEST_F ( LinePropertyTest  ,
IsParallelTo   
)

Definition at line 208 of file line_test.cc.

References Aleph::LineEq::is_parallel_to(), and Aleph::maps().

◆ TEST_F() [47/51]

TEST_F ( LinePropertyTest  ,
IsPerpendicularTo   
)

Definition at line 219 of file line_test.cc.

References Aleph::LineEq::is_perpendicular_to(), and Aleph::maps().

◆ TEST_F() [48/51]

TEST_F ( LinePropertyTest  ,
SlopeGetter   
)

Definition at line 185 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::slope().

◆ TEST_F() [49/51]

TEST_F ( LinePropertyTest  ,
YInterceptGetter   
)

Definition at line 191 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::y_intercept().

◆ TEST_F() [50/51]

TEST_F ( LineStringTest  ,
StreamOutput   
)

Definition at line 459 of file line_test.cc.

References Aleph::maps().

◆ TEST_F() [51/51]

TEST_F ( LineStringTest  ,
ToString   
)

Definition at line 449 of file line_test.cc.

References Aleph::maps(), and Aleph::LineEq::to_string().