44#include <nlohmann/json.hpp>
72 SCH_DIFFER differ( m_before.get(), m_after.get(), wxS(
"issue18606.kicad_sch" ) );
77 "got " <<
result.changes.size()
85 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
112 SCH_DIFFER differ( m_before.get(), m_after.get() );
115 BOOST_REQUIRE_GE(
result.changes.size(), 1u );
117 bool foundModifiedSymbol =
false;
124 foundModifiedSymbol =
true;
129 BOOST_CHECK( foundModifiedSymbol );
136 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
154 SCH_DIFFER differ1( m_before.get(), m_after.get() );
155 SCH_DIFFER differ2( m_before.get(), m_after.get() );
166 SCH_DIFFER differ( m_before.get(), m_after.get(), wxS(
"test.kicad_sch" ) );
169 nlohmann::json j =
result.ToJson();
197 if( p.
name == aName )
210 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
228 SCH_DIFFER differ( m_before.get(), m_after.get() );
231 bool foundSymbolTypeName =
false;
237 foundSymbolTypeName =
true;
241 BOOST_CHECK( foundSymbolTypeName );
253 if( !m_after->IsValid() )
259 m_before->Settings().m_SchDrawingSheetFileName = wxEmptyString;
260 m_after->Settings().m_SchDrawingSheetFileName = wxS(
"/some/sheet.kicad_wks" );
262 SCH_DIFFER differ( m_before.get(), m_after.get() );
270 BOOST_CHECK(
delta->before.ToDisplayString() !=
delta->after.ToDisplayString() );
280 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
294 SCH_DIFFER differ1( m_before.get(), m_after.get() );
295 SCH_DIFFER differ2( m_before.get(), m_after.get() );
309 SCH_SHEET_LIST sheets = m_after->BuildSheetListSortedByPageNumbers();
311 if( sheets.size() < 2u )
324 if(
path.size() < 2u )
346 SCH_DIFFER differ( m_before.get(), m_after.get() );
349 bool foundPathPrefix =
false;
357 BOOST_CHECK_GE( c.
id.size(), 2u );
358 foundPathPrefix =
true;
362 BOOST_CHECK( foundPathPrefix );
370 BOOST_CHECK( !geometry.
Empty() );
EE_TYPE OfType(KICAD_T aType) 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...
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()
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
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)
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I