20#include <boost/test/unit_test.hpp>
61 const int width = 2 * 1000000;
68 wxFFile file( gbrPath, wxT(
"rb" ) );
70 wxFileOffset len = file.Length();
71 BOOST_REQUIRE_GT( len, 0 );
74 buffer.resize(
static_cast<size_t>( len ) );
75 BOOST_REQUIRE_EQUAL( file.Read( buffer.data(), len ),
static_cast<size_t>( len ) );
79 BOOST_CHECK_MESSAGE( buffer.find(
"C,2.000000" ) != std::string::npos,
80 "Expected 2.000000 mm circle aperture in gerber output" );
83 BOOST_CHECK_MESSAGE( buffer.find(
"C,0.000000" ) == std::string::npos,
84 "Spurious 0.000000 mm aperture present (issue 24131 regression)" );
88 BOOST_CHECK_MESSAGE( buffer.find(
"G02" ) == std::string::npos
89 && buffer.find(
"G03" ) == std::string::npos,
90 "Unexpected circular interpolation in zero-length segment plot" );
96 BOOST_CHECK_MESSAGE( buffer.find(
"X0Y0D02*" ) != std::string::npos
97 && buffer.find(
"X0Y0D01*" ) != std::string::npos,
98 "Expected single zero-length segment flash at origin" );
virtual void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, void *aData) override
virtual void SetViewport(const VECTOR2I &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool EndPlot() override
virtual bool StartPlot(const wxString &pageNumber) override
Write GERBER header to file initialize global variable g_Plot_PlotOutputFile.
wxString CreateChildFileStr(const wxString &aName) const
Create and return the path to a direct child file as a wxString.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Minimal concrete render settings suitable for plotters in tests.
int CountOccurrences(const std::string &aHaystack, const std::string &aNeedle)
Count occurrences of a substring in a string (overlapping allowed).
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_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I