KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_fabmaster_import.cpp File Reference

Test suite for import of Fabmaster PCB files. More...

Go to the source code of this file.

Classes

struct  FABMASTER_IMPORT_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (EmptyRefdesInPins)
 Test that footprints with pads are properly imported when the REFDES column is empty in the PIN section.
 
 BOOST_AUTO_TEST_CASE (StaticShapesPreserved)
 Test that static shapes (zones with net but no matching outline) are preserved.
 
static const PADfindPadByNumber (const FOOTPRINT *aFp, const wxString &aNumber)
 Helper to find a pad by its number within a footprint.
 
 BOOST_AUTO_TEST_CASE (PadStackDifferentLayers)
 Test that pad-stacks with different shapes on front and back copper layers are imported using FRONT_INNER_BACK padstack mode.
 
 BOOST_AUTO_TEST_CASE (PadStackSameLayers)
 Test that pad-stacks with the same shape on all layers remain in NORMAL mode.
 
 BOOST_AUTO_TEST_CASE (PadStackSmdPad)
 Test SMD pads (top-only, no drill) are imported correctly.
 

Detailed Description

Test suite for import of Fabmaster PCB files.

Definition in file test_fabmaster_import.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( EmptyRefdesInPins )

Test that footprints with pads are properly imported when the REFDES column is empty in the PIN section.

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

When a Fabmaster file is exported from a board with only components and no netlist, the REFDES column in the PIN section is empty. The importer should fall back to using SYM_NAME to match pins with their footprints.

Definition at line 62 of file test_fabmaster_import.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), and KI_TEST::GetPcbnewTestDataDir().

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( PadStackDifferentLayers )

Test that pad-stacks with different shapes on front and back copper layers are imported using FRONT_INNER_BACK padstack mode.

The test file contains: DIFF_PAD - CIRCLE on TOP (2.0mm), RECTANGLE on BOTTOM (1.5x3.0mm) with drill SAME_PAD - RECTANGLE on both TOP and BOTTOM (1.0x2.0mm) with drill SMD_DIFF - OVAL on TOP only (0.8x1.6mm), SMD pad

Definition at line 153 of file test_fabmaster_import.cpp.

References B_Cu, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), CIRCLE, F_Cu, findPadByNumber(), PADSTACK::FRONT_INNER_BACK, PAD::GetAttribute(), PAD::GetDrillSizeX(), KI_TEST::GetPcbnewTestDataDir(), PAD::GetShape(), PAD::GetSize(), PADSTACK::Mode(), FOOTPRINT::Pads(), PAD::Padstack(), PTH, RECTANGLE, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( PadStackSameLayers )

Test that pad-stacks with the same shape on all layers remain in NORMAL mode.

Definition at line 199 of file test_fabmaster_import.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), F_Cu, findPadByNumber(), KI_TEST::GetPcbnewTestDataDir(), PAD::GetShape(), PADSTACK::Mode(), PADSTACK::NORMAL, PAD::Padstack(), and RECTANGLE.

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( PadStackSmdPad )

Test SMD pads (top-only, no drill) are imported correctly.

Definition at line 227 of file test_fabmaster_import.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), F_Cu, findPadByNumber(), PAD::GetAttribute(), KI_TEST::GetPcbnewTestDataDir(), PAD::GetShape(), OVAL, and SMD.

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( StaticShapesPreserved )

Test that static shapes (zones with net but no matching outline) are preserved.

This is a regression test for https://gitlab.com/kicad/code/kicad/-/issues/7753

In Allegro, static shapes are copper areas that don't void around other nets. They appear in Fabmaster as filled areas (with net) but without a corresponding outline (which would have no net). The importer must preserve these as solid filled zones.

The test file contains static shapes on nets like "DO" and "VMBATT3-" that are zero-width closed polygons with net assignments but no matching outline.

Definition at line 101 of file test_fabmaster_import.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), and KI_TEST::GetPcbnewTestDataDir().

◆ findPadByNumber()

static const PAD * findPadByNumber ( const FOOTPRINT * aFp,
const wxString & aNumber )
static

Helper to find a pad by its number within a footprint.

Definition at line 132 of file test_fabmaster_import.cpp.

References pad, and FOOTPRINT::Pads().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().