KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_fabmaster_import.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
28
32
34
35#include <board.h>
36#include <zone.h>
37
38
45
46
47BOOST_FIXTURE_TEST_SUITE( FabmasterImport, FABMASTER_IMPORT_FIXTURE )
48
49
50
61BOOST_AUTO_TEST_CASE( StaticShapesPreserved )
62{
63 std::string dataPath =
64 KI_TEST::GetPcbnewTestDataDir() + "plugins/fabmaster/cds2f_14066-20316FBRD.txt";
65
66 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
67
68 m_fabmasterPlugin.LoadBoard( dataPath, board.get(), nullptr );
69
70 BOOST_REQUIRE( board );
71
72 // Count zones - static shapes should be preserved as zones with net codes
73 int zonesWithNets = 0;
74
75 for( ZONE* zone : board->Zones() )
76 {
77 if( zone->GetNetCode() > 0 )
78 zonesWithNets++;
79 }
80
81 // The board should have some zones with nets assigned (static shapes).
82 // Before the fix, all netted zones were deleted because they were considered
83 // redundant fills. With the fix, unmatched static shapes are preserved.
84 BOOST_CHECK_MESSAGE( zonesWithNets > 0,
85 "Static shape zones with nets should be preserved" );
86}
87
88
General utilities for PCB file IO for QA programs.
Handle a list of polygons defining a copper zone.
Definition zone.h:74
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()