scenario_simulator_v2 C++ API
Functions
test_line_segment.cpp File Reference
#include <gtest/gtest.h>
#include <cmath>
#include <geometry/polygon/line_segment.hpp>
#include <geometry/quaternion/euler_to_quaternion.hpp>
#include <geometry/quaternion/quaternion_to_euler.hpp>
#include <scenario_simulator_exception/exception.hpp>
#include "../expect_eq_macros.hpp"
#include "../test_utils.hpp"
Include dependency graph for test_line_segment.cpp:

Functions

 TEST (LineSegment, initializeDifferentPoints)
 
 TEST (LineSegment, initializeIdenticalPoints)
 
 TEST (LineSegment, initializeVector)
 
 TEST (LineSegment, initializeVectorZero)
 
 TEST (LineSegment, initializeVectorZeroLength)
 
 TEST (LineSegment, getPoint_outOfBounds_denormalized)
 
 TEST (LineSegment, getPoint_outOfBounds_normalized)
 
 TEST (LineSegment, getPoint_inside_denormalized)
 
 TEST (LineSegment, getPoint_inside_normalized)
 
 TEST (LineSegment, getPose_denormalized)
 
 TEST (LineSegment, getPose_normalized)
 
 TEST (LineSegment, getPose_pitch)
 
 TEST (LineSegment, isIntersect2DDisjoint)
 
 TEST (LineSegment, isIntersect2DIntersect)
 
 TEST (LineSegment, isIntersect2DIdentical)
 
 TEST (LineSegment, isIntersect2D_collinear)
 
 TEST (LineSegment, isIntersect2D_pointInside)
 
 TEST (LineSegment, isIntersect2D_pointOutside)
 
 TEST (LineSegment, isIntersect2D_pointCollinear)
 
 TEST (LineSegment, isIntersect2D_pointOnEnd)
 
 TEST (LineSegment, get2DIntersectionSValue_line_vertical)
 
 TEST (LineSegment, get2DIntersectionSValue_line_horizontal)
 
 TEST (LineSegment, get2DIntersectionSValue_line_bounds)
 
 TEST (LineSegment, get2DIntersectionSValue_line_outside)
 
 TEST (LineSegment, get2DIntersectionSValue_line_collinear)
 
 TEST (LineSegment, get2DIntersectionSValue_point_vertical)
 
 TEST (LineSegment, get2DIntersectionSValue_point_horizontal)
 
 TEST (LineSegment, get2DIntersectionSValue_point_bounds)
 
 TEST (LineSegment, get2DIntersectionSValue_point_outside)
 
 TEST (LineSegment, getIntersection2DDisjoint)
 
 TEST (LineSegment, getIntersection2DIntersect)
 
 TEST (LineSegment, getIntersection2DIdentical)
 
 TEST (LineSegment, getSValue)
 
 TEST (LineSegment, getSValue_denormalize)
 
 TEST (LineSegment, getSValue_outOfRange)
 
 TEST (LineSegment, getSValue_outOfRangeDenormalize)
 
 TEST (LineSegment, getSValue_parallel)
 
 TEST (LineSegment, getSValue_parallelDenormalize)
 
 TEST (LineSegment, getVector)
 
 TEST (LineSegment, getVectorZeroLength)
 
 TEST (LineSegment, getNormalVector)
 
 TEST (LineSegment, getNormalVector_zeroLength)
 
 TEST (LineSegment, get2DVector)
 
 TEST (LineSegment, get2DVectorZeroLength)
 
 TEST (LineSegment, getLength)
 
 TEST (LineSegment, getLengthZeroLength)
 
 TEST (LineSegment, get2DLength)
 
 TEST (LineSegment, get2DLengthZeroLength)
 
 TEST (LineSegment, get2DVectorSlope)
 
 TEST (LineSegment, get2DVectorSlopeZeroLength)
 
 TEST (LineSegment, getSquaredDistanceIn2D)
 
 TEST (LineSegment, getSquaredDistanceIn2D_denormalize)
 
 TEST (LineSegment, getSquaredDistanceVector)
 
 TEST (LineSegment, getSquaredDistanceVector_denormalize)
 
 TEST (LineSegment, getLineSegments)
 
 TEST (LineSegment, getLineSegments_closeStartEnd)
 
 TEST (LineSegment, getLineSegmentsVectorEmpty)
 
 TEST (LineSegment, getLineSegmentsVectorIdentical)
 
 TEST (LineSegment, getLineSegmentsVectorIdentical_closeStartEnd)
 
int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

◆ TEST() [1/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_line_bounds   
)
Note
Test result correctness with lines intersecting at the start and end of a line.

◆ TEST() [2/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_line_collinear   
)
Note
Test result correctness when lines are collinear.

◆ TEST() [3/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_line_horizontal   
)
Note
Test result correctness with a line intersecting with a horizontal line.

◆ TEST() [4/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_line_outside   
)
Note
Test result correctness with a line outside of the line.

◆ TEST() [5/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_line_vertical   
)
Note
Test result correctness with a line intersecting with a vertical line.

◆ TEST() [6/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_point_bounds   
)
Note
Test result correctness with points at the start and end of a line.

◆ TEST() [7/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_point_horizontal   
)
Note
Test result correctness with a point inside a horizontal line.

◆ TEST() [8/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_point_outside   
)
Note
Test result correctness with a point outside of the line.

◆ TEST() [9/59]

TEST ( LineSegment  ,
get2DIntersectionSValue_point_vertical   
)
Note
Test result correctness with a point inside a vertical line.

◆ TEST() [10/59]

TEST ( LineSegment  ,
get2DLength   
)

◆ TEST() [11/59]

TEST ( LineSegment  ,
get2DLengthZeroLength   
)

◆ TEST() [12/59]

TEST ( LineSegment  ,
get2DVector   
)

◆ TEST() [13/59]

TEST ( LineSegment  ,
get2DVectorSlope   
)

◆ TEST() [14/59]

TEST ( LineSegment  ,
get2DVectorSlopeZeroLength   
)

◆ TEST() [15/59]

TEST ( LineSegment  ,
get2DVectorZeroLength   
)

◆ TEST() [16/59]

TEST ( LineSegment  ,
getIntersection2DDisjoint   
)

◆ TEST() [17/59]

TEST ( LineSegment  ,
getIntersection2DIdentical   
)
Note
Test function behavior with two identical lines.

◆ TEST() [18/59]

TEST ( LineSegment  ,
getIntersection2DIntersect   
)
Note
Test function behavior with two intersecting lines.

◆ TEST() [19/59]

TEST ( LineSegment  ,
getLength   
)

◆ TEST() [20/59]

TEST ( LineSegment  ,
getLengthZeroLength   
)

◆ TEST() [21/59]

TEST ( LineSegment  ,
getLineSegments   
)

◆ TEST() [22/59]

TEST ( LineSegment  ,
getLineSegments_closeStartEnd   
)

◆ TEST() [23/59]

TEST ( LineSegment  ,
getLineSegmentsVectorEmpty   
)

◆ TEST() [24/59]

TEST ( LineSegment  ,
getLineSegmentsVectorIdentical   
)

◆ TEST() [25/59]

TEST ( LineSegment  ,
getLineSegmentsVectorIdentical_closeStartEnd   
)

◆ TEST() [26/59]

TEST ( LineSegment  ,
getNormalVector   
)

◆ TEST() [27/59]

TEST ( LineSegment  ,
getNormalVector_zeroLength   
)

◆ TEST() [28/59]

TEST ( LineSegment  ,
getPoint_inside_denormalized   
)
Note
Test calculation correctness when s is out of bounds.

◆ TEST() [29/59]

TEST ( LineSegment  ,
getPoint_inside_normalized   
)
Note
Test calculation correctness when normalized s is out of bounds.

◆ TEST() [30/59]

TEST ( LineSegment  ,
getPoint_outOfBounds_denormalized   
)
Note
Test error throwing when s is out of bounds.

◆ TEST() [31/59]

TEST ( LineSegment  ,
getPoint_outOfBounds_normalized   
)
Note
Test error throwing when normalized s is out of bounds.

◆ TEST() [32/59]

TEST ( LineSegment  ,
getPose_denormalized   
)
Note
Test calculation correctness with denormalized s.

◆ TEST() [33/59]

TEST ( LineSegment  ,
getPose_normalized   
)
Note
Test calculation correctness with normalized s.

◆ TEST() [34/59]

TEST ( LineSegment  ,
getPose_pitch   
)
Note
Test pitch calculation correctness with fill_pitch = true.

◆ TEST() [35/59]

TEST ( LineSegment  ,
getSquaredDistanceIn2D   
)

◆ TEST() [36/59]

TEST ( LineSegment  ,
getSquaredDistanceIn2D_denormalize   
)

◆ TEST() [37/59]

TEST ( LineSegment  ,
getSquaredDistanceVector   
)

◆ TEST() [38/59]

TEST ( LineSegment  ,
getSquaredDistanceVector_denormalize   
)

◆ TEST() [39/59]

TEST ( LineSegment  ,
getSValue   
)

◆ TEST() [40/59]

TEST ( LineSegment  ,
getSValue_denormalize   
)

◆ TEST() [41/59]

TEST ( LineSegment  ,
getSValue_outOfRange   
)

◆ TEST() [42/59]

TEST ( LineSegment  ,
getSValue_outOfRangeDenormalize   
)

◆ TEST() [43/59]

TEST ( LineSegment  ,
getSValue_parallel   
)

◆ TEST() [44/59]

TEST ( LineSegment  ,
getSValue_parallelDenormalize   
)

◆ TEST() [45/59]

TEST ( LineSegment  ,
getVector   
)

◆ TEST() [46/59]

TEST ( LineSegment  ,
getVectorZeroLength   
)

◆ TEST() [47/59]

TEST ( LineSegment  ,
initializeDifferentPoints   
)

◆ TEST() [48/59]

TEST ( LineSegment  ,
initializeIdenticalPoints   
)

◆ TEST() [49/59]

TEST ( LineSegment  ,
initializeVector   
)

◆ TEST() [50/59]

TEST ( LineSegment  ,
initializeVectorZero   
)

◆ TEST() [51/59]

TEST ( LineSegment  ,
initializeVectorZeroLength   
)

◆ TEST() [52/59]

TEST ( LineSegment  ,
isIntersect2D_collinear   
)
Note
Test function behavior with two disjoint, collinear lines.

◆ TEST() [53/59]

TEST ( LineSegment  ,
isIntersect2D_pointCollinear   
)
Note
Test function behavior with a point that is collinear and external to the line.

◆ TEST() [54/59]

TEST ( LineSegment  ,
isIntersect2D_pointInside   
)
Note
Test function behavior with a point on the line.

◆ TEST() [55/59]

TEST ( LineSegment  ,
isIntersect2D_pointOnEnd   
)
Note
Test function behavior with a point on an end of the line.

◆ TEST() [56/59]

TEST ( LineSegment  ,
isIntersect2D_pointOutside   
)
Note
Test function behavior with a point outside of the line.

◆ TEST() [57/59]

TEST ( LineSegment  ,
isIntersect2DDisjoint   
)

◆ TEST() [58/59]

TEST ( LineSegment  ,
isIntersect2DIdentical   
)

◆ TEST() [59/59]

TEST ( LineSegment  ,
isIntersect2DIntersect   
)