48 for(
unsigned i = 0; i < 4; ++i )
52 std::ostringstream ss;
87 BOOST_CHECK_EQUAL( m_empty_path.size(), 0 );
89 BOOST_CHECK_THROW( m_empty_path.at( 0 ), std::out_of_range );
95 BOOST_CHECK_EQUAL( m_empty_path.Last(),
nullptr );
96 BOOST_CHECK_EQUAL( m_empty_path.LastScreen(),
nullptr );
98 BOOST_CHECK_EQUAL( m_empty_path.PathAsString(),
"/" );
99 BOOST_CHECK_EQUAL( m_empty_path.PathHumanReadable(),
"/" );
108 BOOST_CHECK_EQUAL( m_linear.size(), 3 );
110 BOOST_CHECK_EQUAL( m_linear.at( 0 ), &m_sheets[0] );
111 BOOST_CHECK_EQUAL( m_linear.at( 1 ), &m_sheets[1] );
112 BOOST_CHECK_EQUAL( m_linear.at( 2 ), &m_sheets[2] );
114 BOOST_CHECK_EQUAL( m_linear.Last(), &m_sheets[2] );
115 BOOST_CHECK_EQUAL( m_linear.LastScreen(),
nullptr );
118 BOOST_CHECK_PREDICATE(
122 BOOST_CHECK_EQUAL( m_linear.PathHumanReadable(),
"/Sheet1/Sheet2/" );
130 BOOST_CHECK( m_empty_path == otherEmpty );
132 BOOST_CHECK( m_empty_path != m_linear );
140 std::unique_ptr<SCHEMATIC> schematic;
147 BOOST_CHECK_EQUAL( hierarchy.size(), 3 );
153 BOOST_CHECK( hierarchy.
GetOrdinalPath( schematic->RootScreen() ).value() == hierarchy.at( 0 ) );
156 SCH_SHEET* sheet = hierarchy.at( 1 ).Last();
160 sheet = hierarchy.at( 2 ).Last();
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr)
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...
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 ProjectFileExtension
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_SUITE_END()
BOOST_AUTO_TEST_CASE(Empty)
Declare the test suite.
Test utilities for timestamps.
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.