72 SCH_DIFFER differ( m_before.get(), m_after.get(), wxS(
"issue18606.kicad_sch" ) );
76 BOOST_CHECK_MESSAGE(
result.Empty(),
"Two fresh loads of the same fixture should diff to empty; "
77 "got " <<
result.changes.size()
84 m_before->RootScreen()->GetTitleBlock().SetTitle( wxS(
"Original" ) );
85 m_after->RootScreen()->GetTitleBlock().SetTitle( wxS(
"Renamed" ) );
87 SCH_DIFFER differ( m_before.get(), m_after.get(), wxS(
"issue18606.kicad_sch" ) );
90 BOOST_REQUIRE_EQUAL(
result.changes.size(), 1u );
91 BOOST_CHECK(
result.changes[0].id.empty() );
94 bool foundTitleDelta =
false;
100 foundTitleDelta =
true;
106 BOOST_CHECK_MESSAGE( foundTitleDelta,
"Expected a title block delta after changing the sheet title" );
113 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
140 SCH_DIFFER differ( m_before.get(), m_after.get() );
143 BOOST_REQUIRE_GE(
result.changes.size(), 1u );
145 bool foundModifiedSymbol =
false;
152 foundModifiedSymbol =
true;
157 BOOST_CHECK( foundModifiedSymbol );
164 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
182 SCH_DIFFER differ1( m_before.get(), m_after.get() );
183 SCH_DIFFER differ2( m_before.get(), m_after.get() );
194 SCH_DIFFER differ( m_before.get(), m_after.get(), wxS(
"test.kicad_sch" ) );
197 nlohmann::json j =
result.ToJson();
225 if( p.
name == aName )
238 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
256 SCH_DIFFER differ( m_before.get(), m_after.get() );
259 bool foundSymbolTypeName =
false;
265 foundSymbolTypeName =
true;
269 BOOST_CHECK( foundSymbolTypeName );
281 if( !m_after->IsValid() )
287 m_before->Settings().m_SchDrawingSheetFileName = wxEmptyString;
288 m_after->Settings().m_SchDrawingSheetFileName = wxS(
"/some/sheet.kicad_wks" );
290 SCH_DIFFER differ( m_before.get(), m_after.get() );
298 BOOST_CHECK(
delta->before.ToDisplayString() !=
delta->after.ToDisplayString() );
308 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
322 SCH_DIFFER differ1( m_before.get(), m_after.get() );
323 SCH_DIFFER differ2( m_before.get(), m_after.get() );
337 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
339 if( sheets.size() < 2u )
352 if(
path.size() < 2u )
374 SCH_DIFFER differ( m_before.get(), m_after.get() );
377 bool foundPathPrefix =
false;
385 BOOST_CHECK_GE( c.
id.size(), 2u );
386 foundPathPrefix =
true;
390 BOOST_CHECK( foundPathPrefix );
398 BOOST_CHECK( !geometry.
Empty() );
EE_TYPE OfType(KICAD_T aType) const
wxString AsString() const
Diff two already-parsed SCHEMATICs and produce a DOCUMENT_DIFF.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
A color representation with 4 components: red, green, blue, alpha.
wxString AsString() const
wxString AsString() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void SetPosition(const VECTOR2I &aPosition) override
VECTOR2I GetPosition() const override
DOCUMENT_GEOMETRY ExtractSchematicGeometry(const SCHEMATIC &aSchematic, const KIGFX::COLOR4D &aColor, const std::map< KIID, KIGFX::COLOR4D > &aOverrides, bool aOnlyOverrides)
Extract a coarse outline of a SCHEMATIC into a DOCUMENT_GEOMETRY for use as background context in DIF...
const wxString DOC_PROP_DRAWING_SHEET
std::optional< BOX2I > BBoxFromGeometry(const DOCUMENT_GEOMETRY &aGeometry)
Compute the tight bounding box of a DOCUMENT_GEOMETRY, inflating each primitive by half its stroke so...
const wxString DOC_PROP_TITLE
Title block fields. The comments are numbered from one, as the page settings dialog shows them.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
The full set of changes between two parsed documents of one type.
nlohmann::json ToJson() const
static DOCUMENT_DIFF FromJson(const nlohmann::json &aJson)
std::vector< ITEM_CHANGE > changes
Aggregate of background geometry extracted from one source document.
One change record on a single item.
std::vector< PROPERTY_DELTA > properties
Single (name, before, after) triple for one mutated property on an item.
std::unique_ptr< SCHEMATIC > m_before
SETTINGS_MANAGER m_settingsB
std::unique_ptr< SCHEMATIC > m_after
SETTINGS_MANAGER m_settingsA
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
static const PROPERTY_DELTA * findProperty(const ITEM_CHANGE &aChange, const wxString &aName)
BOOST_AUTO_TEST_CASE(TwoFreshLoadsAreIdentical)
static const ITEM_CHANGE * findRootDocLevelChange(const DOCUMENT_DIFF &aDiff)
BOOST_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I