79 BOOST_REQUIRE_MESSAGE( m_board,
"Failed to load board issue24523" );
83 std::shared_ptr<DRC_ITEM> item;
85 std::vector<PCB_SHAPE> pathShapes;
87 double reportedActual = -1.0;
90 std::vector<ViolationInfo> violations;
93 BOOST_REQUIRE_MESSAGE( bds.
m_DRCEngine,
"DRC engine not initialized" );
101 [](
const wxString& aMsg ) ->
double
103 int actualPos = aMsg.Find( wxT(
"actual " ) );
105 if( actualPos == wxNOT_FOUND )
108 wxString tail = aMsg.Mid( actualPos + 7 );
109 int spacePos = tail.Find(
' ' );
111 if( spacePos != wxNOT_FOUND )
112 tail = tail.Left( spacePos );
115 tail.ToDouble( &value );
120 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
121 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
130 vi.reportedActual = parseActual( aItem->GetErrorMessage(
false ) );
135 aPathGenerator( &marker );
136 vi.pathShapes = marker.
GetPath();
139 violations.push_back( vi );
147 (
int) violations.size() ) );
149 double shortestActual = std::numeric_limits<double>::max();
151 for(
const ViolationInfo& vi : violations )
153 BOOST_TEST_MESSAGE( wxString::Format(
" layer=%d arrow=(%.4f,%.4f) shapes=%d actual=%.4f",
154 vi.layer, vi.pos.x / 1e6, vi.pos.y / 1e6,
155 (
int) vi.pathShapes.size(), vi.reportedActual ) );
157 if( vi.reportedActual >= 0.0 )
158 shortestActual = std::min( shortestActual, vi.reportedActual );
163 BOOST_REQUIRE_MESSAGE( !violations.empty(),
164 "No creepage violation reported; the path search failed to find the ~3 mm route "
165 "winding around the two NPTH slots and overestimated the creepage distance." );
174 wxString::Format(
"Shortest reported creepage %.4f mm is far longer than the true "
175 "~3 mm winding path, indicating the search is still missing the "
176 "shortest route around the two slots.", shortestActual ) );
DRC_CREEPAGE_TWO_SLOTS_FIXTURE()=default
std::unique_ptr< BOARD > m_board
SETTINGS_MANAGER m_settingsManager
~DRC_CREEPAGE_TWO_SLOTS_FIXTURE()
BOOST_FIXTURE_TEST_CASE(CreepageTwoNPTHSlotsIssue24523, DRC_CREEPAGE_TWO_SLOTS_FIXTURE)