31#include <wx/filename.h>
39 m_tempDir = wxFileName::CreateTempFileName( wxS(
"kicad_test_" ) );
49 wxFileName::Rmdir(
m_tempDir, wxPATH_RMDIR_RECURSIVE );
84 derived.
SetBodyStyleNames( { wxS(
"Bogus1" ), wxS(
"Bogus2" ), wxS(
"Bogus3" ) } );
98 root.
SetBodyStyleNames( { wxS(
"Standard" ), wxS(
"Alternate" ), wxS(
"Simplified" ) } );
160 plugin->CreateLibrary( GetLibPath() );
161 plugin->SaveSymbol( GetLibPath(), std::make_unique<LIB_SYMBOL>( root ) );
162 plugin->SaveSymbol( GetLibPath(), std::make_unique<LIB_SYMBOL>( derived ) );
163 plugin->SaveLibrary( GetLibPath() );
167 LIB_SYMBOL* loadedRoot = plugin->LoadSymbol( GetLibPath(), wxS(
"Root" ) );
168 LIB_SYMBOL* loadedDerived = plugin->LoadSymbol( GetLibPath(), wxS(
"Derived" ) );
const wxString & GetLibPath() const
DERIVED_BODY_STYLES_FIXTURE()
~DERIVED_BODY_STYLES_FIXTURE()
Define a library symbol object.
bool UnitsLocked() const
Check whether symbol units are interchangeable.
std::map< int, wxString > & GetUnitDisplayNames()
bool IsMultiBodyStyle() const override
void SetBodyStyleNames(const std::vector< wxString > &aBodyStyleNames)
void LockUnits(bool aLockUnits)
Set interchangeable the property for symbol units.
void SetParent(LIB_SYMBOL *aParent=nullptr)
void SetUnitCount(int aCount, bool aDuplicateDrawItems)
Set the units per symbol count.
void SetHasDeMorganBodyStyles(bool aFlag)
void SetBodyStyleCount(int aCount, bool aDuplicateDrawItems, bool aDuplicatePins)
Set the number of body styles for the symbol.
bool HasDeMorganBodyStyles() const override
bool IsMultiUnit() const override
int GetBodyStyleCount() const override
The body styles are a property of the drawings, which a derived symbol inherits from its root symbol ...
wxString GetBodyStyleDescription(int aBodyStyle, bool aLabel) const override
int GetUnitCount() const override
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the user-defined display name for aUnit for symbols with units.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(BodyStylesResolveThroughParent)
A derived symbol owns no drawings, so its body styles are its root symbol's.
BOOST_CHECK_EQUAL(result, "25.4")