35 fn.SetName( aRelativePath );
48 if( instance.m_Path == aPath )
67 fn.AppendDir(
"issue23020" );
68 fn.SetName(
"issue23020" );
71 if( !fn.FileExists() )
73 BOOST_TEST_MESSAGE(
"Skipping test: issue23020 test data not found at " << fn.GetFullPath() );
84 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
89 BOOST_CHECK( sheets.size() > 100 );
91 size_t symbolsChecked = 0;
127 << lookupTimer.
msecs() <<
" ms" );
129 BOOST_CHECK( symbolsChecked > 0 );
141 auto makePath = [](
int aTag ) ->
KIID_PATH
149 path.back() =
KIID( wxString::Format(
"abcd1234-0000-0000-0000-%012d", aTag ) );
154 std::vector<KIID_PATH> paths;
156 for(
int ii = 0; ii < 8; ++ii )
159 paths.push_back(
path );
163 auto checkAll = [&](
const std::vector<size_t>& aLive )
165 for(
size_t idx : aLive )
168 BOOST_CHECK( symbol.
GetInstance( instance, paths[idx] ) );
169 BOOST_CHECK( instance.
m_Path == paths[idx] );
175 checkAll( { 0, 1, 2, 3, 4, 5, 6, 7 } );
183 BOOST_CHECK( !symbol.
GetInstance( gone, paths[2] ) );
184 BOOST_CHECK( !symbol.
GetInstance( gone, paths[5] ) );
186 checkAll( { 0, 1, 3, 4, 6, 7 } );
192 BOOST_CHECK( symbol.
GetInstance( readded, paths[2] ) );
195 checkAll( { 0, 1, 3, 4, 6, 7 } );
A generic fixture for loading schematics and associated settings for qa tests.
A small class to help profiling.
void Stop()
Save the time when this function was called, and set the counter stane to stop.
double msecs(bool aSinceLast=false)
Base class for any item which can be embedded within the SCHEMATIC container class,...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
void RemoveInstance(const SCH_SHEET_PATH &aInstancePath)
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
bool GetInstance(SCH_SYMBOL_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
Return the instance-specific unit selection for the given sheet path.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
wxFileName SchematicQAPath(const wxString &aRelativePath) override
static const SCH_SYMBOL_INSTANCE * NaiveFindInstance(const SCH_SYMBOL *aSymbol, const KIID_PATH &aPath)
Reference implementation: resolve a symbol instance by a linear scan over the raw instance vector,...
static const std::string KiCadSchematicFileExtension
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
static void LoadSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxString &aFileName)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
A simple container for schematic symbol instance information.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(InstanceLookupMatchesLinearScan)
VECTOR3I expected(15, 30, 45)
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
BOOST_CHECK_EQUAL(result, "25.4")
Definition of file extensions used in Kicad.