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

Tests for ERC with rule areas, including regression test for issue 22854 (crash when running ERC twice with rule areas and modified items). More...

Go to the source code of this file.

Classes

struct  ERC_RULE_AREA_TEST_FIXTURE
 

Functions

 BOOST_FIXTURE_TEST_CASE (ERCRuleAreaItemDeletion, ERC_RULE_AREA_TEST_FIXTURE)
 Regression test for issue 22854.
 

Detailed Description

Tests for ERC with rule areas, including regression test for issue 22854 (crash when running ERC twice with rule areas and modified items).

Definition in file test_erc_rule_area.cpp.

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE()

BOOST_FIXTURE_TEST_CASE ( ERCRuleAreaItemDeletion ,
ERC_RULE_AREA_TEST_FIXTURE  )

Regression test for issue 22854.

When a schematic has rule areas and items are modified between ERC runs, the second ERC run would crash due to dangling pointers in the rule area's item cache. The fix ensures that items remove themselves from rule areas when destroyed.

Definition at line 59 of file test_erc_rule_area.cpp.

References SCH_SCREEN::Append(), BOOST_REQUIRE(), SCH_SYMBOL::Clone(), dummy, SCH_SCREEN::Items(), KI_TEST::LoadSchematic(), EE_RTREE::OfType(), SCH_SCREEN::Remove(), ERC_TESTER::RunTests(), and SCH_SYMBOL_T.