KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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, see <https://www.gnu.org/licenses/>.
18 */
19
21#include <board.h>
22#include <footprint.h>
23#include <pad.h>
24
26{
28 m_board(),
30 {
31 }
32
34 {
36
37 pad.SetAttribute( PAD_ATTRIB::NPTH );
38 pad.SetLayerSet( PAD::UnplatedHoleMask() );
39
40 return pad;
41 }
42
44 {
46
47 pad.SetAttribute( PAD_ATTRIB::PTH );
48 pad.SetLayerSet( PAD::ApertureMask() );
49
50 return pad;
51 }
52
54 {
56
57 pad.SetAttribute( PAD_ATTRIB::SMD );
58 pad.SetLayerSet( PAD::SMDMask() );
59
60 return pad;
61 }
62
65};
66
67
68BOOST_FIXTURE_TEST_SUITE( PadNumbering, PAD_FIXTURE )
69
70
74{
75 auto npth = MakeNPTH();
76 BOOST_CHECK_EQUAL( false, npth.CanHaveNumber() );
77
78 auto aperture = MakeAperture();
79 BOOST_CHECK_EQUAL( false, aperture.CanHaveNumber() );
80
81 auto smd = MakeSmd();
82 BOOST_CHECK_EQUAL( true, smd.CanHaveNumber() );
83}
84
85
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
Definition pad.h:61
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
Definition pad.cpp:600
static LSET ApertureMask()
layer set for an aperture pad
Definition pad.cpp:607
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition pad.cpp:586
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition padstack.h:103
@ SMD
Smd pad, appears on the solder paste layer (default)
Definition padstack.h:99
@ PTH
Plated through hole pad.
Definition padstack.h:98
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")