KiCad PCB EDA Suite
test_kimath.cpp File Reference

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (TestInterceptsPositiveX)
 Test suite for KiCad math code. More...
 
 BOOST_AUTO_TEST_CASE (TestInterceptsNegativeX)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( TestInterceptsPositiveX  )

Test suite for KiCad math code.

Declare the test suite

Definition at line 40 of file test_kimath.cpp.

41 {
42  BOOST_CHECK( !InterceptsPositiveX( 10.0, 20.0 ) );
43  BOOST_CHECK( !InterceptsPositiveX( 10.0, 120.0 ) );
44  BOOST_CHECK( !InterceptsPositiveX( 10.0, 220.0 ) );
45  BOOST_CHECK( !InterceptsPositiveX( 10.0, 320.0 ) );
46  BOOST_CHECK( InterceptsPositiveX( 20.0, 10.0 ) );
47  BOOST_CHECK( InterceptsPositiveX( 345.0, 15.0 ) );
48 }
bool InterceptsPositiveX(double aStartAngle, double aEndAngle)
Test if an arc from aStartAngle to aEndAngle crosses the positive X axis (0 degrees).
Definition: trigo.h:387

References InterceptsPositiveX().

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( TestInterceptsNegativeX  )

Definition at line 51 of file test_kimath.cpp.

52 {
53  BOOST_CHECK( !InterceptsNegativeX( 10.0, 20.0 ) );
54  BOOST_CHECK( !InterceptsNegativeX( 10.0, 120.0 ) );
55  BOOST_CHECK( InterceptsNegativeX( 10.0, 220.0 ) );
56  BOOST_CHECK( InterceptsNegativeX( 10.0, 320.0 ) );
57  BOOST_CHECK( InterceptsNegativeX( 20.0, 10.0 ) );
58  BOOST_CHECK( !InterceptsNegativeX( 345.0, 15.0 ) );
59  BOOST_CHECK( InterceptsNegativeX( 145.0, 225.0 ) );
60 }
bool InterceptsNegativeX(double aStartAngle, double aEndAngle)
Test if an arc from aStartAngle to aEndAngle crosses the negative X axis (180 degrees).
Definition: trigo.h:405

References InterceptsNegativeX().