KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_pns_basics.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <settings/settings_manager.h>
#include <optional>
#include <pcbnew/board.h>
#include <pcbnew/pad.h>
#include <pcbnew/pcb_track.h>
#include <router/pns_item.h>
#include <router/pns_kicad_iface.h>
#include <router/pns_node.h>
#include <router/pns_router.h>
#include <router/pns_via.h>

Go to the source code of this file.

Classes

class  MOCK_RULE_RESOLVER
 
struct  MOCK_RULE_RESOLVER::ITEM_KEY
 
class  MOCK_PNS_KICAD_IFACE
 
class  PNS_TEST_FIXTURE
 

Functions

static bool isCopper (const PNS::ITEM *aItem)
 
static bool isHole (const PNS::ITEM *aItem)
 
static bool isEdge (const PNS::ITEM *aItem)
 
static void dumpObstacles (const PNS::NODE::OBSTACLES &obstacles)
 
 BOOST_FIXTURE_TEST_CASE (PNSHoleCollisions, PNS_TEST_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (PNSViaBackdrillRetention, PNS_TEST_FIXTURE)
 
 BOOST_AUTO_TEST_CASE (PCBViaBackdrillCloneRetainsData)
 
 BOOST_AUTO_TEST_CASE (PNSLayerRangeSwapBehavior)
 Test that PNS_LAYER_RANGE(1, 0) is swapped to (0, 1).
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( PCBViaBackdrillCloneRetainsData )

Definition at line 457 of file test_pns_basics.cpp.

References B_Cu, BOOST_CHECK_EQUAL(), COUNTERBORE, COUNTERSINK, F_Cu, In2_Cu, In4_Cu, and via.

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( PNSLayerRangeSwapBehavior )

Test that PNS_LAYER_RANGE(1, 0) is swapped to (0, 1).

This is a minimal regression test for https://gitlab.com/kicad/code/kicad/-/issues/20355 The actual fix is in pns_kicad_iface.cpp syncPad() which skips creating an INNER_LAYERS SOLID on 2-layer boards. This test verifies the layer range behavior that motivated the fix.

Definition at line 517 of file test_pns_basics.cpp.

References BOOST_CHECK_EQUAL(), PNS_LAYER_RANGE::End(), PNS_LAYER_RANGE::Overlaps(), and PNS_LAYER_RANGE::Start().

◆ BOOST_FIXTURE_TEST_CASE() [1/2]

BOOST_FIXTURE_TEST_CASE ( PNSHoleCollisions ,
PNS_TEST_FIXTURE  )

Definition at line 339 of file test_pns_basics.cpp.

References B_Cu, BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), dumpObstacles(), F_Cu, v1, and v2.

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

BOOST_FIXTURE_TEST_CASE ( PNSViaBackdrillRetention ,
PNS_TEST_FIXTURE  )

◆ dumpObstacles()

static void dumpObstacles ( const PNS::NODE::OBSTACLES & obstacles)
static

Definition at line 328 of file test_pns_basics.cpp.

References BOOST_TEST_MESSAGE().

Referenced by BOOST_FIXTURE_TEST_CASE().

◆ isCopper()

static bool isCopper ( const PNS::ITEM * aItem)
static

◆ isEdge()

static bool isEdge ( const PNS::ITEM * aItem)
static

◆ isHole()

static bool isHole ( const PNS::ITEM * aItem)
static

Definition at line 72 of file test_pns_basics.cpp.

References PNS::ITEM::HOLE_T, and PNS::ITEM::OfKind().

Referenced by MOCK_RULE_RESOLVER::Clearance().