KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_zone.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <pcbnew_utils/board_test_utils.h>
#include <board.h>
#include <footprint.h>
#include <zone.h>

Go to the source code of this file.

Classes

struct  ZONE_TEST_FIXTURE
 

Functions

 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.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

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 133 of file test_zone.cpp.

References BOOST_TEST(), F_Cu, ZONE::GetNumCorners(), ZONE::GetPosition(), and ZONE::SetLayer().

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( MultipleLayers )

◆ BOOST_AUTO_TEST_CASE() [3/5]

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 72 of file test_zone.cpp.

References BOOST_TEST(), ZONE::GetFirstLayer(), ZONE::GetLayer(), ZONE::IsOnCopperLayer(), Rescue, and ZONE::SetLayer().

◆ BOOST_AUTO_TEST_CASE() [4/5]

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 91 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() [5/5]

BOOST_AUTO_TEST_CASE ( SingleLayer )