37 std::unique_ptr<SCHEMATIC> first;
38 std::unique_ptr<SCHEMATIC> second;
41 using KEY = std::pair<KIID_PATH, KIID>;
42 const auto contexts = [](
SCHEMATIC& schematic )
44 std::map<KEY, ERC_SCH_PIN_CONTEXT>
result;
52 const bool inserted =
result.emplace( KEY{
path.Path(),
pin->m_Uuid },
61 const auto originals = contexts( *first );
62 const auto reloaded = contexts( *second );
63 BOOST_REQUIRE_GT( originals.size(), 1 );
64 BOOST_REQUIRE_EQUAL( originals.size(), reloaded.size() );
69 BOOST_CHECK(
empty < missing );
70 BOOST_CHECK( !( missing <
empty ) );
71 BOOST_CHECK( !(
empty == missing ) );
72 BOOST_CHECK( missing < originals.begin()->second );
73 BOOST_CHECK( !( originals.begin()->second < missing ) );
74 BOOST_CHECK( !( missing == originals.begin()->second ) );
75 std::map<SCH_PIN*, std::set<KIID_PATH>> instances;
76 std::vector<ERC_SCH_PIN_CONTEXT> shuffled;
78 for(
const auto& [key, context] : originals )
80 const auto other = reloaded.find( key );
82 BOOST_CHECK( context.Pin() != other->second.Pin() );
83 BOOST_CHECK( context == other->second );
84 BOOST_CHECK( !( context < other->second ) );
85 BOOST_CHECK( !( other->second < context ) );
86 instances[context.Pin()].insert( key.first );
87 shuffled.push_back( context );
90 BOOST_REQUIRE( std::any_of( instances.begin(), instances.end(),
91 [](
const auto& entry ) { return entry.second.size() > 1; } ) );
92 std::reverse( shuffled.begin(), shuffled.end() );
93 std::sort( shuffled.begin(), shuffled.end() );
98 BOOST_CHECK( context.Sheet().PathRef() ==
expected->first.first );
99 BOOST_CHECK( context.Pin()->m_Uuid ==
expected->first.second );
A class used to associate a SCH_PIN with its owning SCH_SHEET_PATH, in order to handle ERC checks acr...
BOOST_AUTO_TEST_CASE(ERCPinContextOrderUsesInstanceAndPinIdentity)
wxString result
Test unit parsing edge cases and error handling.