75 BOOST_REQUIRE_MESSAGE( m_board,
"Failed to load board issue24523" );
79 std::shared_ptr<DRC_ITEM> item;
81 std::vector<PCB_SHAPE> pathShapes;
83 double reportedActual = -1.0;
86 std::vector<ViolationInfo> violations;
89 BOOST_REQUIRE_MESSAGE( bds.
m_DRCEngine,
"DRC engine not initialized" );
97 [](
const wxString& aMsg ) ->
double
99 int actualPos = aMsg.Find( wxT(
"actual " ) );
101 if( actualPos == wxNOT_FOUND )
104 wxString tail = aMsg.Mid( actualPos + 7 );
105 int spacePos = tail.Find(
' ' );
107 if( spacePos != wxNOT_FOUND )
108 tail = tail.Left( spacePos );
111 tail.ToDouble( &value );
116 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
117 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
126 vi.reportedActual = parseActual( aItem->GetErrorMessage(
false ) );
131 aPathGenerator( &marker );
132 vi.pathShapes = marker.
GetPath();
135 violations.push_back( vi );
143 (
int) violations.size() ) );
145 double shortestActual = std::numeric_limits<double>::max();
147 for(
const ViolationInfo& vi : violations )
149 BOOST_TEST_MESSAGE( wxString::Format(
" layer=%d arrow=(%.4f,%.4f) shapes=%d actual=%.4f",
150 vi.layer, vi.pos.x / 1e6, vi.pos.y / 1e6,
151 (
int) vi.pathShapes.size(), vi.reportedActual ) );
153 if( vi.reportedActual >= 0.0 )
154 shortestActual = std::min( shortestActual, vi.reportedActual );
159 BOOST_REQUIRE_MESSAGE( !violations.empty(),
160 "No creepage violation reported; the path search failed to find the ~3 mm route "
161 "winding around the two NPTH slots and overestimated the creepage distance." );
170 wxString::Format(
"Shortest reported creepage %.4f mm is far longer than the true "
171 "~3 mm winding path, indicating the search is still missing the "
172 "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)