24#include <boost/test/unit_test.hpp>
28#include <wx/filename.h>
48 wxString dxfPath = wxFileName::CreateTempFileName( wxT(
"kicad_dxf_r2000" ) );
63 wxFFile file( dxfPath, wxT(
"rb" ) );
66 wxFileOffset len = file.Length();
67 BOOST_REQUIRE_GT( len, 0 );
70 buffer.resize(
static_cast<size_t>( len ) );
71 BOOST_REQUIRE_EQUAL( file.Read( buffer.data(), len ),
static_cast<size_t>( len ) );
77 "Expected $ACADVER = AC1018 in DXF header" );
79 "Expected $HANDSEED in DXF header" );
83 "Expected APPID table in TABLES section" );
85 && buffer.find(
"\n 2\nACAD\n" ) != std::string::npos,
86 "Expected ACAD entry in APPID table" );
90 "Expected BLOCK_RECORD table" );
92 "Expected *Model_Space layout block" );
94 "Expected BLOCKS section" );
99 "Expected LINE entity in output" );
101 "Expected AcDbEntity subclass marker on entities" );
103 "Expected AcDbLine subclass marker on LINE entity" );
105 "Expected AcDbCircle subclass marker on CIRCLE entity" );
109 "Expected 74 group code following 49 in DASHDOT pattern" );
114 "Expected *Paper_Space0 layout (spec mandates three empty blocks)" );
116 != std::string::npos,
117 "Expected 340 LAYOUT pointer in *Paper_Space0 BLOCK_RECORD" );
122 "Expected OBJECTS section" );
124 "Expected ACAD_LAYOUT entry in root dictionary" );
126 "Expected ACAD_GROUP entry in root dictionary" );
128 "Expected LAYOUT objects in OBJECTS section" );
130 "Expected Model layout object" );
132 "Expected Layout1 (Paper_Space) layout object" );
134 "Expected Layout2 (Paper_Space0) layout object" );
139 "Expected ACAD_PLOTSTYLENAME entry in root dictionary" );
141 "Expected ACDBDICTIONARYWDFLT for ACAD_PLOTSTYLENAME" );
143 "Expected ACDBPLACEHOLDER (the 'Normal' plot style)" );
145 "Expected 390 plot-style handle on every LAYER record" );
150 "Expected VPORT table" );
152 "Expected VIEW table" );
154 "Expected UCS table" );
156 "Expected DIMSTYLE table" );
158 "Expected DIMSTYLE record handle on group code 105 (not 5)" );
160 != std::string::npos,
161 "Expected Standard DIMSTYLE entry" );
165 "Expected default layer \"0\" entry in LAYER table" );
169 != std::string::npos,
170 "Expected ByBlock linetype entry" );
172 != std::string::npos,
173 "Expected ByLayer linetype entry" );
178 != std::string::npos,
179 "Expected group 2 (none_device) in AcDbPlotSettings" );
183 "Expected Model layout (precondition for the next check)" );
185 "Expected ModelType (1024) flag on the Model layout" );
virtual void SetViewport(const VECTOR2I &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the scale/position for the DXF plot.
virtual bool StartPlot(const wxString &aPageNumber) override
Open the DXF plot with a skeleton header.
virtual void Circle(const VECTOR2I &pos, int diametre, FILL_T fill, int width) override
DXF circle: full functionality; it even does 'fills' drawing a circle with a dual-arc polyline wide a...
virtual bool EndPlot() override
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
void SetRenderSettings(RENDER_SETTINGS *aSettings)
void MoveTo(const VECTOR2I &pos)
void FinishTo(const VECTOR2I &pos)
Minimal concrete render settings suitable for plotters in tests.
void MaybeRemoveFile(const wxString &aPath, const wxString &aEnvVar=wxT("KICAD_KEEP_TEST_PDF"))
Remove a file unless the given environment variable is set (defaults to KICAD_KEEP_TEST_PDF).
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
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))
VECTOR2< int32_t > VECTOR2I