24#include <boost/test/unit_test.hpp>
49 BOOST_CHECK( a == b );
60 BOOST_REQUIRE_EQUAL(
path.size(), 1u );
85 BOOST_REQUIRE_EQUAL( a.size(), 1u );
86 BOOST_CHECK( a == b );
87 BOOST_CHECK( a.front() !=
NilUuid() );
96 BOOST_CHECK( a == b );
113 BOOST_CHECK( a == b );
114 BOOST_CHECK( &a == &b );
133 "5c50ee00-0000-4000-8000-000000000000" );
143 for(
int i = 0; i < 1024; ++i )
157 std::map<int, int>
empty;
163 BOOST_CHECK( s.find(
"0 override(s)" ) != std::string::npos );
164 BOOST_CHECK( s.find(
"hash 0)" ) != std::string::npos );
170 std::map<int, int> m{ { 1, 2 }, { 3, 4 } };
175 BOOST_CHECK( s.find(
"2 override(s)" ) != std::string::npos );
176 BOOST_CHECK( s.find(
"hash " ) != std::string::npos );
177 BOOST_CHECK( s.find(
"hash 0)" ) == std::string::npos );
186 std::map<int, int> a{ { 1, 2 }, { 3, 4 } };
187 std::map<int, int> b{ { 1, 2 }, { 3, 4 } };
197 std::map<int, int> a{ { 1, 2 } };
198 std::map<int, int> b{ { 1, 3 } };
206 std::map<int, int> a;
210 std::map<int, int> b;
227 const std::set<wxString> all = {
346 removed.
typeName = wxS(
"PCB_TRACK" );
352 added.
typeName = wxS(
"PCB_TRACK" );
366ITEM_CHANGE MakeChangeWithId(
const wxString& aTypeName,
const wxString& aIdSegment )
384 diff.
changes.push_back( MakeChangeWithId( wxS(
"FOOTPRINT" ), wxS(
"F1" ) ) );
385 diff.
changes.push_back( MakeChangeWithId( wxS(
"ZONE" ), wxS(
"Z1" ) ) );
389 BOOST_REQUIRE_EQUAL(
index.size(), 2u );
403 ITEM_CHANGE fp = MakeChangeWithId( wxS(
"FOOTPRINT" ), wxS(
"FP" ) );
404 fp.
children.push_back( MakeChangeWithId( wxS(
"PAD" ), wxS(
"P1" ) ) );
405 fp.
children.push_back( MakeChangeWithId( wxS(
"PAD" ), wxS(
"P2" ) ) );
406 diff.
changes.push_back( std::move( fp ) );
410 BOOST_REQUIRE_EQUAL(
index.size(), 3u );
411 BOOST_CHECK(
index.at( diff.
changes[0].id )->typeName == wxS(
"FOOTPRINT" ) );
412 BOOST_CHECK(
index.at( diff.
changes[0].children[0].id )->typeName == wxS(
"PAD" ) );
413 BOOST_CHECK(
index.at( diff.
changes[0].children[1].id )->typeName == wxS(
"PAD" ) );
421 ITEM_CHANGE level1 = MakeChangeWithId( wxS(
"SHEET" ), wxS(
"L1" ) );
422 ITEM_CHANGE level2 = MakeChangeWithId( wxS(
"SYMBOL" ), wxS(
"L2" ) );
423 ITEM_CHANGE level3 = MakeChangeWithId( wxS(
"FIELD" ), wxS(
"L3" ) );
424 level2.
children.push_back( std::move( level3 ) );
425 level1.
children.push_back( std::move( level2 ) );
426 diff.
changes.push_back( std::move( level1 ) );
447 diff.
changes.push_back( first );
450 second.
id = sharedId;
453 diff.
changes.push_back( second );
456 BOOST_REQUIRE_EQUAL(
index.size(), 1u );
457 BOOST_CHECK(
index.at( sharedId )->typeName == wxS(
"SECOND" ) );
472 p1.
name = wxS(
"Width" );
478 p2.
name = wxS(
"Layer" );
485 BOOST_REQUIRE_EQUAL(
index.size(), 2u );
486 BOOST_CHECK(
index.count( wxS(
"Width" ) ) == 1 );
487 BOOST_CHECK(
index.count( wxS(
"Layer" ) ) == 1 );
static DIFF_VALUE FromInt(int aValue)
static bool empty(const wxTextEntryBase *aCtrl)
const wxString DOC_PROP_ERC_SEVERITIES
const KIID & SchScreenSentinelKiid()
Sentinel KIID appended to a sheet's KIID_PATH to mark a per-sheet SCH_SCREEN resolution (page format ...
bool ChangeInvalidatesZone(const ITEM_CHANGE &aChange)
Whether a change to an item of the given type invalidates any overlapping filled zones.
const wxString DOC_PROP_BOARD_THICKNESS
const wxString DOC_PROP_PAGE_FORMAT
Property-name keys for the synthetic document-level ITEM_CHANGE (empty KIID_PATH).
std::string SummarizeSeverities(const SeverityMap &aMap)
Format a severity-override map (DRC or ERC, keyed by error code, value is a SEVERITY enum) as a short...
const wxString DOC_PROP_PAGE_ORIENTATION
KIID_PATH LibraryItemKiidPath(const wxString &aName)
Build a deterministic synthetic KIID_PATH from a library item name (symbol name or footprint name).
const wxString DOC_PROP_LAYER_STACKUP
const wxString DOC_PROP_DRAWING_SHEET
bool ChangeRequiresConnectivityRebuild(const ITEM_CHANGE &aChange)
Whether a change to an item of the given type requires the connectivity graph to be rebuilt.
const wxString DOC_PROP_DRC_SEVERITIES
std::map< KIID_PATH, const ITEM_CHANGE * > IndexChangesByKiid(const DOCUMENT_DIFF &aDiff)
Flatten a DOCUMENT_DIFF's ITEM_CHANGE tree into a KIID_PATH -> ITEM_CHANGE* map, recursing into child...
std::map< wxString, const PROPERTY_DELTA * > IndexPropertiesByName(const ITEM_CHANGE &aChange)
Index property deltas inside one ITEM_CHANGE by property name.
_OUT_STRING AsString(const std::string &aString)
The full set of changes between two parsed documents of one type.
std::vector< ITEM_CHANGE > changes
One change record on a single item.
std::vector< PROPERTY_DELTA > properties
std::optional< wxString > refdes
std::vector< ITEM_CHANGE > children
Single (name, before, after) triple for one mutated property on an item.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(LibraryItemKiidPath_Deterministic)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")