KiCad PCB EDA Suite
test_pad_naming.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 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 
26 #include <class_board.h>
27 #include <class_module.h>
28 #include <pad_naming.h>
29 
31 {
33  {
34  }
35 
37  {
38  D_PAD pad( &m_module );
39 
42 
43  return pad;
44  }
45 
47  {
48  D_PAD pad( &m_module );
49 
52 
53  return pad;
54  }
55 
57  {
58  D_PAD pad( &m_module );
59 
61  pad.SetLayerSet( D_PAD::SMDMask() );
62 
63  return pad;
64  }
65 
68 };
69 
70 
71 BOOST_FIXTURE_TEST_SUITE( PadNaming, PAD_FIXTURE )
72 
73 
77 {
78  auto npth = MakeNPTH();
79  BOOST_CHECK_EQUAL( false, PAD_NAMING::PadCanHaveName( npth ) );
80 
81  auto aperture = MakeAperture();
82  BOOST_CHECK_EQUAL( false, PAD_NAMING::PadCanHaveName( aperture ) );
83 
84  auto smd = MakeSmd();
85  BOOST_CHECK_EQUAL( true, PAD_NAMING::PadCanHaveName( smd ) );
86 }
87 
88 
89 BOOST_AUTO_TEST_SUITE_END()
D_PAD MakeAperture()
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
Definition: class_pad.cpp:162
static LSET SMDMask()
layer set for a SMD pad on Front layer
Definition: class_pad.cpp:148
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
bool PadCanHaveName(const D_PAD &aPad)
Check if a pad should be named.
Definition: pad_naming.cpp:26
void SetAttribute(PAD_ATTR_T aAttribute)
Definition: class_pad.cpp:498
BOOST_AUTO_TEST_CASE(CanName)
Check what gets names and what doesn't.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
static LSET ApertureMask()
layer set for an aperture pad
Definition: class_pad.cpp:169
void SetLayerSet(LSET aLayers) override
Definition: class_pad.h:330