24#include <boost/test/unit_test.hpp>
28#include <wx/filename.h>
54 wxString gbrPath = wxFileName::CreateTempFileName( wxT(
"kicad_gbr_zero_seg" ) );
63 const int width = 2 * 1000000;
70 wxFFile file( gbrPath, wxT(
"rb" ) );
72 wxFileOffset len = file.Length();
73 BOOST_REQUIRE_GT( len, 0 );
76 buffer.resize(
static_cast<size_t>( len ) );
77 BOOST_REQUIRE_EQUAL( file.Read( buffer.data(), len ),
static_cast<size_t>( len ) );
82 "Expected 2.000000 mm circle aperture in gerber output" );
86 "Spurious 0.000000 mm aperture present (issue 24131 regression)" );
91 && buffer.find(
"G03" ) == std::string::npos,
92 "Unexpected circular interpolation in zero-length segment plot" );
99 && buffer.find(
"X0Y0D01*" ) != std::string::npos,
100 "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.
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).
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))
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I