76 wxString dxfPath = wxString::FromUTF8(
85 std::deque<EDA_ITEM*> items;
87 for( std::unique_ptr<EDA_ITEM>& item : importer.
GetItems() )
88 items.push_back( item.get() );
91 BOOST_REQUIRE_MESSAGE( items.size() >= 6,
"Expected several imported shapes, got " << items.size() );
99 "Spline+line outline should chain into exactly one closed polygon, got "
100 <<
result.OutlineCount() );
102 if(
result.OutlineCount() == 1 )
108 "Resulting polygon must enclose a non-zero area" );
113 size_t chainedItems = std::count_if( items.begin(), items.end(),
116 return aItem->GetFlags() & SKIP_STRUCT;
General utilities for PCB file IO for QA programs.
Information pertinent to a Pcbnew printed circuit board.
bool Import() override
Actually imports the file.
bool Load(const wxString &aFileName) override
Load file for import.
void SetUnit(DXF_IMPORT_UNITS aUnit)
Set the default units when importing DXFs.
virtual void SetImporter(GRAPHICS_IMPORTER *aImporter) override
Set the receiver of the imported shapes.
A base class for most all the KiCad significant classes used in schematics and boards.
void SetLayer(PCB_LAYER_ID aLayer)
std::list< std::unique_ptr< EDA_ITEM > > & GetItems()
Return the list of objects representing the imported shapes.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
bool IsClosed() const override
double Area(bool aAbsolute=true) const
Return the area of this chain.
Represent a set of closed polygons.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
std::vector< FAB_LAYER_COLOR > dummy
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")
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")