60 boost::bimap<ProtoEnum, KiCadEnum> protoToKiCadSeen;
61 std::set<ProtoEnum> seenProtos;
63 for( ProtoEnum value : magic_enum::enum_values<ProtoEnum>() )
66 << magic_enum::enum_name( value ) )
68 std::string
name( magic_enum::enum_name( value ) );
69 auto splitPos =
name.find_first_of(
'_' );
72 BOOST_REQUIRE_MESSAGE( splitPos != std::string::npos,
73 "Proto enum name doesn't have a prefix" );
75 std::string suffix =
name.substr( splitPos );
78 if(
static_cast<int>( value ) == 0 )
80 BOOST_REQUIRE_MESSAGE( suffix.compare(
"_UNKNOWN" ) == 0,
81 "Proto enum with value 0 must be named <PREFIX>_UNKNOWN" );
91 protoToKiCadSeen.left.insert( { value,
result } );
95 for( KiCadEnum value : magic_enum::enum_values<KiCadEnum>() )
98 << magic_enum::enum_name( value ) )
102 if( aPartiallyMapped )
111 BOOST_REQUIRE_MESSAGE( !protoToKiCadSeen.right.count( value ),
112 "Proto enum is mapped to this KiCad enum, but not vice versa" );
127 seenProtos.insert(
result );
wxString result
Test unit parsing edge cases and error handling.