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

Test for issue #24870: deleting a top-level sheet blanked the page that was left behind. More...

#include <qa_utils/wx_utils/unit_test_utils.h>
#include <schematic.h>
#include <schematic_file_util.h>
#include <sch_line.h>
#include <sch_screen.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <sch_text.h>
#include <settings/settings_manager.h>
#include <project.h>
#include <locale_io.h>
#include <wx/filename.h>
#include <fstream>

Go to the source code of this file.

Classes

struct  ISSUE24870_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (DeleteDisplayedPageRetargetsCurrentSheet)
 Deleting the top-level sheet that is being displayed must retarget the current sheet onto a page that is still in the hierarchy, otherwise the editor keeps drawing the removed screen.
 
 BOOST_AUTO_TEST_CASE (DeletePageKeepsOtherPageContentOnDisk)
 The surviving page keeps its content, both in memory and through a save/reload round trip.
 

Detailed Description

Test for issue #24870: deleting a top-level sheet blanked the page that was left behind.

The schematic editor draws whatever screen the current sheet path points at, so removing the displayed top-level sheet has to leave that path on a surviving page. These tests cover the model half of the contract: the current sheet is retargeted onto a page that is still in the hierarchy, the surviving page keeps every item it had, and the survivor still round trips through disk.

Definition in file test_issue24870_top_level_sheet_delete.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( DeleteDisplayedPageRetargetsCurrentSheet )

Deleting the top-level sheet that is being displayed must retarget the current sheet onto a page that is still in the hierarchy, otherwise the editor keeps drawing the removed screen.

Definition at line 105 of file test_issue24870_top_level_sheet_delete.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), SCH_SCREEN::Items(), SCH_SHEET_PATH::push_back(), and EE_RTREE::size().

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( DeletePageKeepsOtherPageContentOnDisk )