KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_connectivity_algo.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) 2024 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, you may find one here:
18 * https://www.gnu.org/licenses/gpl-3.0.en.html
19 * or you may search the http://www.gnu.org website for the version 32 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
27
28#include <connection_graph.h>
29#include <schematic.h>
30#include <sch_sheet.h>
31#include <sch_screen.h>
33#include <locale_io.h>
34
36{
38 m_settingsManager( true /* headless */ )
39 { }
40
42 std::unique_ptr<SCHEMATIC> m_schematic;
43};
44
46{
48
49 std::vector<std::pair<wxString, int>> tests =
50 {
51 { "issue18092/issue18092", 1 }
52 };
53
54 for( auto&[ name, nets] : tests )
55 {
56 KI_TEST::LoadSchematic( m_settingsManager, name, m_schematic );
57
58 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
59 CONNECTION_GRAPH* graph = m_schematic->ConnectionGraph();
60
61 BOOST_CHECK( nets == graph->GetNetMap().size() );
62
63 }
64}
const char * name
Definition: DXF_plotter.cpp:57
Calculate the connectivity of a schematic and generates netlists.
const NET_MAP & GetNetMap() const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:49
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::vector< FAB_LAYER_COLOR > dummy
std::unique_ptr< SCHEMATIC > m_schematic
BOOST_FIXTURE_TEST_CASE(CheckNetCounts, CONNECTIVITY_TEST_FIXTURE)