KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_footprint_rescue_layer.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <footprint.h>
#include <layer_ids.h>
#include <layer_utils.h>
#include <lset.h>
#include <pad.h>
#include <pcb_shape.h>
#include <pcbnew_utils/board_file_utils.h>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (OrphanLayerCheckIgnoresRescue)
 Regression test for https://gitlab.com/kicad/code/kicad/-/issues/24045.
 
 BOOST_AUTO_TEST_CASE (OrphanLayerCheckAllowsAllUserLayers)
 Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23744.
 
 BOOST_AUTO_TEST_CASE (Issue24045Footprint)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/3]

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( OrphanLayerCheckAllowsAllUserLayers )

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23744.

In the default ("Custom Layers" off) stackup the footprint imposes no restriction on user layers, so an item on any user-defined layer must not be reported as orphaned. The dialog previously evaluated the orphan check against a hard-coded set of only the first four user layers, which falsely flagged items on higher user layers (User_5+) and blocked unrelated edits such as modifying a 3D model.

Definition at line 118 of file test_footprint_rescue_layer.cpp.

References FOOTPRINT::Add(), B_Cu, BOOST_TEST(), F_Cu, LAYER_UTILS::GetOrphanedFootprintLayers(), LSET::InternalCuMask(), PCB_SHAPE::SetLayer(), User_9, and LSET::UserDefinedLayersMask().

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( OrphanLayerCheckIgnoresRescue )

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/24045.

A footprint that contains items on the internal Rescue pseudo-layer must not cause the Footprint Properties dialog validator to report "You are trying to remove layers..." with an empty list. Rescue is an internal fallback layer with no UI control, so the orphaned-layer check must treat it as non-blocking.

Definition at line 41 of file test_footprint_rescue_layer.cpp.

References FOOTPRINT::Add(), B_Cu, BOOST_AUTO_TEST_CASE(), BOOST_TEST(), F_Cu, F_SilkS, LAYER_UTILS::GetAllFootprintLayers(), PAD::GetLayerSet(), LAYER_UTILS::GetOrphanedFootprintLayers(), In1_Cu, LSET::InternalCuMask(), PAD, PTH, Rescue, PAD::SetAttribute(), PCB_SHAPE::SetLayer(), and LSET::UserDefinedLayersMask().