60 m_board->GetDesignSettings().m_DRCEngine->ClearViolationHandler();
79 BOOST_REQUIRE_MESSAGE( m_board,
"Failed to load board issue24241" );
81 std::vector<std::shared_ptr<DRC_ITEM>> violations;
82 std::vector<VECTOR2I> markerPositions;
85 BOOST_REQUIRE_MESSAGE( bds.
m_DRCEngine,
"DRC engine not initialized" );
93 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int ,
98 violations.push_back( aItem );
99 markerPositions.push_back( aPos );
108 (
int) violations.size() ) );
110 BOOST_REQUIRE_GE( violations.size(), 1u );
128 degenerateArc = shape;
133 BOOST_REQUIRE_MESSAGE( degenerateArc,
134 "Reproduction board is expected to contain a degenerate arc" );
139 bool foundLinkedViolation =
false;
141 for(
size_t ii = 0; ii < violations.size(); ++ii )
143 const std::shared_ptr<DRC_ITEM>& v = violations[ii];
144 const VECTOR2I& pos = markerPositions[ii];
146 const bool itemMatches = v->GetMainItemID() == degenerateArc->
m_Uuid
147 || v->GetAuxItemID() == degenerateArc->
m_Uuid;
149 if( itemMatches && pos == degenerateArc->
GetStart() )
151 foundLinkedViolation =
true;
157 "Expected a violation that references the degenerate arc and "
158 "places the marker at its coordinates so the user can locate it" );
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
SEVERITY GetSeverity(int aDRCErrorCode)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void RunTests(EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aTestFootprints, BOARD_COMMIT *aCommit=nullptr)
Run the DRC tests.
void SetViolationHandler(DRC_VIOLATION_HANDLER aHandler)
Set an optional DRC violation handler (receives DRC_ITEMs and positions).
void ClearViolationHandler()
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
VECTOR2I GetArcMid() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< BOARD > m_board
~DRC_INVALID_OUTLINE_DEGENERATE_ARC_FIXTURE()
DRC_INVALID_OUTLINE_DEGENERATE_ARC_FIXTURE()=default
BOOST_FIXTURE_TEST_CASE(DegenerateArcOutlineMarkerIssue24241, DRC_INVALID_OUTLINE_DEGENERATE_ARC_FIXTURE)
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))
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
VECTOR2< int32_t > VECTOR2I