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
20
#include <
qa_utils/wx_utils/unit_test_utils.h
>
21
#include <
board.h
>
22
#include <
footprint.h
>
23
#include <
pad.h
>
24
25
struct
PAD_FIXTURE
26
{
27
PAD_FIXTURE
() :
28
m_board
(),
29
m_footprint
( &
m_board
)
30
{
31
}
32
33
PAD
MakeNPTH
()
34
{
35
PAD
pad
( &
m_footprint
);
36
37
pad
.SetAttribute(
PAD_ATTRIB::NPTH
);
38
pad
.SetLayerSet(
PAD::UnplatedHoleMask
() );
39
40
return
pad
;
41
}
42
43
PAD
MakeAperture
()
44
{
45
PAD
pad
( &
m_footprint
);
46
47
pad
.SetAttribute(
PAD_ATTRIB::PTH
);
48
pad
.SetLayerSet(
PAD::ApertureMask
() );
49
50
return
pad
;
51
}
52
53
PAD
MakeSmd
()
54
{
55
PAD
pad
( &
m_footprint
);
56
57
pad
.SetAttribute(
PAD_ATTRIB::SMD
);
58
pad
.SetLayerSet(
PAD::SMDMask
() );
59
60
return
pad
;
61
}
62
63
BOARD
m_board
;
64
FOOTPRINT
m_footprint
;
65
};
66
67
68
BOOST_FIXTURE_TEST_SUITE( PadNumbering,
PAD_FIXTURE
)
69
70
73
BOOST_AUTO_TEST_CASE
( CanNumber )
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
86
BOOST_AUTO_TEST_SUITE_END
()
BITMAPS::pad
@ pad
Definition
bitmaps_list.h:412
board.h
BOARD
Information pertinent to a Pcbnew printed circuit board.
Definition
board.h:372
FOOTPRINT
Definition
footprint.h:288
PAD
Definition
pad.h:61
PAD::UnplatedHoleMask
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
Definition
pad.cpp:600
PAD::ApertureMask
static LSET ApertureMask()
layer set for an aperture pad
Definition
pad.cpp:607
PAD::SMDMask
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition
pad.cpp:586
footprint.h
pad.h
PAD_ATTRIB::NPTH
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition
padstack.h:103
PAD_ATTRIB::SMD
@ SMD
Smd pad, appears on the solder paste layer (default)
Definition
padstack.h:99
PAD_ATTRIB::PTH
@ PTH
Plated through hole pad.
Definition
padstack.h:98
PAD_FIXTURE
Definition
test_pad_numbering.cpp:26
PAD_FIXTURE::m_board
BOARD m_board
Definition
test_pad_numbering.cpp:63
PAD_FIXTURE::MakeNPTH
PAD MakeNPTH()
Definition
test_pad_numbering.cpp:33
PAD_FIXTURE::PAD_FIXTURE
PAD_FIXTURE()
Definition
test_pad_numbering.cpp:27
PAD_FIXTURE::MakeSmd
PAD MakeSmd()
Definition
test_pad_numbering.cpp:53
PAD_FIXTURE::MakeAperture
PAD MakeAperture()
Definition
test_pad_numbering.cpp:43
PAD_FIXTURE::m_footprint
FOOTPRINT m_footprint
Definition
test_pad_numbering.cpp:64
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
Definition
test_api_enums.cpp:71
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 Fri Jun 26 2026 00:05:45 for KiCad PCB EDA Suite by
1.13.2