KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_eda_shape.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <cmath>
#include <base_units.h>
#include <eda_shape.h>
#include <math/util.h>
#include <tool/point_editor_behavior.h>
#include <qa_utils/geometry/geometry.h>
#include <geometry/shape_arc.h>

Go to the source code of this file.

Classes

class  EDA_SHAPE_MOCK
 
struct  SET_ANGLE_END_CASE
 
struct  SET_ARC_GEOMETRY_CASE
 

Functions

 BOOST_AUTO_TEST_CASE (SetAngleAndEnd)
 
 BOOST_AUTO_TEST_CASE (SetArcGeometry)
 
 BOOST_AUTO_TEST_CASE (ArcEditKeepsSmallSchematicRadius)
 Editing a small eeschema arc must not snap its radius up to the PCB-scale 1 mil minimum.
 
 BOOST_AUTO_TEST_CASE (PolygonBehaviorSurvivesAssignment)
 Verify that EDA_POLYGON_POINT_EDIT_BEHAVIOR survives EDA_SHAPE assignment.
 
 BOOST_AUTO_TEST_CASE (EllipseBasicAccessors)
 
 BOOST_AUTO_TEST_CASE (EllipseArcIsOpenCurve)
 
 BOOST_AUTO_TEST_CASE (EllipsePerimeterForCircleCase)
 
 BOOST_AUTO_TEST_CASE (EllipseMakeEffectiveShapesNonEmpty)
 

Variables

static const std::vector< SET_ANGLE_END_CASEset_angle_end_cases
 
static const std::vector< SET_ARC_GEOMETRY_CASEset_arc_geometry_cases
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

BOOST_AUTO_TEST_CASE ( ArcEditKeepsSmallSchematicRadius )

Editing a small eeschema arc must not snap its radius up to the PCB-scale 1 mil minimum.

The edit helpers used to hard-code pcbIUScale, which in schematic IUs (1 IU = 100 nm) is a 25400 IU == 100 mil floor. See https://gitlab.com/kicad/code/kicad/-/issues/24396.

Definition at line 184 of file test_eda_shape.cpp.

References ARC, arc2(), center, KI_ARC_EDIT::EditArcEndpointKeepCenter(), KI_ARC_EDIT::EditArcMidKeepCenter(), end, EDA_SHAPE::GetRadius(), KiROUND(), radius, schIUScale, and EDA_SHAPE::SetArcGeometry().

◆ BOOST_AUTO_TEST_CASE() [2/8]

◆ BOOST_AUTO_TEST_CASE() [3/8]

◆ BOOST_AUTO_TEST_CASE() [4/8]

◆ BOOST_AUTO_TEST_CASE() [5/8]

◆ BOOST_AUTO_TEST_CASE() [6/8]

BOOST_AUTO_TEST_CASE ( PolygonBehaviorSurvivesAssignment )

◆ BOOST_AUTO_TEST_CASE() [7/8]

◆ BOOST_AUTO_TEST_CASE() [8/8]

Variable Documentation

◆ set_angle_end_cases

const std::vector<SET_ANGLE_END_CASE> set_angle_end_cases
static
Initial value:
=
{
{
"Issue 13626: clockwise semicircle",
{-428880000, 117229160 },
{-430060565, 113472820 },
180.0,
{-431241130, 109716480 },
false
},
{
"Issue 13626: anticlockwise arc",
{ -431241130, 109716480 },
{ -434923630, 112954230 },
-138.46654568595355,
{ -439827050, 112936200 },
true
}
}

Definition at line 51 of file test_eda_shape.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ set_arc_geometry_cases

const std::vector<SET_ARC_GEOMETRY_CASE> set_arc_geometry_cases
static
Initial value:
= {
{
"Issue 15694: clockwise arc",
{ 10000000, 0 },
{ 0, 10000000 },
{ -10000000, 0 },
{ 0, 0 },
10000000,
false,
{ -10000000, 0 },
180.0,
},
{
"Issue 15694: anticlockwise arc",
{ -10000000, 0 },
{ 0, 10000000 },
{ 10000000, 0 },
{ 0, 0 },
10000000,
true,
{ 10000000, 0 },
180.0,
},
}

Definition at line 108 of file test_eda_shape.cpp.

Referenced by BOOST_AUTO_TEST_CASE().