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, 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
24
#include <
qa_utils/wx_utils/unit_test_utils.h
>
25
#include <
board.h
>
26
#include <
footprint.h
>
27
#include <
pad.h
>
28
29
struct
PAD_FIXTURE
30
{
31
PAD_FIXTURE
() :
32
m_board
(),
33
m_footprint
( &
m_board
)
34
{
35
}
36
37
PAD
MakeNPTH
()
38
{
39
PAD
pad
( &
m_footprint
);
40
41
pad
.SetAttribute(
PAD_ATTRIB::NPTH
);
42
pad
.SetLayerSet(
PAD::UnplatedHoleMask
() );
43
44
return
pad
;
45
}
46
47
PAD
MakeAperture
()
48
{
49
PAD
pad
( &
m_footprint
);
50
51
pad
.SetAttribute(
PAD_ATTRIB::PTH
);
52
pad
.SetLayerSet(
PAD::ApertureMask
() );
53
54
return
pad
;
55
}
56
57
PAD
MakeSmd
()
58
{
59
PAD
pad
( &
m_footprint
);
60
61
pad
.SetAttribute(
PAD_ATTRIB::SMD
);
62
pad
.SetLayerSet(
PAD::SMDMask
() );
63
64
return
pad
;
65
}
66
67
BOARD
m_board
;
68
FOOTPRINT
m_footprint
;
69
};
70
71
72
BOOST_FIXTURE_TEST_SUITE( PadNumbering,
PAD_FIXTURE
)
73
74
77
BOOST_AUTO_TEST_CASE
( CanNumber )
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
90
BOOST_AUTO_TEST_SUITE_END
()
BITMAPS::pad
@ pad
Definition
bitmaps_list.h:415
board.h
BOARD
Information pertinent to a Pcbnew printed circuit board.
Definition
board.h:322
FOOTPRINT
Definition
footprint.h:137
PAD
Definition
pad.h:54
PAD::UnplatedHoleMask
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
Definition
pad.cpp:312
PAD::ApertureMask
static LSET ApertureMask()
layer set for an aperture pad
Definition
pad.cpp:319
PAD::SMDMask
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition
pad.cpp:298
footprint.h
pad.h
PAD_ATTRIB::NPTH
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition
padstack.h:87
PAD_ATTRIB::SMD
@ SMD
Smd pad, appears on the solder paste layer (default)
Definition
padstack.h:83
PAD_ATTRIB::PTH
@ PTH
Plated through hole pad.
Definition
padstack.h:82
PAD_FIXTURE
Definition
test_pad_numbering.cpp:30
PAD_FIXTURE::m_board
BOARD m_board
Definition
test_pad_numbering.cpp:67
PAD_FIXTURE::MakeNPTH
PAD MakeNPTH()
Definition
test_pad_numbering.cpp:37
PAD_FIXTURE::PAD_FIXTURE
PAD_FIXTURE()
Definition
test_pad_numbering.cpp:31
PAD_FIXTURE::MakeSmd
PAD MakeSmd()
Definition
test_pad_numbering.cpp:57
PAD_FIXTURE::MakeAperture
PAD MakeAperture()
Definition
test_pad_numbering.cpp:47
PAD_FIXTURE::m_footprint
FOOTPRINT m_footprint
Definition
test_pad_numbering.cpp:68
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
Definition
test_api_enums.cpp:134
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(result, "25.4")
unit_test_utils.h
src
qa
tests
pcbnew
test_pad_numbering.cpp
Generated on Mon Oct 13 2025 00:06:27 for KiCad PCB EDA Suite by
1.13.2