47 for(
unsigned i = 0; i < 4; ++i )
51 std::ostringstream ss;
90 BOOST_CHECK_THROW( m_empty_path.at( 0 ), std::out_of_range );
131 BOOST_CHECK( m_empty_path == otherEmpty );
133 BOOST_CHECK( m_empty_path != m_linear );
141 std::unique_ptr<SCHEMATIC> schematic;
142 wxFileName fn( wxString::Format( wxS(
"%snetlists/complex_hierarchy" ),
156 BOOST_CHECK( hierarchy.
GetOrdinalPath( schematic->RootScreen() ).value() == hierarchy.at( 0 ) );
159 SCH_SHEET* sheet = hierarchy.at( 1 ).Last();
163 sheet = hierarchy.at( 2 ).Last();
193 std::vector<SCH_SHEET> sheets;
195 for(
unsigned i = 0; i < 3; ++i )
197 sheets.emplace_back(
nullptr,
VECTOR2I( i, i ) );
198 sheets[i].SetParent( &schematicLocal );
231 const KIID_PATH before = m_linear.Path();
233 BOOST_REQUIRE_EQUAL( before.size(), 3u );
235 m_linear.push_back( &m_sheets[3] );
240 BOOST_CHECK( grown != before );
244 BOOST_CHECK( m_linear.Path() == before );
257 std::vector<SCH_SHEET_PATH> shared( 4000, m_linear );
261 unsigned threadCount = std::max( 4u, std::min( 8u, std::thread::hardware_concurrency() ) );
263 std::atomic<unsigned> live( 0 );
264 std::atomic<unsigned> mismatches( 0 );
265 std::vector<std::thread> threads;
267 for(
unsigned ii = 0; ii < threadCount; ++ii )
269 threads.emplace_back(
275 while( live.load() < threadCount )
276 std::this_thread::yield();
281 mismatches.fetch_add( 1 );
286 for( std::thread& thread : threads )
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
Holds all the data relating to one schematic.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::optional< SCH_SHEET_PATH > GetOrdinalPath(const SCH_SCREEN *aScreen) const
Return the ordinal sheet path of aScreen.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false, bool aEscapeSheetNames=false) const
Return the sheet path in a human readable form made from the sheet names.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_SCREEN * GetScreen() const
std::vector< SCH_SHEET > m_sheets
handy store of SCH_SHEET objects
SCH_SHEET_PATH m_empty_path
SCH_SHEET_PATH m_linear
We look at sheet 2 in the hierarchy: Sheets: 0 -> 1 -> 2.
TEST_SCH_SHEET_PATH_FIXTURE()
static const std::string KiCadSchematicFileExtension
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
bool IsUUIDPathWithLevels(const std::string &aStr, unsigned aLevels)
Predicate to check a string is a UUID path format.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
VECTOR3I expected(15, 30, 45)
BOOST_AUTO_TEST_CASE(Empty)
Declare the test suite.
BOOST_CHECK_PREDICATE(ArePolylineEndPointsNearCircle,(chain)(c.m_geom.m_center_point)(radius)(accuracy+epsilon))
BOOST_CHECK_EQUAL(result, "25.4")
Test utilities for timestamps.
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.