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

Go to the source code of this file.

Classes

struct  PCB_COMPONENT_CLASS_FIXTURE
 

Functions

 BOOST_FIXTURE_TEST_CASE (ComponentClasses, PCB_COMPONENT_CLASS_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (FinishNetlistUpdateClearsDeletedClassPointers, PCB_COMPONENT_CLASS_FIXTURE)
 Test that FinishNetlistUpdate clears footprint static component class pointers when their classes are deleted.
 
 BOOST_FIXTURE_TEST_CASE (FinishNetlistUpdatePreservesActiveClassPointers, PCB_COMPONENT_CLASS_FIXTURE)
 Test that FinishNetlistUpdate preserves footprint static component class pointers when their classes are still in use.
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/3]

BOOST_FIXTURE_TEST_CASE ( ComponentClasses ,
PCB_COMPONENT_CLASS_FIXTURE  )

Definition at line 48 of file test_component_classes.cpp.

References KI_TEST::LoadBoard().

◆ BOOST_FIXTURE_TEST_CASE() [2/3]

BOOST_FIXTURE_TEST_CASE ( FinishNetlistUpdateClearsDeletedClassPointers ,
PCB_COMPONENT_CLASS_FIXTURE  )

Test that FinishNetlistUpdate clears footprint static component class pointers when their classes are deleted.

This prevents use-after-free crashes during auto-save serialization. Regression test for GitLab issue #22623.

Definition at line 167 of file test_component_classes.cpp.

References BOOST_REQUIRE(), COMPONENT_CLASS_MANAGER::FinishNetlistUpdate(), FOOTPRINT, COMPONENT_CLASS_MANAGER::GetEffectiveStaticComponentClass(), FOOTPRINT::GetStaticComponentClass(), COMPONENT_CLASS_MANAGER::InitNetlistUpdate(), COMPONENT_CLASS::IsEmpty(), FOOTPRINT::SetReference(), and FOOTPRINT::SetStaticComponentClass().

◆ BOOST_FIXTURE_TEST_CASE() [3/3]

BOOST_FIXTURE_TEST_CASE ( FinishNetlistUpdatePreservesActiveClassPointers ,
PCB_COMPONENT_CLASS_FIXTURE  )