|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <boost/test/data/test_case.hpp>#include <pcbnew_utils/board_test_utils.h>#include <board.h>#include <board_commit.h>#include <board_design_settings.h>#include <pad.h>#include <pcb_track.h>#include <footprint.h>#include <zone.h>#include <drc/drc_item.h>#include <settings/settings_manager.h>#include <geometry/shape_poly_set.h>#include <advanced_config.h>#include <connectivity/connectivity_data.h>#include <teardrop/teardrop.h>Go to the source code of this file.
Classes | |
| struct | ZONE_FILL_TEST_FIXTURE |
Functions | |
| BOOST_FIXTURE_TEST_CASE (BasicZoneFills, ZONE_FILL_TEST_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (NotchedZones, ZONE_FILL_TEST_FIXTURE) | |
| BOOST_DATA_TEST_CASE_F (ZONE_FILL_TEST_FIXTURE, RegressionZoneFillTests, boost::unit_test::data::make(RegressionZoneFillTests_tests), relPath) | |
| BOOST_DATA_TEST_CASE_F (ZONE_FILL_TEST_FIXTURE, RegressionSliverZoneFillTests, boost::unit_test::data::make(RegressionSliverZoneFillTests_tests), relPath) | |
| BOOST_DATA_TEST_CASE_F (ZONE_FILL_TEST_FIXTURE, RegressionTeardropFill, boost::unit_test::data::make(RegressionTeardropFill_tests), test) | |
| BOOST_FIXTURE_TEST_CASE (RegressionNetTie, ZONE_FILL_TEST_FIXTURE) | |
| BOOST_FIXTURE_TEST_CASE (RegressionZonePriorityIsolatedIslands, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 21746: Lower priority zones should fill areas where higher priority zones have isolated islands that get removed. | |
| BOOST_FIXTURE_TEST_CASE (RegressionViaFlashingUnreachableZone, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 22010: Via annular rings should not appear on zone layers when the zone fill doesn't actually reach the via. | |
| BOOST_FIXTURE_TEST_CASE (RegressionViaZoneNetShort, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 12964: Vias with remove_unused_layers should not flash on layers where they would short to a zone with a different net. | |
| BOOST_FIXTURE_TEST_CASE (HatchZoneThermalConnectivity, ZONE_FILL_TEST_FIXTURE) | |
| Test that hatch zone thermal reliefs maintain connectivity even when the hatch gap is larger than the thermal ring diameter. | |
| BOOST_FIXTURE_TEST_CASE (RegressionShallowArcZoneFill, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 22475: Zone fill should not produce artifacts when tracks contain shallow-radius arcs (where the mid-point is nearly collinear with start and end). | |
| BOOST_FIXTURE_TEST_CASE (RegressionIterativeRefillRespectsKeepouts, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 22809: Zone keepouts should be respected by iterative refiller. | |
| BOOST_FIXTURE_TEST_CASE (RegressionTHPadInnerLayerFlashing, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 22826: TH pads with remove_unused_layers should properly flash on inner layers when inside a zone of the same net. | |
| BOOST_FIXTURE_TEST_CASE (RegressionRoundRectTeardropGeometry, ZONE_FILL_TEST_FIXTURE) | |
| Test for issue 19405: Rounded teardrop geometry should not create concave shapes when connecting to rounded rectangle pads at corners. | |
| BOOST_FIXTURE_TEST_CASE (OvalPadTeardropGeometry, ZONE_FILL_TEST_FIXTURE) | |
| Test that teardrops connecting to oval pads at their curved ends have proper tangent curves. | |
| BOOST_FIXTURE_TEST_CASE (LargeCircleTeardropGeometry, ZONE_FILL_TEST_FIXTURE) | |
| Test that teardrops connecting to large circular pads maintain proper tangent contact. | |
Variables | |
| int | delta = KiROUND( 0.006 * pcbIUScale.IU_PER_MM ) |
| static const std::vector< wxString > | RegressionZoneFillTests_tests |
| static const std::vector< wxString > | RegressionSliverZoneFillTests_tests |
| static const std::vector< std::pair< wxString, int > > | RegressionTeardropFill_tests |
| BOOST_DATA_TEST_CASE_F | ( | ZONE_FILL_TEST_FIXTURE | , |
| RegressionSliverZoneFillTests | , | ||
| boost::unit_test::data::make(RegressionSliverZoneFillTests_tests) | , | ||
| relPath | ) |
Definition at line 239 of file test_zone_filler.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), DRCE_COPPER_SLIVER, KI_TEST::FillZones(), INCH, KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, MM, pcbIUScale, RegressionSliverZoneFillTests_tests, RPT_SEVERITY_ERROR, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().
| BOOST_DATA_TEST_CASE_F | ( | ZONE_FILL_TEST_FIXTURE | , |
| RegressionTeardropFill | , | ||
| boost::unit_test::data::make(RegressionTeardropFill_tests) | , | ||
| test | ) |
Definition at line 286 of file test_zone_filler.cpp.
References KI_TEST::FillZones(), KI_TEST::LoadBoard(), and RegressionTeardropFill_tests.
| BOOST_DATA_TEST_CASE_F | ( | ZONE_FILL_TEST_FIXTURE | , |
| RegressionZoneFillTests | , | ||
| boost::unit_test::data::make(RegressionZoneFillTests_tests) | , | ||
| relPath | ) |
Definition at line 193 of file test_zone_filler.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), DRCE_CLEARANCE, KI_TEST::FillZones(), INCH, KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, MM, pcbIUScale, RegressionZoneFillTests_tests, RPT_SEVERITY_ERROR, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().
| BOOST_FIXTURE_TEST_CASE | ( | BasicZoneFills | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Definition at line 56 of file test_zone_filler.cpp.
References PADSTACK::ALL_LAYERS, BOOST_CHECK_EQUAL(), delta, DRCE_CLEARANCE, KI_TEST::FillZones(), PAD::GetNumber(), DRC_ENGINE::InitEngine(), KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, EDA_ITEM::m_Uuid, MM, pad, PCB_ARC_T, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().
| BOOST_FIXTURE_TEST_CASE | ( | HatchZoneThermalConnectivity | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test that hatch zone thermal reliefs maintain connectivity even when the hatch gap is larger than the thermal ring diameter.
The test board has:
Without the fix, the thermal ring around the pad could be entirely inside a hatch hole, leaving it electrically isolated from the zone webbing.
Definition at line 610 of file test_zone_filler.cpp.
References KI_TEST::FillZones(), and KI_TEST::LoadBoard().
| BOOST_FIXTURE_TEST_CASE | ( | LargeCircleTeardropGeometry | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test that teardrops connecting to large circular pads maintain proper tangent contact.
When a circle is larger than the configured teardrop max width, the anchor points should still be on the actual circle edge (not on a clipped boundary) to ensure the teardrop curve is tangent to the circle.
Definition at line 1042 of file test_zone_filler.cpp.
References _, std::abs(), BOOST_TEST_MESSAGE(), chain, CIRCLE, COMMIT::Empty(), F_Cu, PAD::GetPosition(), PAD::GetSize(), KI_TEST::LoadBoard(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, TEARDROP_MANAGER::UpdateTeardrops(), v1, v2, and VECTOR2< T >::x.
| BOOST_FIXTURE_TEST_CASE | ( | NotchedZones | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Definition at line 149 of file test_zone_filler.cpp.
References SHAPE_POLY_SET::BooleanAdd(), BOOST_CHECK_EQUAL(), F_Cu, KI_TEST::FillZones(), KI_TEST::LoadBoard(), and SHAPE_POLY_SET::OutlineCount().
| BOOST_FIXTURE_TEST_CASE | ( | OvalPadTeardropGeometry | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test that teardrops connecting to oval pads at their curved ends have proper tangent curves.
Oval pads have semicircular ends. When a track connects to the curved end, the teardrop curve should be tangent to the semicircle, similar to how rounded rectangle corners are handled.
Definition at line 964 of file test_zone_filler.cpp.
References _, BOOST_TEST_MESSAGE(), chain, COMMIT::Empty(), KI_TEST::LoadBoard(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, TEARDROP_MANAGER::UpdateTeardrops(), v1, and v2.
| BOOST_FIXTURE_TEST_CASE | ( | RegressionIterativeRefillRespectsKeepouts | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 22809: Zone keepouts should be respected by iterative refiller.
The test board has:
Before the fix, when iterative refill was enabled (ADVANCED_CFG::m_ZoneFillIterativeRefill), zone keepouts were being completely ignored because the code path that handled keepouts (buildCopperItemClearances with aIncludeZoneClearances=true) was skipped when iterative refill was enabled. Additionally, refillZoneFromCache did not subtract keepouts.
Definition at line 707 of file test_zone_filler.cpp.
References std::abs(), SHAPE_LINE_CHAIN::Area(), SHAPE_POLY_SET::BooleanIntersection(), BOOST_TEST_MESSAGE(), SHAPE_POLY_SET::ClearArcs(), KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), KI_TEST::LoadBoard(), ADVANCED_CFG::m_ZoneFillIterativeRefill, SHAPE_POLY_SET::Outline(), and SHAPE_POLY_SET::OutlineCount().
| BOOST_FIXTURE_TEST_CASE | ( | RegressionNetTie | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Definition at line 312 of file test_zone_filler.cpp.
References clearance, KI_TEST::FillZones(), KI_TEST::LoadBoard(), and pad.
| BOOST_FIXTURE_TEST_CASE | ( | RegressionRoundRectTeardropGeometry | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 19405: Rounded teardrop geometry should not create concave shapes when connecting to rounded rectangle pads at corners.
The test board has a rounded rectangle pad with a track connecting to its short side (hitting the corner radius). With curved teardrops enabled, the teardrop should not intersect the pad's corner radius, which would create sharp inside corners.
Definition at line 877 of file test_zone_filler.cpp.
References _, BOOST_TEST_MESSAGE(), chain, COMMIT::Empty(), KI_TEST::LoadBoard(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, TEARDROP_MANAGER::UpdateTeardrops(), v1, and v2.
| BOOST_FIXTURE_TEST_CASE | ( | RegressionShallowArcZoneFill | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 22475: Zone fill should not produce artifacts when tracks contain shallow-radius arcs (where the mid-point is nearly collinear with start and end).
The test board has:
Before the fix, these shallow arcs caused TransformArcToPolygon to compute extremely large radii, leading to integer overflow and invalid clearance hole geometry. This resulted in phantom voids and disconnected fill areas in the zone.
The fix treats arcs with mid-point distance <= 250µm from the chord as straight line segments, avoiding numerical instability.
Definition at line 645 of file test_zone_filler.cpp.
References std::abs(), SHAPE_POLY_SET::Area(), BOOST_CHECK_EQUAL(), KI_TEST::FillZones(), ZONE::GetFilledPolysList(), ZONE::HasFilledPolysForLayer(), KI_TEST::LoadBoard(), and ZONE::Outline().
| BOOST_FIXTURE_TEST_CASE | ( | RegressionTHPadInnerLayerFlashing | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 22826: TH pads with remove_unused_layers should properly flash on inner layers when inside a zone of the same net.
The test board has:
Before the fix, the zone filler checked if fill->Contains(pad_center) without tolerance, which would fail because the fill has a thermal relief cutout around the pad. The fix uses the pad's drill radius as tolerance, similar to how vias are handled.
Definition at line 801 of file test_zone_filler.cpp.
References BOOST_TEST_MESSAGE(), KI_TEST::FillZones(), KI_TEST::LoadBoard(), and pad.
| BOOST_FIXTURE_TEST_CASE | ( | RegressionViaFlashingUnreachableZone | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 22010: Via annular rings should not appear on zone layers when the zone fill doesn't actually reach the via.
The test board has:
Before the fix, vias within the zone outline would flash even if the zone fill didn't reach them due to obstacles (tracks). This caused false DRC violations for clearances and blocked dense routing near the vias.
Definition at line 435 of file test_zone_filler.cpp.
References BOOST_TEST_MESSAGE(), KI_TEST::FillZones(), KI_TEST::LoadBoard(), PCB_VIA_T, and via.
| BOOST_FIXTURE_TEST_CASE | ( | RegressionViaZoneNetShort | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 12964: Vias with remove_unused_layers should not flash on layers where they would short to a zone with a different net.
The test board has:
After zone fill, the vias should NOT flash on F.Cu in areas covered by the +3.3V zone, as that would short GND to +3.3V.
Definition at line 532 of file test_zone_filler.cpp.
References BOOST_TEST_MESSAGE(), KI_TEST::FillZones(), KI_TEST::LoadBoard(), PCB_VIA_T, via, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_FIXTURE_TEST_CASE | ( | RegressionZonePriorityIsolatedIslands | , |
| ZONE_FILL_TEST_FIXTURE | ) |
Test for issue 21746: Lower priority zones should fill areas where higher priority zones have isolated islands that get removed.
The test board has:
The VDD zone only connects to a small area, creating an isolated island that should be removed. The GND zone should then fill that area.
With the bug, GND is knocked out by VDD before VDD's isolated island is removed, leaving GND mostly empty.
Definition at line 362 of file test_zone_filler.cpp.
References SHAPE_LINE_CHAIN::Area(), BOOST_TEST_MESSAGE(), ZONE::CalculateFilledArea(), KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), ZONE::GetFilledArea(), KI_TEST::LoadBoard(), ADVANCED_CFG::m_ZoneFillIterativeRefill, SHAPE_POLY_SET::Outline(), and SHAPE_POLY_SET::OutlineCount().
| int delta = KiROUND( 0.006 * pcbIUScale.IU_PER_MM ) |
Definition at line 53 of file test_zone_filler.cpp.
Referenced by SYMBOL_EDITOR_MOVE_TOOL::AlignElements(), AlignSchematicItemsToGrid(), SCH_MOVE_TOOL::AlignToGrid(), EC_PERPLINE::Apply(), PNS::ApproximateSegmentAsRect(), PDF_PLOTTER::arcPath(), arcPts(), BezierToPolyline(), BOOST_FIXTURE_TEST_CASE(), PNS::DP_GATEWAYS::buildDpContinuation(), PCB_IO_KICAD_SEXPR_PARSER::checkpoint(), CircleToEndSegmentDeltaRadius(), LENGTH_DELAY_CALCULATION::clipLineToPad(), Collide(), Collide(), Collide(), Collide(), Collide(), SHAPE_POLY_SET::CollideVertex(), commitSnapshotWithLock(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COUPLED_MICROSTRIP::conductor_losses(), MICROSTRIP::conductor_losses(), ConnectBoardShapes(), ConvertArcToPolyline(), ConvertArcToPolyline(), GERBER_DRAW_ITEM::ConvertSegmentToPolygon(), AM_PRIMITIVE::ConvertShapeToPolygon(), D_CODE::ConvertShapeToPolygon(), PNS::coupledBypass(), BOARD_ADAPTER::createArcSegments(), EXCELLON_WRITER::createDrillFile(), ALIGN_DISTRIBUTE_TOOL::doDistributeCenters(), ALIGN_DISTRIBUTE_TOOL::doDistributeGaps(), SCH_MOVE_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawDimension(), D_CODE::DrawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), DrawHalfOpenCylinder(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineDashed(), editArcEndpointKeepTangent(), fillArcGBRITEM(), PSLIKE_PLOTTER::FlashPadOval(), PCB_IO_KICAD_SEXPR::format(), RENDER_3D_OPENGL::generate3dGrid(), RENDER_3D_OPENGL::generateDimple(), RENDER_3D_OPENGL::generateDisk(), RENDER_3D_OPENGL::generateRing(), KIBIS_MODEL::generateSquareWave(), PCB_DIM_ALIGNED::GetAngle(), SCH_NO_CONNECT::GetBoundingBox(), GetDeltasForDistributeByGaps(), GetDeltasForDistributeByPoints(), KIGIT_COMMON::GetDifferentFiles(), SNAP_LINE_MANAGER::GetNearestSnapLinePoint(), BOARD::GetPad(), SCH_FIELD::GetRenderCache(), GERBER_DRAW_ITEM::GetTextD_CodePrms(), PAD::HitTest(), PAD::HitTest(), SCH_NO_CONNECT::HitTest(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), SCH_DRAWING_TOOLS::ImportSheet(), SCH_MOVE_TOOL::initializeMoveOperation(), CYLINDER::Intersect(), CYLINDER::IntersectP(), BOX2< VECTOR2I >::Intersects(), BEZIER_POLY::isFlat(), PNS::IsSegment45Degree(), CADSTAR_SCH_ARCHIVE_LOADER::loadLibPart(), PCB_IO_EAGLE::loadPlain(), PCB_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), SCH_SELECTION_TOOL::Main(), DSN::SPECCTRA_DB::makePADSTACK(), TRANSFORM::MapAngles(), MapAnglesV6(), SCH_DIRECTIVE_LABEL::MirrorHorizontally(), SCH_LABEL_BASE::MirrorHorizontally(), SCH_DIRECTIVE_LABEL::MirrorSpinStyle(), SCH_LABEL_BASE::MirrorSpinStyle(), SCH_DIRECTIVE_LABEL::MirrorVertically(), SCH_LABEL_BASE::MirrorVertically(), mpInfoLayer::Move(), PNS::HOLE::Move(), SCH_ALIGN_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), NearestPoints(), SCH_TEXT::NormalizeJustification(), DIALOG_SHIM::OnCharHook(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onScroll(), PCB_POINT_EDITOR::OnSelectionChange(), KIGFX::WX_VIEW_CONTROLS::onWheel(), PCB_IO_EAGLE::packageCircle(), PCB_IO_EAGLE::packagePolygon(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseContour(), GPCB_FPL_CACHE::parseFOOTPRINT(), EASYEDA_PARSER_BASE::ParseLineChains(), PCB_IO_KICAD_SEXPR_PARSER::parsePAD(), PCB_IO_KICAD_SEXPR_PARSER::parsePadstack(), PCB_IO_EASYEDAPRO_PARSER::ParsePoly(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_NO_CONNECT::Plot(), PLOTTER::polyArc(), SCH_SHEET_PIN::Rotate(), CURSOR::SetCoordX(), SCH_LINE::SetLength(), PNS::SOLID::SetPos(), FOOTPRINT::SetPosition(), PCB_BARCODE::SetPosition(), PCB_GROUP::SetPosition(), SCH_GROUP::SetPosition(), SCH_SHEET::SetPositionIgnoringPins(), PCB_BARCODE::SetRect(), KIGFX::VIEW::SetScale(), PCB_TEXTBOX::SetTextAngle(), GRID_HELPER::SnapToConstructionLines(), COUPLED_STRIPLINE::Synthesize(), TestSegmentHit(), BEZIER_POLY::thirdControlPointDeviation(), KIGFX::COLOR4D::ToHSV(), DIALOG_PAD_PROPERTIES::transferDataToPad(), TransformCircleToPolygon(), TransformCircleToPolygon(), TransformOvalToPolygon(), PAD::TransformShapeToPolygon(), SETTINGS_MANAGER::TriggerBackupIfNeeded(), DIM_LEADER_POINT_EDIT_BEHAVIOR::UpdateItem(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR::UpdateItem(), BOARD_INSPECTION_TOOL::UpdateLocalRatsnest(), and PCB_PROPERTIES_PANEL::valueChanged().
|
static |
Definition at line 234 of file test_zone_filler.cpp.
Referenced by BOOST_DATA_TEST_CASE_F().
|
static |
Definition at line 281 of file test_zone_filler.cpp.
Referenced by BOOST_DATA_TEST_CASE_F().
|
static |
Definition at line 175 of file test_zone_filler.cpp.
Referenced by BOOST_DATA_TEST_CASE_F().