KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_easyeda_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, see <https://www.gnu.org/licenses/>.
18 */
19
24
27
31
32#include <board.h>
34#include <netclass.h>
36
37
42
43
44BOOST_FIXTURE_TEST_SUITE( EasyedaImport, EASYEDA_IMPORT_FIXTURE )
45
46
47BOOST_AUTO_TEST_CASE( BoardLoadImportsDefaultClearance )
48{
49 wxString dataPath = wxString::FromUTF8( KI_TEST::GetPcbnewTestDataDir()
50 + "plugins/easyeda/PCB_PCB_ESP32-PICO-D4 smart watch_2023-09-02.json" );
51
53 BOOST_REQUIRE( plugin );
54
55 std::unique_ptr<BOARD> board( plugin->LoadBoard( dataPath, nullptr ) );
56 BOOST_REQUIRE( board );
57
58 std::shared_ptr<NETCLASS> defaultNetclass = board->GetDesignSettings().m_NetSettings->GetDefaultNetclass();
59
60 BOOST_CHECK_EQUAL( defaultNetclass->GetClearance(), PCB_IO_EASYEDA_PARSER( nullptr ).ScaleSize( 0.6 ) );
61 BOOST_CHECK( board->m_LegacyNetclassesLoaded );
62}
63
64
static PCB_IO * FindPlugin(PCB_FILE_T aFileType)
Return a PCB_IO which the caller can use to import, export, save, or load design documents.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
Definition io_mgr.h:33
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()
BOOST_CHECK_EQUAL(result, "25.4")