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

Tests for SYMBOL_EDITOR_PIN_TOOL::SynchronizeOtherUnits(), the synchronized pins mode propagation that runs after the pin properties dialog is accepted (issue #25280). More...

#include <qa_utils/wx_utils/unit_test_utils.h>
#include "eeschema_test_utils.h"
#include <lib_symbol.h>
#include <sch_pin.h>
#include <sch_io/sch_io.h>
#include <sch_io/sch_io_mgr.h>
#include <tools/symbol_editor_pin_tool.h>
#include <wx/filename.h>
#include <memory>

Go to the source code of this file.

Functions

static std::unique_ptr< LIB_SYMBOLloadQuadBuffer ()
 Load 74LS125, a quad tri-state buffer whose four interchangeable units carry identically placed pins plus a common power unit.
 
static SCH_PINfirstGateInput (LIB_SYMBOL &aSymbol)
 The input pin of the first gate, i.e.
 
static int countMatchingPins (LIB_SYMBOL &aSymbol, const SCH_PIN &aPin)
 Pins of the other units that the edit is expected to subsume: same position, orientation, type, visibility and name as the pin before the edit.
 
 BOOST_AUTO_TEST_CASE (CommonToAllUnitsRemovesSubsumedPins)
 Making a pin common to all units deletes the pins it subsumes in the other units.
 
 BOOST_AUTO_TEST_CASE (PerUnitEditPropagatesWithoutRemoving)
 A pin that stays bound to its own unit propagates its properties to the matching pins of the other units without deleting any of them.
 

Detailed Description

Tests for SYMBOL_EDITOR_PIN_TOOL::SynchronizeOtherUnits(), the synchronized pins mode propagation that runs after the pin properties dialog is accepted (issue #25280).

Definition in file test_issue25280_pin_sync_units.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( CommonToAllUnitsRemovesSubsumedPins )

Making a pin common to all units deletes the pins it subsumes in the other units.

The deleted pins must not be read back or deleted a second time.

Definition at line 109 of file test_issue25280_pin_sync_units.cpp.

References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), countMatchingPins(), firstGateInput(), SCH_PIN::GetPosition(), SCH_ITEM::GetUnit(), loadQuadBuffer(), pin, SCH_ITEM::SetUnit(), and SYMBOL_EDITOR_PIN_TOOL::SynchronizeOtherUnits().

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( PerUnitEditPropagatesWithoutRemoving )

A pin that stays bound to its own unit propagates its properties to the matching pins of the other units without deleting any of them.

Definition at line 155 of file test_issue25280_pin_sync_units.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), countMatchingPins(), firstGateInput(), SCH_PIN::GetName(), SCH_PIN::GetNameTextSize(), SCH_PIN::GetPosition(), loadQuadBuffer(), pin, schIUScale, SCH_PIN::SetName(), SCH_PIN::SetNameTextSize(), and SYMBOL_EDITOR_PIN_TOOL::SynchronizeOtherUnits().

◆ countMatchingPins()

static int countMatchingPins ( LIB_SYMBOL & aSymbol,
const SCH_PIN & aPin )
static

Pins of the other units that the edit is expected to subsume: same position, orientation, type, visibility and name as the pin before the edit.

Definition at line 82 of file test_issue25280_pin_sync_units.cpp.

References SCH_PIN::GetName(), SCH_PIN::GetOrientation(), LIB_SYMBOL::GetPins(), SCH_PIN::GetPosition(), SCH_PIN::GetType(), SCH_ITEM::GetUnit(), SCH_PIN::IsVisible(), and pin.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ firstGateInput()

static SCH_PIN * firstGateInput ( LIB_SYMBOL & aSymbol)
static

The input pin of the first gate, i.e.

one of the pins the other three gates replicate.

Definition at line 63 of file test_issue25280_pin_sync_units.cpp.

References LIB_SYMBOL::GetPins(), pin, PIN_RIGHT, and PT_INPUT.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ loadQuadBuffer()

static std::unique_ptr< LIB_SYMBOL > loadQuadBuffer ( )
static

Load 74LS125, a quad tri-state buffer whose four interchangeable units carry identically placed pins plus a common power unit.

Its units are not locked, which is what enables synchronized pins mode in the symbol editor.

Definition at line 45 of file test_issue25280_pin_sync_units.cpp.

References KI_TEST::GetEeschemaTestDataDir().

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().