62 fp.
Add( privateField );
66 std::vector<wxString> names;
67 names.reserve( dynamicProps.size() );
70 names.push_back( prop->Name() );
72 BOOST_CHECK( std::ranges::none_of( names,
73 [](
const wxString& n ) {
return n == wxS(
"Secret" ); } ) );
75 bool seenUser =
false;
77 std::vector<wxString> userNames;
79 for(
const wxString&
name : names )
85 BOOST_CHECK_MESSAGE( !seenUser,
86 "Mandatory field '" +
name +
"' appears after a user field" );
95 BOOST_CHECK_MESSAGE( lastUser.CmpNoCase(
name ) <= 0,
96 "User fields not sorted: " + lastUser +
" before " +
name );
100 userNames.push_back(
name );
105 const std::vector<wxString> expectedUser = { wxS(
"Color" ), wxS(
"MPN" ), wxS(
"Supplier" ) };
106 BOOST_CHECK( userNames == expectedUser );
118 std::vector<wxString> staticNames;
121 staticNames.push_back( staticProp->Name() );
125 BOOST_CHECK_MESSAGE( std::ranges::find( staticNames, dynamic->Name() ) == staticNames.end(),
126 "Dynamic property '" + dynamic->Name() +
"' duplicates a statically-registered property" );
140 fieldB->
SetText( wxS(
"ACME" ) );
172 srcField->
SetText( wxS(
"12345" ) );
176 tgtField->
SetText( wxS(
"original" ) );
180 res.name = wxS(
"MPN" );
202 res.name = wxS(
"NoSuchField" );
224 if( p->Name() == wxS(
"MPN" ) )
230 if( p->Name() == wxS(
"MPN" ) )
264 if( p->Name() == wxS(
"MPN" ) )
286 if( p->Name() == wxS(
"MPN" ) )
288 else if( p->Name() == wxS(
"Supplier" ) )
295 wxAny v = fp.
Get( mpn );
301 wxAny newVal( wxString( wxS(
"99999" ) ) );
302 BOOST_CHECK( fp.
Set( supplier, newVal ) );
Information pertinent to a Pcbnew printed circuit board.
void SetCustomProperty(const wxString &aKey, const wxString &aValue)
const std::map< wxString, wxString > & GetCustomProperties() const
Custom user-defined string key/value properties attached to this item.
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetText(const wxString &aText)
wxAny Get(PROPERTY_BASE *aProperty) const
bool Set(PROPERTY_BASE *aProperty, wxAny &aValue, bool aNotify=true)
void SetPrivate(bool aPrivate)
Provide class metadata.Helper macro to map type hashes to names.
const std::vector< PROPERTY_BASE * > & GetProperties(TYPE_ID aType) const
Return all properties for a specific type.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
std::vector< PROPERTY_DELTA > DiffItemProperties(const INSPECTABLE *aBefore, const INSPECTABLE *aAfter)
Enumerate the property deltas between two items of the same dynamic type.
PROPERTY_APPLY_COUNTS ApplyPropertyResolutions(INSPECTABLE *aTarget, const std::vector< PROPERTY_RESOLUTION > &aProps, const INSPECTABLE *aOurs, const INSPECTABLE *aTheirs, const INSPECTABLE *aAncestor)
Apply per-property merge resolutions to aTarget, sourcing OURS/THEIRS/ANCESTOR values from the matchi...
Applied/failed tallies from ApplyPropertyResolutions, folded into a caller's report.
Single (name, before, after) triple for one mutated property on an item.
@ USER
The field ID hasn't been set yet; field is invalid.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(FootprintDynamicPropertyOrder)
static const PROPERTY_DELTA * findDelta(const std::vector< PROPERTY_DELTA > &aDeltas, const wxString &aName)
BOOST_CHECK_EQUAL(result, "25.4")