|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <algorithm>#include <filesystem>#include <fstream>#include <iterator>#include <set>#include <string>#include <vector>#include <base_units.h>#include <board.h>#include <board_commit.h>#include <board_design_settings.h>#include <drc/drc_engine.h>#include <footprint.h>#include <generators/pcb_via_stitch.h>#include <geometry/shape_circle.h>#include <netinfo.h>#include <pad.h>#include <pcb_track.h>#include <settings/settings_manager.h>#include <tool/tool_manager.h>#include <zone.h>#include <zones.h>#include <pcbnew_utils/board_file_utils.h>#include <pcbnew_utils/board_test_utils.h>#include <qa_utils/wx_utils/unit_test_utils.h>Go to the source code of this file.
Classes | |
| struct | STITCH_FIXTURE_BASE |
| struct | STITCH_SYNTHETIC_FIXTURE |
| struct | STITCH_UPDATE_FIXTURE |
| struct | STITCH_PARTIAL_LAYER_FIXTURE |
| struct | STITCH_BOARD_FIXTURE |
Functions | |
| static SHAPE_POLY_SET | makeRectPoly (int aX1, int aY1, int aX2, int aY2) |
| static void | configureStitch (PCB_VIA_STITCH *aStitch) |
| static void | checkOutlinesEqual (const SHAPE_POLY_SET &aExpected, const SHAPE_POLY_SET &aActual) |
| BOOST_AUTO_TEST_CASE (BakedPatternConstantsLocked) | |
| BOOST_AUTO_TEST_CASE (GuardEnvelopeSampling) | |
| BOOST_AUTO_TEST_CASE (GuardEnvelopeCoversBothSidesAtCoarsePitch) | |
| BOOST_AUTO_TEST_CASE (PropertiesRoundTrip) | |
| BOOST_AUTO_TEST_CASE (SexprSaveLoad) | |
| BOOST_AUTO_TEST_CASE (ExclusionsClearedOnLayoutOrModeChange) | |
| BOOST_AUTO_TEST_CASE (NegativeGridCellsRoundTrip) | |
| BOOST_FIXTURE_TEST_CASE (LayoutRoundTripKeepsGridAnchored, STITCH_UPDATE_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (PitchChangeKeepsGridAnchored, STITCH_UPDATE_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (UpdateDeltaStability, STITCH_UPDATE_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (UpdateRespectsExclusions, STITCH_UPDATE_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (ClearAllExclusionsRestoresEveryVia, STITCH_UPDATE_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (PartialOuterPourStillStitchesInnerPlanes, STITCH_PARTIAL_LAYER_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (PartialTopPourStillStitchesInnerPlanes, STITCH_BOARD_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (PadsBlockStitchingWithSolidZoneConnections, STITCH_BOARD_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (FootprintRuleAreaBlocksStitchVias, STITCH_BOARD_FIXTURE) | |
| BOOST_AUTO_TEST_CASE | ( | BakedPatternConstantsLocked | ) |
Definition at line 93 of file test_via_stitch.cpp.
References PCB_VIA_STITCH::bakedPoissonTile(), BOOST_CHECK_EQUAL(), empty(), PCB_VIA_STITCH::POISSON_TILE_PITCHES, and PCB_VIA_STITCH::POISSON_TILE_SEED.
| BOOST_AUTO_TEST_CASE | ( | ExclusionsClearedOnLayoutOrModeChange | ) |
Definition at line 329 of file test_via_stitch.cpp.
References BOARD::Add(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, configureStitch(), PCB_VIA_STITCH::ExcludePosition(), STRING_ANY_MAP::get_opt(), PCB_VIA_STITCH::GetProperties(), GUARD, PCB_VIA_STITCH::HasExclusions(), pcbIUScale, PLAIN, POISSON, PCB_VIA_STITCH::SetLayout(), PCB_VIA_STITCH::SetMode(), EDA_ITEM::SetParent(), PCB_VIA_STITCH::SetProperties(), STAGGERED, and STITCH.
| BOOST_AUTO_TEST_CASE | ( | GuardEnvelopeCoversBothSidesAtCoarsePitch | ) |
Definition at line 166 of file test_via_stitch.cpp.
References makeRectPoly(), pcbIUScale, and PCB_VIA_STITCH::SampleGuardEnvelope().
| BOOST_AUTO_TEST_CASE | ( | GuardEnvelopeSampling | ) |
Definition at line 103 of file test_via_stitch.cpp.
References SHAPE_POLY_SET::Collide(), empty(), makeRectPoly(), pcbIUScale, PCB_VIA_STITCH::SampleGuardEnvelope(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | NegativeGridCellsRoundTrip | ) |
Definition at line 428 of file test_via_stitch.cpp.
References BOARD::Add(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), configureStitch(), PCB_VIA_STITCH::ExcludePosition(), STRING_ANY_MAP::get_opt(), PCB_VIA_STITCH::GetProperties(), pcbIUScale, PLAIN, PCB_VIA_STITCH::SetLayout(), EDA_ITEM::SetParent(), and PCB_VIA_STITCH::SetProperties().
| BOOST_AUTO_TEST_CASE | ( | PropertiesRoundTrip | ) |
Definition at line 224 of file test_via_stitch.cpp.
References BOARD::Add(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), checkOutlinesEqual(), configureStitch(), PCB_VIA_STITCH::ExcludePosition(), STRING_ANY_MAP::get_opt(), PCB_VIA_STITCH::GetLayout(), PCB_VIA_STITCH::GetMode(), PCB_VIA_STITCH::GetNetCode(), PCB_VIA_STITCH::GetPitch(), PCB_VIA_STITCH::GetProperties(), PCB_VIA_STITCH::GetSeed(), PCB_GENERATOR_POLY::Outline(), pcbIUScale, EDA_ITEM::SetParent(), and PCB_VIA_STITCH::SetProperties().
| BOOST_AUTO_TEST_CASE | ( | SexprSaveLoad | ) |
Definition at line 258 of file test_via_stitch.cpp.
References SHAPE_POLY_SET::Append(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), checkOutlinesEqual(), configureStitch(), KI_TEST::DumpBoardToFile(), PCB_VIA_STITCH::ExcludePosition(), F_Cu, STRING_ANY_MAP::get_opt(), PCB_VIA_STITCH::GetLayout(), PCB_VIA_STITCH::GetMode(), NETINFO_ITEM::GetNetCode(), PCB_VIA_STITCH::GetNetCode(), PCB_VIA_STITCH::GetPitch(), PCB_VIA_STITCH::GetProperties(), PCB_VIA_STITCH::GetSeed(), PCB_VIA_STITCH::GetViaDrill(), PCB_VIA_STITCH::GetViaSize(), SHAPE_POLY_SET::NewOutline(), PCB_GENERATOR_POLY::Outline(), ZONE::Outline(), path, pcbIUScale, KI_TEST::ReadBoardFromFileOrStream(), ZONE::SetLayer(), ZONE::SetNetCode(), and text.
| BOOST_FIXTURE_TEST_CASE | ( | ClearAllExclusionsRestoresEveryVia | , |
| STITCH_UPDATE_FIXTURE | ) |
Definition at line 774 of file test_via_stitch.cpp.
References BOOST_CHECK_EQUAL(), and PCB_VIA_T.
| BOOST_FIXTURE_TEST_CASE | ( | FootprintRuleAreaBlocksStitchVias | , |
| STITCH_BOARD_FIXTURE | ) |
Definition at line 965 of file test_via_stitch.cpp.
References SHAPE_POLY_SET::BBox(), SHAPE_POLY_SET::BooleanSubtract(), SHAPE_POLY_SET::BuildBBoxCaches(), SHAPE_POLY_SET::Contains(), ZONE::GetBoardOutline(), ZONE::GetLibraryOutline(), BOX2< Vec >::Intersects(), SHAPE_POLY_SET::IsEmpty(), and pcbIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | LayoutRoundTripKeepsGridAnchored | , |
| STITCH_UPDATE_FIXTURE | ) |
Definition at line 625 of file test_via_stitch.cpp.
References BOOST_CHECK_EQUAL(), PLAIN, and POISSON.
| BOOST_FIXTURE_TEST_CASE | ( | PadsBlockStitchingWithSolidZoneConnections | , |
| STITCH_BOARD_FIXTURE | ) |
Definition at line 905 of file test_via_stitch.cpp.
References B_Cu, BOOST_REQUIRE(), empty(), F_Cu, FULL, pad, PCB_VIA_T, pcbIUScale, and via.
| BOOST_FIXTURE_TEST_CASE | ( | PartialOuterPourStillStitchesInnerPlanes | , |
| STITCH_PARTIAL_LAYER_FIXTURE | ) |
Definition at line 824 of file test_via_stitch.cpp.
References pcbIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | PartialTopPourStillStitchesInnerPlanes | , |
| STITCH_BOARD_FIXTURE | ) |
Definition at line 851 of file test_via_stitch.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SHAPE_POLY_SET::Contains(), empty(), SHAPE_POLY_SET::Outline(), PCB_VIA_T, pcbIUScale, and via.
| BOOST_FIXTURE_TEST_CASE | ( | PitchChangeKeepsGridAnchored | , |
| STITCH_UPDATE_FIXTURE | ) |
Definition at line 652 of file test_via_stitch.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), and pcbIUScale.
| BOOST_FIXTURE_TEST_CASE | ( | UpdateDeltaStability | , |
| STITCH_UPDATE_FIXTURE | ) |
Definition at line 676 of file test_via_stitch.cpp.
References PCB_VIA_T, pcbIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_FIXTURE_TEST_CASE | ( | UpdateRespectsExclusions | , |
| STITCH_UPDATE_FIXTURE | ) |
Definition at line 718 of file test_via_stitch.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), PCB_VIA::GetPosition(), EDA_ITEM::m_Uuid, and PCB_VIA_T.
|
static |
Definition at line 79 of file test_via_stitch.cpp.
References actual, BOOST_CHECK_EQUAL(), SHAPE_POLY_SET::COutline(), expected, and SHAPE_POLY_SET::OutlineCount().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 65 of file test_via_stitch.cpp.
References PADSTACK::ALL_LAYERS, makeRectPoly(), pcbIUScale, PCB_VIA::SetDrill(), PCB_VIA_STITCH::SetLayout(), PCB_VIA_STITCH::SetMode(), PCB_VIA_STITCH::SetNetCode(), PCB_GENERATOR_POLY::SetOutline(), PCB_VIA_STITCH::SetPitch(), PCB_VIA_STITCH::SetSeed(), PCB_VIA::SetWidth(), STAGGERED, STITCH, and PCB_VIA_STITCH::ViaTemplate().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and STITCH_SYNTHETIC_FIXTURE::finishSetup().
|
static |
Definition at line 53 of file test_via_stitch.cpp.
References SHAPE_POLY_SET::Append(), makeRectPoly(), and SHAPE_POLY_SET::NewOutline().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), configureStitch(), and makeRectPoly().