56 m_board->GetDesignSettings().m_DRCEngine->ClearViolationHandler();
75 BOOST_REQUIRE_MESSAGE( m_board,
"Failed to load board issue24241" );
77 std::vector<std::shared_ptr<DRC_ITEM>> violations;
78 std::vector<VECTOR2I> markerPositions;
81 BOOST_REQUIRE_MESSAGE( bds.
m_DRCEngine,
"DRC engine not initialized" );
89 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int ,
94 violations.push_back( aItem );
95 markerPositions.push_back( aPos );
104 (
int) violations.size() ) );
106 BOOST_REQUIRE_GE( violations.size(), 1u );
124 degenerateArc = shape;
129 BOOST_REQUIRE_MESSAGE( degenerateArc,
130 "Reproduction board is expected to contain a degenerate arc" );
135 bool foundLinkedViolation =
false;
137 for(
size_t ii = 0; ii < violations.size(); ++ii )
139 const std::shared_ptr<DRC_ITEM>& v = violations[ii];
140 const VECTOR2I& pos = markerPositions[ii];
142 const bool itemMatches = v->GetMainItemID() == degenerateArc->
m_Uuid
143 || v->GetAuxItemID() == degenerateArc->
m_Uuid;
145 if( itemMatches && pos == degenerateArc->
GetStart() )
147 foundLinkedViolation =
true;
153 "Expected a violation that references the degenerate arc and "
154 "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