39#include <wx/filename.h>
53 fn.AppendDir( wxS(
"libraries" ) );
54 fn.AppendDir( wxS(
"Resistor_SMD.pretty" ) );
66 FP_LIB_DIFFER differ( mapA, mapB, wxS(
"Resistor_SMD.pretty" ) );
80 mapB.erase( mapB.begin() );
96 FOOTPRINT* subject = ownersB.front().get();
104 BOOST_CHECK_GT(
result.changes[0].bbox.GetWidth(), 0 );
105 BOOST_CHECK_GT(
result.changes[0].bbox.GetHeight(), 0 );
128 mapB.erase( mapB.begin() );
133 nlohmann::json j =
result.ToJson();
169 BOOST_REQUIRE_GE( mapB.size(), 3u );
171 std::vector<wxString> victims;
173 for(
int i = 0; i < 3 && !mapB.empty(); ++i )
175 victims.push_back( mapB.begin()->first );
176 mapB.erase( mapB.begin() );
200 BOOST_REQUIRE_GE( mapB1.size(), 2u );
202 mapB1.erase( mapB1.begin() );
203 mapB2.erase( mapB2.begin() );
220 BOOST_REQUIRE( !ownersB.empty() && !ownersB.front()->Pads().empty() );
222 PAD*
pad = ownersB.front()->Pads().front();
225 std::vector<LIB_ELEMENT> elements =
DiffFootprintElements( ownersA.front().get(), ownersB.front().get() );
239 BOOST_REQUIRE( !ownersB.empty() && !ownersB.front()->Pads().empty() );
241 ownersB.front()->Pads().front()->SetLocalClearance(
pcbIUScale.mmToIU( 0.3 ) );
264 for(
BOARD_ITEM* item : after->GraphicalItems() )
constexpr EDA_IU_SCALE pcbIUScale
General utilities for PCB file IO for QA programs.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Diff two .pretty footprint library directories.
static std::pair< std::vector< std::unique_ptr< FOOTPRINT > >, FOOTPRINT_MAP > LoadLibrary(const wxString &aPrettyPath)
Load a .pretty directory into a FOOTPRINT_MAP.
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.
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
std::unique_ptr< FOOTPRINT > ImportFootprint(const wxString &aFootprintPath, wxString &aFootprintNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.
A type-safe container of any type.
LSET GeometryLayerSet(const DOCUMENT_GEOMETRY &aGeometry)
Return the union of every non-empty layer set carried by the geometry.
std::vector< LIB_ELEMENT > DiffFootprintElements(const FOOTPRINT *aBefore, const FOOTPRINT *aAfter)
Compare the elements of two library footprints.
KIID_PATH LibraryItemKiidPath(const wxString &aName)
Build a deterministic synthetic KIID_PATH from a library item name (symbol name or footprint name).
DOCUMENT_GEOMETRY ExtractFootprintGeometry(const FOOTPRINT &aFootprint, const KIGFX::COLOR4D &aColor)
Extract drawable context geometry from a single FOOTPRINT.
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
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.
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE(res.columns()==1)
static wxString getFixturePath()
BOOST_AUTO_TEST_CASE(IdenticalLibrariesDiffEmpty)
BOOST_AUTO_TEST_SUITE_END()
static wxString getFixturePath()
wxString result
Test unit parsing edge cases and error handling.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
VECTOR2< int32_t > VECTOR2I
static PIECE polygon(std::vector< VIA_CROSS_SECTION_GEOMETRY::POINT > aPoints, bool aMixed=false)