|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <pcbnew_utils/board_test_utils.h>#include <board.h>#include <footprint.h>#include <geometry/shape_utils.h>#include <netinfo.h>#include <pad.h>#include <padstack.h>#include <pcb_track.h>#include <zone.h>#include <zone_utils.h>Go to the source code of this file.
Classes | |
| struct | ZONE_TEST_FIXTURE |
Functions | |
| static std::unique_ptr< ZONE > | CreateSquareZone (BOARD_ITEM_CONTAINER &aParent, BOX2I aBox, PCB_LAYER_ID aLayer) |
| static std::unique_ptr< ZONE > | CreateSimilarZone (BOARD_ITEM_CONTAINER &aParent, const ZONE &aOther, PCB_LAYER_ID aLayer) |
| Create a similar zone (same outline) on a different layer. | |
| BOOST_AUTO_TEST_CASE (SingleLayer) | |
| BOOST_AUTO_TEST_CASE (MultipleLayers) | |
| BOOST_AUTO_TEST_CASE (RescuedLayers) | |
| During zone loading, the layer is set to Rescue if the layer is not found. | |
| BOOST_AUTO_TEST_CASE (RuleAreaInnerLayersExpandMode) | |
| Verify that a rule area on all inner copper layers does not produce a spurious layer validation error when the footprint uses the default EXPAND_INNER_LAYERS stackup mode. | |
| BOOST_AUTO_TEST_CASE (EmptyZoneGetPosition) | |
| Verify that GetPosition() on a zone with no outline vertices does not throw or crash. | |
| BOOST_AUTO_TEST_CASE (ZoneMergeNull) | |
| BOOST_AUTO_TEST_CASE (ZoneMergeNonNullNoMerge) | |
| BOOST_AUTO_TEST_CASE (ZoneMergeNonNullMerge) | |
| BOOST_AUTO_TEST_CASE (ZoneMergeMergeSameGeomDifferentOrder) | |
| static PCB_VIA * | AddVia (BOARD &aBoard, const VECTOR2I &aPos, int aNetCode, PCB_LAYER_ID aTopLayer=F_Cu, PCB_LAYER_ID aBotLayer=B_Cu) |
| static PAD * | AddPadToBoard (BOARD &aBoard, const VECTOR2I &aPos, int aNetCode, PCB_LAYER_ID aLayer=F_Cu) |
| BOOST_AUTO_TEST_CASE (AutoPriority_NonOverlapping) | |
| BOOST_AUTO_TEST_CASE (AutoPriority_ItemCountWins) | |
| BOOST_AUTO_TEST_CASE (AutoPriority_SimilarCountsSmallerWins) | |
| BOOST_AUTO_TEST_CASE (AutoPriority_MultiLayerAggregate) | |
| BOOST_AUTO_TEST_CASE (AutoPriority_SameNetEqualPriority) | |
| BOOST_AUTO_TEST_CASE (AutoPriority_EqualAreaNoChange) | |
| BOOST_AUTO_TEST_CASE (AutoPriority_SameNetGroupInheritsEdge) | |
|
static |
Definition at line 264 of file test_zone.cpp.
References BOARD::Add(), FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, CIRCLE, F_Cu, FOOTPRINT, PAD, pad, pcbIUScale, and FOOTPRINT::SetPosition().
|
static |
Definition at line 250 of file test_zone.cpp.
References BOARD::Add(), PADSTACK::ALL_LAYERS, B_Cu, F_Cu, pcbIUScale, and via.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_EqualAreaNoChange | ) |
Definition at line 475 of file test_zone.cpp.
References AutoAssignZonePriorities(), BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_ItemCountWins | ) |
Definition at line 315 of file test_zone.cpp.
References AddVia(), AutoAssignZonePriorities(), BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_MultiLayerAggregate | ) |
Definition at line 395 of file test_zone.cpp.
References AddVia(), AutoAssignZonePriorities(), B_Cu, BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_NonOverlapping | ) |
Definition at line 283 of file test_zone.cpp.
References AutoAssignZonePriorities(), BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_SameNetEqualPriority | ) |
Definition at line 441 of file test_zone.cpp.
References AddVia(), AutoAssignZonePriorities(), BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_SameNetGroupInheritsEdge | ) |
Definition at line 511 of file test_zone.cpp.
References AddVia(), AutoAssignZonePriorities(), BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | AutoPriority_SimilarCountsSmallerWins | ) |
Definition at line 356 of file test_zone.cpp.
References AddVia(), AutoAssignZonePriorities(), BOOST_TEST(), CreateSquareZone(), F_Cu, ZONE::GetAssignedPriority(), NETINFO_ITEM::GetNetCode(), and pcbIUScale.
| BOOST_AUTO_TEST_CASE | ( | EmptyZoneGetPosition | ) |
Verify that GetPosition() on a zone with no outline vertices does not throw or crash.
Empty zones can be created by importers.
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23125
Definition at line 168 of file test_zone.cpp.
References BOOST_TEST(), F_Cu, ZONE::GetNumCorners(), ZONE::GetPosition(), and ZONE::SetLayer().
| BOOST_AUTO_TEST_CASE | ( | MultipleLayers | ) |
Definition at line 87 of file test_zone.cpp.
References B_Cu, BOOST_TEST(), F_Cu, ZONE::GetFirstLayer(), ZONE::GetLayer(), ZONE::IsOnCopperLayer(), ZONE::SetLayerSet(), and UNDEFINED_LAYER.
| BOOST_AUTO_TEST_CASE | ( | RescuedLayers | ) |
During zone loading, the layer is set to Rescue if the layer is not found.
This is not a UI-visible layer, so make sure it can still be retreived.
https://gitlab.com/kicad/code/kicad/-/issues/18553
Definition at line 107 of file test_zone.cpp.
References BOOST_TEST(), ZONE::GetFirstLayer(), ZONE::GetLayer(), ZONE::IsOnCopperLayer(), Rescue, and ZONE::SetLayer().
| BOOST_AUTO_TEST_CASE | ( | RuleAreaInnerLayersExpandMode | ) |
Verify that a rule area on all inner copper layers does not produce a spurious layer validation error when the footprint uses the default EXPAND_INNER_LAYERS stackup mode.
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23042
Definition at line 126 of file test_zone.cpp.
References FOOTPRINT::Add(), B_Cu, BOOST_TEST(), EXPAND_INNER_LAYERS, F_Cu, BOARD_ITEM::GetLayer(), LSET::InternalCuMask(), PCB_ZONE_T, RECURSE, FOOTPRINT::RunOnChildren(), BASE_SET::set(), ZONE::SetIsRuleArea(), ZONE::SetLayerSet(), FOOTPRINT::SetStackupMode(), EDA_ITEM::Type(), and LSET::UserDefinedLayersMask().
| BOOST_AUTO_TEST_CASE | ( | SingleLayer | ) |
Definition at line 75 of file test_zone.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_TEST(), F_Cu, ZONE::GetFirstLayer(), ZONE::GetLayer(), ZONE::IsOnCopperLayer(), and ZONE::SetLayer().
| BOOST_AUTO_TEST_CASE | ( | ZoneMergeMergeSameGeomDifferentOrder | ) |
Definition at line 227 of file test_zone.cpp.
References B_Cu, BOOST_REQUIRE(), BOOST_TEST(), CreateSimilarZone(), CreateSquareZone(), F_Cu, and MergeZonesWithSameOutline().
| BOOST_AUTO_TEST_CASE | ( | ZoneMergeNonNullMerge | ) |
Definition at line 210 of file test_zone.cpp.
References B_Cu, BOOST_REQUIRE(), BOOST_TEST(), CreateSimilarZone(), CreateSquareZone(), F_Cu, and MergeZonesWithSameOutline().
| BOOST_AUTO_TEST_CASE | ( | ZoneMergeNonNullNoMerge | ) |
Definition at line 196 of file test_zone.cpp.
References B_Cu, BOOST_TEST(), CreateSquareZone(), F_Cu, and MergeZonesWithSameOutline().
| BOOST_AUTO_TEST_CASE | ( | ZoneMergeNull | ) |
Definition at line 179 of file test_zone.cpp.
References BOOST_TEST(), F_Cu, and MergeZonesWithSameOutline().
|
static |
Create a similar zone (same outline) on a different layer.
Definition at line 61 of file test_zone.cpp.
References ZONE::Outline().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 44 of file test_zone.cpp.
References KIGEOM::BoxToLineChain().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().