KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_issue25583_equidistant_pins.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 3
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
25
26
#include <
qa_utils/wx_utils/unit_test_utils.h
>
27
#include <
eeschema_test_utils.h
>
28
29
#include <
eeschema_helpers.h
>
30
#include <
locale_io.h
>
31
#include <
sch_pin.h
>
32
#include <
sch_screen.h
>
33
#include <
sch_symbol.h
>
34
#include <
schematic.h
>
35
36
#include <set>
37
38
39
BOOST_AUTO_TEST_CASE
( Issue25583EquidistantPinsStayDistinct )
40
{
41
LOCALE_IO
dummy
;
42
43
wxString schPath = wxString::FromUTF8(
KI_TEST::GetEeschemaTestDataDir
() )
44
+ wxS(
"issue25583/issue25583.kicad_sch"
);
45
46
std::unique_ptr<SCHEMATIC> sch(
EESCHEMA_HELPERS::LoadSchematic
( schPath,
true
,
true
) );
47
BOOST_REQUIRE
( sch !=
nullptr
);
48
49
std::set<VECTOR2I, std::less<>> positions;
50
51
for
(
SCH_ITEM
* item : sch->RootScreen()->Items().OfType(
SCH_SYMBOL_T
) )
52
{
53
for
(
SCH_PIN
*
pin
:
static_cast<
SCH_SYMBOL
*
>
( item )->GetPinsByNumber( wxS(
"1"
) ) )
54
positions.insert(
pin
->GetPosition() );
55
}
56
57
BOOST_CHECK_EQUAL
( positions.size(), 2 );
58
}
EESCHEMA_HELPERS::LoadSchematic
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
Definition
eeschema_helpers.cpp:55
LOCALE_IO
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition
locale_io.h:37
SCH_ITEM
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition
sch_item.h:170
SCH_PIN
Definition
sch_pin.h:61
SCH_SYMBOL
Schematic symbol object.
Definition
sch_symbol.h:75
eeschema_helpers.h
eeschema_test_utils.h
locale_io.h
KI_TEST::GetEeschemaTestDataDir
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition
unit_test_utils.cpp:38
sch_pin.h
sch_screen.h
sch_symbol.h
schematic.h
dummy
std::vector< FAB_LAYER_COLOR > dummy
Definition
stackup_predefined_prms.cpp:93
BOOST_REQUIRE
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(Issue25583EquidistantPinsStayDistinct)
R1 pin 1 (38.1, 50.8) and R2 pin 1 (50.8, 38.1) are unconnected but equidistant from the origin.
Definition
test_issue25583_equidistant_pins.cpp:39
pin
KIBIS_PIN * pin
Definition
test_kibis.cpp:116
BOOST_CHECK_EQUAL
BOOST_CHECK_EQUAL(result, "25.4")
SCH_SYMBOL_T
@ SCH_SYMBOL_T
Definition
typeinfo.h:168
unit_test_utils.h
src
qa
tests
eeschema
test_issue25583_equidistant_pins.cpp
Generated on Tue Oct 27 2026 00:06:42 for KiCad PCB EDA Suite by
1.13.2