42 const std::vector<std::tuple<wxString, int, size_t>> fixtures = {
50 for(
const auto& [fixture, code, expectedCount] : fixtures )
56 std::unique_ptr<SCHEMATIC> schematic;
59 for(
auto& [errorCode, severity] : schematic->ErcSettings().m_ERCSeverities )
62 using DIAGNOSTICS = std::map<std::pair<KIID_PATH, KIID>,
VECTOR2I>;
63 const auto collect = [&]()
66 std::set<SCH_SCREEN*> screens;
69 screens.insert(
path.LastScreen() );
73 std::vector<SCH_MARKER*> markers;
77 auto* marker =
static_cast<SCH_MARKER*
>( item );
78 markers.push_back( marker );
79 const auto error = std::static_pointer_cast<ERC_ITEM>( marker->GetRCItem() );
80 const SCH_ITEM* label = schematic->ResolveItem( error->GetMainItemID(),
nullptr,
true );
86 BOOST_CHECK( marker->IsExcluded() );
90 BOOST_CHECK( !error->AuxItemHasSheetPath() );
91 BOOST_CHECK( error->GetAuxItemID() ==
niluuid );
93 const auto key = std::make_pair( error->GetSpecificSheetPath().PathRef(), label->
m_Uuid );
94 BOOST_CHECK(
result.emplace( key, marker->GetPosition() ).second );
98 screen->DeleteItem( marker );
103 schematic->ConnectionGraph()->RunERC();
108 static_cast<SCH_MARKER*
>( item )->SetExcluded(
true,
"Retained label policy" );
111 schematic->RecordERCExclusions();
113 BOOST_REQUIRE_EQUAL(
expected.size(), expectedCount );
116 schematic->RebuildConnectivity();
117 schematic->ConnectionGraph()->Reset();
119 schematic->ResolveERCExclusionsPostUpdate();
120 BOOST_CHECK( collect() ==
expected );
122 schematic->ResolveERCExclusionsPostUpdate();
123 BOOST_CHECK( collect() ==
expected );
126 BOOST_CHECK( collect().
empty() );
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")