KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_import_proj_properties.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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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
21
23
24BOOST_AUTO_TEST_SUITE( ImportProjProperties )
25
26BOOST_AUTO_TEST_CASE( NetNameMapRoundTripsAndDistinguishesAbsence )
27{
28 const std::map<wxString, wxString> names = { { wxS( "N123" ), wxS( "Net-(R1-Pad1)" ) },
29 { wxS( "N456" ), wxS( "/sheet/SDA" ) } };
30
32 BOOST_REQUIRE( decoded );
33 BOOST_CHECK( *decoded == names );
34
35 // A design that maps no nets still has to report that the import ran, because the manager reads
36 // a present map as the schematic import having succeeded.
39 BOOST_CHECK( empty->empty() );
40
41 // An import that never replied decodes to nothing at all.
42 BOOST_CHECK( !IMPORT_PROJ_PROPS::SplitNetNameMap( wxString() ) );
43}
44
static bool empty(const wxTextEntryBase *aCtrl)
wxString JoinNetNameMap(const std::map< wxString, wxString > &aNames)
Encode source-to-imported net names as a single property value.
std::optional< std::map< wxString, wxString > > SplitNetNameMap(const wxString &aValue)
Decode a net-name map property value, or nothing when the value is not one.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()