KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_issue23403_shared_subsheet_screen.cpp File Reference

Test for issue #23403: Top level schematics with shared sheets is broken. More...

#include <boost/test/unit_test.hpp>
#include <eeschema_test_utils.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_screen.h>
#include <sch_sheet.h>
#include <schematic.h>
#include <settings/settings_manager.h>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <locale_io.h>
#include <wildcards_and_files_ext.h>
#include <wx/filename.h>

Go to the source code of this file.

Classes

struct  ISSUE23403_FIXTURE
 

Functions

static SCH_SCREENfindSubSheetScreen (SCH_SHEET *aTopSheet, const wxString &aSubFileName)
 
 BOOST_AUTO_TEST_CASE (SharedSubSheetScreenReuse)
 When two top-level sheets both reference the same sub-sheet file, loading them through the same SCH_IO instance must produce shared SCH_SCREEN pointers.
 

Detailed Description

Test for issue #23403: Top level schematics with shared sheets is broken.

When multiple top-level sheets reference the same sub-sheet file, they must share the same SCH_SCREEN object. Without this, edits made through one path are invisible through the other, and saving overwrites earlier changes.

Definition in file test_issue23403_shared_subsheet_screen.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( SharedSubSheetScreenReuse )

When two top-level sheets both reference the same sub-sheet file, loading them through the same SCH_IO instance must produce shared SCH_SCREEN pointers.

Definition at line 103 of file test_issue23403_shared_subsheet_screen.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_REQUIRE(), dummy, findSubSheetScreen(), KI_TEST::GetEeschemaTestDataDir(), SCH_SCREEN::GetRefCount(), FILEEXT::KiCadSchematicFileExtension, and SCH_IO_KICAD_SEXPR::LoadSchematicFile().

◆ findSubSheetScreen()

static SCH_SCREEN * findSubSheetScreen ( SCH_SHEET * aTopSheet,
const wxString & aSubFileName )
static