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_CHECK (box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(2, 0))==VECTOR2D(2, 2))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(6, 0))==VECTOR2D(4, 2))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(6, 5))==VECTOR2D(4, 5))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(6, 7))==VECTOR2D(4, 6))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(3, 7))==VECTOR2D(3, 6))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(0, 7))==VECTOR2D(1, 6))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(0, 3))==VECTOR2D(1, 3))
 
 BOOST_CHECK (box.ClosestPointTo(VECTOR2D(2, 4))==VECTOR2D(2, 4))
 
 BOOST_CHECK (box.FarthestPointTo(VECTOR2D(2, 3))==VECTOR2D(4, 6))
 
 BOOST_CHECK (box.FarthestPointTo(VECTOR2D(3, 3))==VECTOR2D(1, 6))
 
 BOOST_CHECK (box.FarthestPointTo(VECTOR2D(3, 5))==VECTOR2D(1, 2))
 
 BOOST_CHECK (box.FarthestPointTo(VECTOR2D(2, 5))==VECTOR2D(4, 2))
 
 BOOST_CHECK (box.IntersectsCircle(VECTOR2D(4, 6), 5)==true)
 
 BOOST_CHECK (box.IntersectsCircle(VECTOR2D(4, 6), 6)==true)
 
 BOOST_CHECK (box.IntersectsCircle(VECTOR2D(4, 6), 2)==true)
 
 BOOST_CHECK (box.IntersectsCircle(VECTOR2D(14, 6), 5)==false)
 
 BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(4, 6), 5, 1)==true)
 
 BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(4, 6), 6, 1)==false)
 
 BOOST_CHECK (box.IntersectsCircleEdge(VECTOR2D(4, 6), 2, 1)==true)
 
 BOOST_CHECK (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_CHECK(), 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_CHECK(), 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 BOX2< Vec >::GetPosition(), and BOX2< Vec >::GetSize().

◆ BOOST_CHECK() [1/21]

◆ BOOST_CHECK() [2/21]

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

◆ BOOST_CHECK() [3/21]

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

◆ BOOST_CHECK() [4/21]

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

◆ BOOST_CHECK() [5/21]

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

◆ BOOST_CHECK() [6/21]

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

◆ BOOST_CHECK() [7/21]

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

◆ BOOST_CHECK() [8/21]

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

◆ BOOST_CHECK() [9/21]

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

◆ BOOST_CHECK() [10/21]

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

◆ BOOST_CHECK() [11/21]

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

◆ BOOST_CHECK() [12/21]

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

◆ BOOST_CHECK() [13/21]

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

◆ BOOST_CHECK() [14/21]

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

◆ BOOST_CHECK() [15/21]

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

◆ BOOST_CHECK() [16/21]

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

◆ BOOST_CHECK() [17/21]

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

◆ BOOST_CHECK() [18/21]

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

◆ BOOST_CHECK() [19/21]

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

◆ BOOST_CHECK() [20/21]

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

◆ BOOST_CHECK() [21/21]

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