20#include <boost/test/unit_test.hpp>
24#include <wx/filename.h>
50 wxString gbrPath = wxFileName::CreateTempFileName( wxT(
"kicad_gbr_zero_seg" ) );
59 const int width = 2 * 1000000;
66 wxFFile file( gbrPath, wxT(
"rb" ) );
68 wxFileOffset len = file.Length();
69 BOOST_REQUIRE_GT( len, 0 );
72 buffer.resize(
static_cast<size_t>( len ) );
73 BOOST_REQUIRE_EQUAL( file.Read( buffer.data(), len ),
static_cast<size_t>( len ) );
78 "Expected 2.000000 mm circle aperture in gerber output" );
82 "Spurious 0.000000 mm aperture present (issue 24131 regression)" );
87 && buffer.find(
"G03" ) == std::string::npos,
88 "Unexpected circular interpolation in zero-length segment plot" );
95 && buffer.find(
"X0Y0D01*" ) != std::string::npos,
96 "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