KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_box2.cpp File Reference

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (DefaultConstructor)
 Test suite for KiCad math code.
 
 BOOST_AUTO_TEST_CASE (BasicInt)
 
 BOOST_AUTO_TEST_CASE (Constexpr)
 
 BOOST_AUTO_TEST_CASE (BasicDouble)
 
 BOOST_AUTO_TEST_CASE (ByCorners)
 
 BOOST_AUTO_TEST_CASE (ByCentre)
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(2, 0))==VECTOR2D(2, 2))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(6, 0))==VECTOR2D(4, 2))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(6, 5))==VECTOR2D(4, 5))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(6, 7))==VECTOR2D(4, 6))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(3, 7))==VECTOR2D(3, 6))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(0, 7))==VECTOR2D(1, 6))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(0, 3))==VECTOR2D(1, 3))
 
 BOOST_TEST (box.ClosestPointTo(VECTOR2D(2, 4))==VECTOR2D(2, 4))
 
 BOOST_TEST (box.FarthestPointTo(VECTOR2D(2, 3))==VECTOR2D(4, 6))
 
 BOOST_TEST (box.FarthestPointTo(VECTOR2D(3, 3))==VECTOR2D(1, 6))
 
 BOOST_TEST (box.FarthestPointTo(VECTOR2D(3, 5))==VECTOR2D(1, 2))
 
 BOOST_TEST (box.FarthestPointTo(VECTOR2D(2, 5))==VECTOR2D(4, 2))
 
 BOOST_TEST (box.IntersectsCircle(VECTOR2D(4, 6), 5)==true)
 
 BOOST_TEST (box.IntersectsCircle(VECTOR2D(4, 6), 6)==true)
 
 BOOST_TEST (box.IntersectsCircle(VECTOR2D(4, 6), 2)==true)
 
 BOOST_TEST (box.IntersectsCircle(VECTOR2D(14, 6), 5)==false)
 
 BOOST_TEST (box.IntersectsCircleEdge(VECTOR2D(4, 6), 5, 1)==true)
 
 BOOST_TEST (box.IntersectsCircleEdge(VECTOR2D(4, 6), 6, 1)==false)
 
 BOOST_TEST (box.IntersectsCircleEdge(VECTOR2D(4, 6), 2, 1)==true)
 
 BOOST_TEST (box.IntersectsCircleEdge(VECTOR2D(14, 6), 5, 1)==false)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( BasicDouble  )

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( BasicInt  )

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( ByCentre  )

Definition at line 107 of file test_box2.cpp.

References BOOST_TEST(), and BOX2< VECTOR2I >::ByCenter().

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( ByCorners  )

Definition at line 99 of file test_box2.cpp.

References BOOST_TEST(), and BOX2< VECTOR2I >::ByCorners().

◆ BOOST_AUTO_TEST_CASE() [5/6]

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( DefaultConstructor  )

Test suite for KiCad math code.

Declare the test suite

Definition at line 40 of file test_box2.cpp.

References BOOST_TEST(), BOX2< Vec >::GetPosition(), and BOX2< Vec >::GetSize().

◆ BOOST_TEST() [1/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(0, 0) = =VECTOR2D(1, 2))
Initial value:
{
BOX2D box( VECTOR2D( 1, 2 ), VECTOR2D( 3, 4 ) )
VECTOR2< double > VECTOR2D
Definition: vector2d.h:690

Referenced by BOOST_AUTO_TEST_CASE().

◆ BOOST_TEST() [2/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(0, 3) = =VECTOR2D(1, 3))

◆ BOOST_TEST() [3/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(0, 7) = =VECTOR2D(1, 6))

◆ BOOST_TEST() [4/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(2, 0) = =VECTOR2D(2, 2))

◆ BOOST_TEST() [5/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(2, 4) = =VECTOR2D(2, 4))

◆ BOOST_TEST() [6/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(3, 7) = =VECTOR2D(3, 6))

◆ BOOST_TEST() [7/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(6, 0) = =VECTOR2D(4, 2))

◆ BOOST_TEST() [8/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(6, 5) = =VECTOR2D(4, 5))

◆ BOOST_TEST() [9/21]

BOOST_TEST ( box.  ClosestPointToVECTOR2D(6, 7) = =VECTOR2D(4, 6))

◆ BOOST_TEST() [10/21]

BOOST_TEST ( box.  FarthestPointToVECTOR2D(2, 3) = =VECTOR2D(4, 6))

◆ BOOST_TEST() [11/21]

BOOST_TEST ( box.  FarthestPointToVECTOR2D(2, 5) = =VECTOR2D(4, 2))

◆ BOOST_TEST() [12/21]

BOOST_TEST ( box.  FarthestPointToVECTOR2D(3, 3) = =VECTOR2D(1, 6))

◆ BOOST_TEST() [13/21]

BOOST_TEST ( box.  FarthestPointToVECTOR2D(3, 5) = =VECTOR2D(1, 2))

◆ BOOST_TEST() [14/21]

BOOST_TEST ( box.  IntersectsCircleVECTOR2D(14, 6), 5 = =false)

◆ BOOST_TEST() [15/21]

BOOST_TEST ( box.  IntersectsCircleVECTOR2D(4, 6), 2 = =true)

◆ BOOST_TEST() [16/21]

BOOST_TEST ( box.  IntersectsCircleVECTOR2D(4, 6), 5 = =true)

◆ BOOST_TEST() [17/21]

BOOST_TEST ( box.  IntersectsCircleVECTOR2D(4, 6), 6 = =true)

◆ BOOST_TEST() [18/21]

BOOST_TEST ( box.  IntersectsCircleEdgeVECTOR2D(14, 6), 5, 1 = =false)

◆ BOOST_TEST() [19/21]

BOOST_TEST ( box.  IntersectsCircleEdgeVECTOR2D(4, 6), 2, 1 = =true)

◆ BOOST_TEST() [20/21]

BOOST_TEST ( box.  IntersectsCircleEdgeVECTOR2D(4, 6), 5, 1 = =true)

◆ BOOST_TEST() [21/21]

BOOST_TEST ( box.  IntersectsCircleEdgeVECTOR2D(4, 6), 6, 1 = =false)