34 std::vector<CLAIM> claims;
35 const BUS_ALIASES aliases{ {
"A", {
"D0" } }, {
"B", {
"D1" } }, {
"C", {
"D0",
"D2" } } };
37 for(
const wxString&
name : { wxString(
"{A}" ), wxString(
"{B}" ), wxString(
"{C}" ) } )
45 claims.push_back( std::move( claim ) );
49 BOOST_CHECK( less( claims[1], claims[0] ) );
50 BOOST_CHECK( less( claims[2], claims[0] ) );
51 BOOST_CHECK( less( claims[2], claims[1] ) );
52 const std::vector<NAME_ID>
expected{ claims[0].name, claims[1].name, claims[2].name };
53 std::vector<size_t> order{ 0, 1, 2 };
57 std::vector<CLAIM> permuted;
59 for(
size_t i : order )
60 permuted.push_back( claims[i] );
62 std::sort( permuted.begin(), permuted.end(),
68 for(
size_t i = 0; i <
expected.size(); ++i )
70 }
while( std::next_permutation( order.begin(), order.end() ) );
74 BOOST_CHECK( less( claims[2], claims[0] ) );
76 BOOST_CHECK( less( claims[0], claims[2] ) );
Session IDs are dense handles, never a canonical ordering.
INST_ID InternInstance(const KIID_PATH &aPath)
NAME_ID InternName(const wxString &aText)
Value keys and the key session of the schematic connectivity engine.
std::map< wxString, std::vector< wxString > > BUS_ALIASES
Bus alias table, from alias name to member texts.
uint32_t INST_ID
Session handle of a sheet instance KIID_PATH.
@ LOCAL_LABEL
Local label.
static std::optional< BUS_SCHEMA > Parse(const wxString &aText, const BUS_ALIASES &aAliases={})
Parse a vector or group bus text.
Strict weak order on claims by value.
The claim of one item for the name of its island.
ITEM_KEY source
The claiming item, the last tie-break.
NAME_ID ncName
Name of an unconnected pin net.
NAME_ID name
Item text without the sheet prefix.
std::shared_ptr< const BUS_SCHEMA > schema
Parsed bus, or null for a signal.
NAME_ID path
Sheet prefix, or the empty name if unscoped.
NAME_ID fullName
path followed by name.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
VECTOR3I expected(15, 30, 45)
BOOST_CHECK_EQUAL(result, "25.4")