|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <board.h>#include <board_design_settings.h>#include <drc/drc_engine.h>#include <drc/drc_rule.h>#include <settings/json_settings.h>#include <settings/json_settings_internals.h>#include <settings/settings_manager.h>#include <pcbnew_utils/board_test_utils.h>#include <json_common.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (NegativeSilkClearanceRoundTrip) | |
| Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23327. | |
| BOOST_AUTO_TEST_CASE (BiggestClearanceIncludesPhysicalHoleClearance) | |
| Regression test: physical_hole_clearance must count toward the worst-case clearance. | |
| BOOST_AUTO_TEST_CASE (PredefinedTrackWidthCyclingMonotonic) | |
| BOOST_AUTO_TEST_CASE (PredefinedViaSizeCyclingMonotonic) | |
| BOOST_AUTO_TEST_CASE (PredefinedDiffPairCyclingMonotonic) | |
| BOOST_AUTO_TEST_CASE (TrackWidthSwitchAdvancesFromConnectedWidth) | |
| BOOST_AUTO_TEST_CASE (SeededBoardValueSurvivesRoundTrip) | |
| Highest-risk path of the #24402 fix. | |
| BOOST_AUTO_TEST_CASE | ( | BiggestClearanceIncludesPhysicalHoleClearance | ) |
Regression test: physical_hole_clearance must count toward the worst-case clearance.
GetBiggestClearanceValue() seeds the interactive router's broad-phase search radius. It previously omitted PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, so a physical_hole_clearance rule did not widen that radius. The router then discovered the hole only once a track was already well inside the rule distance, reacting far too late. The worst-case value must be at least the rule's minimum.
Definition at line 98 of file test_board_design_settings.cpp.
References BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue(), BOARD_DESIGN_SETTINGS::m_DRCEngine, pcbIUScale, PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, MINOPTMAX< T >::SetMin(), and DRC_CONSTRAINT::Value().
| BOOST_AUTO_TEST_CASE | ( | NegativeSilkClearanceRoundTrip | ) |
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23327.
Negative silk clearance values must survive a save/load round-trip through the project settings JSON. Previously the PARAM_SCALED lower bound was 0, causing negative values to be reset to the default on load.
Definition at line 69 of file test_board_design_settings.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), JSON_SETTINGS::Load(), BOARD_DESIGN_SETTINGS::m_SilkClearance, pcbIUScale, and JSON_SETTINGS::Store().
| BOOST_AUTO_TEST_CASE | ( | PredefinedDiffPairCyclingMonotonic | ) |
| BOOST_AUTO_TEST_CASE | ( | PredefinedTrackWidthCyclingMonotonic | ) |
| BOOST_AUTO_TEST_CASE | ( | PredefinedViaSizeCyclingMonotonic | ) |
| BOOST_AUTO_TEST_CASE | ( | SeededBoardValueSurvivesRoundTrip | ) |
Highest-risk path of the #24402 fix.
BOARD_DESIGN_SETTINGS sets m_resetParamsIfMissing = false because its params are seeded from the .kicad_pcb parser before the project JSON loads. A non-default value absent from the project JSON must not be reset on load and must survive a save/reload round-trip through the parent – the "absent-but-default counts as a match" logic must never drop a genuine board value.
Definition at line 288 of file test_board_design_settings.cpp.
References BOOST_CHECK_EQUAL(), BOARD_DESIGN_SETTINGS::LoadFromFile(), BOARD_DESIGN_SETTINGS::m_SilkClearance, pcbIUScale, and NESTED_SETTINGS::SaveToFile().
| BOOST_AUTO_TEST_CASE | ( | TrackWidthSwitchAdvancesFromConnectedWidth | ) |
Definition at line 239 of file test_board_design_settings.cpp.
References BOOST_CHECK_EQUAL(), BOARD_DESIGN_SETTINGS::GetCurrentTrackWidth(), BOARD_DESIGN_SETTINGS::GetNextTrackWidthIndex(), BOARD_DESIGN_SETTINGS::GetTrackWidthIndex(), BOARD_DESIGN_SETTINGS::m_TrackWidthList, pcbIUScale, BOARD_DESIGN_SETTINGS::SetTrackWidthIndex(), and BOARD_DESIGN_SETTINGS::UseCustomTrackViaSize().