KiCad PCB EDA Suite
test_pad_numbering.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
25#include <board.h>
26#include <footprint.h>
27#include <pad.h>
28
30{
32 m_board(),
34 {
35 }
36
38 {
40
41 pad.SetAttribute( PAD_ATTRIB::NPTH );
42 pad.SetLayerSet( PAD::UnplatedHoleMask() );
43
44 return pad;
45 }
46
48 {
50
51 pad.SetAttribute( PAD_ATTRIB::PTH );
52 pad.SetLayerSet( PAD::ApertureMask() );
53
54 return pad;
55 }
56
58 {
60
61 pad.SetAttribute( PAD_ATTRIB::SMD );
62 pad.SetLayerSet( PAD::SMDMask() );
63
64 return pad;
65 }
66
69};
70
71
72BOOST_FIXTURE_TEST_SUITE( PadNumbering, PAD_FIXTURE )
73
74
78{
79 auto npth = MakeNPTH();
80 BOOST_CHECK_EQUAL( false, npth.CanHaveNumber() );
81
82 auto aperture = MakeAperture();
83 BOOST_CHECK_EQUAL( false, aperture.CanHaveNumber() );
84
85 auto smd = MakeSmd();
86 BOOST_CHECK_EQUAL( true, smd.CanHaveNumber() );
87}
88
89
90BOOST_AUTO_TEST_SUITE_END()
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
Definition: pad.h:59
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
Definition: pad.cpp:200
static LSET ApertureMask()
layer set for an aperture pad
Definition: pad.cpp:207
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition: pad.cpp:186
@ NPTH
like PAD_PTH, but not plated
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
FOOTPRINT m_footprint
BOOST_AUTO_TEST_CASE(CanNumber)
Check what gets names and what doesn't.