|
KiCad PCB EDA Suite
|
Tests for issue 16915: Bus label fails to match Netclass assignment pattern. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include <schematic_utils/eeschema_test_utils.h>#include <project/net_settings.h>#include <project/project_file.h>Go to the source code of this file.
Classes | |
| class | TEST_ISSUE16915_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (ForEachBusMemberExpansion) | |
| Test that ForEachBusMember correctly expands bus patterns. | |
| BOOST_AUTO_TEST_CASE (ParseBusVectorExpansion) | |
| Test that ParseBusVector correctly expands bus notation patterns. | |
| BOOST_AUTO_TEST_CASE (BusPatternMatchesBusMembers) | |
| Test that netclass patterns with bus notation match individual bus member nets. | |
| BOOST_AUTO_TEST_CASE (BusMemberNetclassHasCorrectColor) | |
| Test that netclass schematic colors are correctly applied to bus members. | |
| BOOST_AUTO_TEST_CASE (BusWireInheritsNetclassFromMembers) | |
| Test that bus wires inherit netclass from their members when all members share the same netclass. | |
| BOOST_AUTO_TEST_CASE (BusGroupPatternExpansion) | |
| Test that bus group patterns are correctly expanded. | |
| BOOST_AUTO_TEST_CASE (BusWithMixedNetclassesFallsBackToDefault) | |
| Test that bus with mixed netclass members falls back to default. | |
| BOOST_AUTO_TEST_CASE (NonBusPatternsStillWork) | |
| Test that non-bus patterns still work correctly. | |
| BOOST_AUTO_TEST_CASE (NetclassCacheInvalidation) | |
| Test that ClearCacheForNet properly invalidates cached netclass lookups. | |
Tests for issue 16915: Bus label fails to match Netclass assignment pattern.
When a netclass pattern like "/IN[0..7]" is defined, it should match the individual bus member nets (IN0, IN1, ..., IN7) and assign them the corresponding netclass. This affects both the coloring of wires in the schematic and the netclass assignment used for DRC and other operations.
Definition in file test_issue16915_bus_netclass.cpp.
| BOOST_AUTO_TEST_CASE | ( | BusGroupPatternExpansion | ) |
Test that bus group patterns are correctly expanded.
For patterns like "/PCI{North[0..2] South[3..5]}", the group should be expanded and each member vector should be further expanded to individual nets.
Definition at line 234 of file test_issue16915_bus_netclass.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_INFO(), and LoadSchematic().
| BOOST_AUTO_TEST_CASE | ( | BusMemberNetclassHasCorrectColor | ) |
Test that netclass schematic colors are correctly applied to bus members.
This tests the secondary aspect of issue 16915: bus member wires should be colored according to their netclass.
Definition at line 164 of file test_issue16915_bus_netclass.cpp.
References KIGFX::COLOR4D::b, BOOST_CHECK_EQUAL(), KIGFX::COLOR4D::g, LoadSchematic(), and KIGFX::COLOR4D::r.
| BOOST_AUTO_TEST_CASE | ( | BusPatternMatchesBusMembers | ) |
Test that netclass patterns with bus notation match individual bus member nets.
This is the core test for issue 16915: patterns like "/IN[0..7]" should match nets named "/IN0", "/IN1", etc.
Definition at line 124 of file test_issue16915_bus_netclass.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_INFO(), and LoadSchematic().
| BOOST_AUTO_TEST_CASE | ( | BusWireInheritsNetclassFromMembers | ) |
Test that bus wires inherit netclass from their members when all members share the same netclass.
This is the core visual fix for issue 16915: when looking up the netclass for a bus (e.g., "/IN[0..7]"), if all its member nets share the same netclass, the bus should inherit that netclass for coloring purposes.
Definition at line 198 of file test_issue16915_bus_netclass.cpp.
References KIGFX::COLOR4D::b, BOOST_CHECK_EQUAL(), KIGFX::COLOR4D::g, LoadSchematic(), and KIGFX::COLOR4D::r.
| BOOST_AUTO_TEST_CASE | ( | BusWithMixedNetclassesFallsBackToDefault | ) |
Test that bus with mixed netclass members falls back to default.
When bus members have different netclasses, the bus should use the default netclass.
Definition at line 273 of file test_issue16915_bus_netclass.cpp.
References BOOST_CHECK_EQUAL(), and LoadSchematic().
| BOOST_AUTO_TEST_CASE | ( | ForEachBusMemberExpansion | ) |
Test that ForEachBusMember correctly expands bus patterns.
Definition at line 48 of file test_issue16915_bus_netclass.cpp.
References BOOST_AUTO_TEST_CASE(), expected, and NET_SETTINGS::ForEachBusMember().
| BOOST_AUTO_TEST_CASE | ( | NetclassCacheInvalidation | ) |
Test that ClearCacheForNet properly invalidates cached netclass lookups.
This is related to issue 17891: when a net name changes, the cache for both old and new net names must be cleared so that netclass assignments are correctly updated.
Definition at line 322 of file test_issue16915_bus_netclass.cpp.
References BOOST_CHECK_EQUAL(), and LoadSchematic().
| BOOST_AUTO_TEST_CASE | ( | NonBusPatternsStillWork | ) |
Test that non-bus patterns still work correctly.
Regression test to ensure bus pattern expansion doesn't break regular patterns.
Definition at line 296 of file test_issue16915_bus_netclass.cpp.
References BOOST_CHECK_EQUAL(), and LoadSchematic().
| BOOST_AUTO_TEST_CASE | ( | ParseBusVectorExpansion | ) |
Test that ParseBusVector correctly expands bus notation patterns.
Definition at line 95 of file test_issue16915_bus_netclass.cpp.
References BOOST_CHECK_EQUAL(), expected, name, and NET_SETTINGS::ParseBusVector().