|
KiCad PCB EDA Suite
|
#include <bitset>#include <filesystem>#include <string>#include <board.h>#include <footprint.h>#include <pcb_generator.h>#include <pcb_group.h>#include <pcb_text.h>#include <pcb_track.h>#include <generators/pcb_tuning_pattern.h>#include <common.h>#include <pcbnew_utils/board_construction_utils.h>#include <pcbnew_utils/board_file_utils.h>#include <qa_utils/wx_utils/unit_test_utils.h>Go to the source code of this file.
Enumerations | |
| enum | ItemType { TEXT0 , TEXT1 , TEXT2 , TEXT3 , TEXT4 , TEXT5 , TEXT6 , TEXT7 , TEXT8 , REMOVED_TEXT , GROUP0 , GROUP1 , GROUP2 , NAME_GROUP3 , NAME_GROUP4 , NAME_GROUP3_DUP , REMOVED_GROUP , NUM_ITEMS } |
Functions | |
| std::unique_ptr< BOARD > | createBoard (const std::vector< std::vector< ItemType > > &spec) |
| void | testGroupEqual (const PCB_GROUP &group1, const PCB_GROUP &group2) |
| void | testGroupsEqual (const GROUPS &groups1, const GROUPS &groups2) |
| void | testSaveLoad (const std::vector< std::vector< ItemType > > &spec) |
| BOOST_AUTO_TEST_CASE (HealthyGroups) | |
| BOOST_AUTO_TEST_CASE (SingleMemberGroupsSaved) | |
| BOOST_AUTO_TEST_CASE (InvalidGroups) | |
| BOOST_AUTO_TEST_CASE (DeepCloneGroupMembership) | |
| Verify that PCB_GROUP::DeepClone produces a group whose m_items reference the cloned children rather than the originals, and that the cloned group round-trips through save/load with correct membership. | |
| BOOST_AUTO_TEST_CASE (DeepCloneNestedGeneratorMembership) | |
| Verify that PCB_GENERATOR::DeepClone correctly recurses into nested generators, not just nested groups. | |
Variables | |
| static PCB_TEXT * | s_removedText = nullptr |
| static PCB_GROUP * | s_removedGroup = nullptr |
| enum ItemType |
| Enumerator | |
|---|---|
| TEXT0 | |
| TEXT1 | |
| TEXT2 | |
| TEXT3 | |
| TEXT4 | |
| TEXT5 | |
| TEXT6 | |
| TEXT7 | |
| TEXT8 | |
| REMOVED_TEXT | |
| GROUP0 | |
| GROUP1 | |
| GROUP2 | |
| NAME_GROUP3 | |
| NAME_GROUP4 | |
| NAME_GROUP3_DUP | |
| REMOVED_GROUP | |
| NUM_ITEMS | |
Definition at line 45 of file group_saveload.cpp.
| BOOST_AUTO_TEST_CASE | ( | DeepCloneGroupMembership | ) |
Verify that PCB_GROUP::DeepClone produces a group whose m_items reference the cloned children rather than the originals, and that the cloned group round-trips through save/load with correct membership.
Definition at line 287 of file group_saveload.cpp.
References APPEND, KIID::AsString(), BOOST_CHECK_EQUAL(), BOOST_CHECK_MESSAGE(), KI_TEST::DumpBoardToFile(), EDA_GROUP::GetItems(), EDA_GROUP::GetName(), group, EDA_ITEM::m_Uuid, path, KI_TEST::ReadBoardFromFileOrStream(), RECURSE, PCB_GROUP::RunOnChildren(), and EDA_TEXT::SetText().
| BOOST_AUTO_TEST_CASE | ( | DeepCloneNestedGeneratorMembership | ) |
Verify that PCB_GENERATOR::DeepClone correctly recurses into nested generators, not just nested groups.
Without this, a generator containing another generator would leave the inner generator's m_items pointing at original board items.
Definition at line 361 of file group_saveload.cpp.
References EDA_GROUP::AddItem(), BOOST_CHECK_EQUAL(), PCB_GENERATOR::DeepClone(), EDA_GROUP::GetItems(), PCB_GENERATOR_T, text, and EDA_ITEM::Type().
| BOOST_AUTO_TEST_CASE | ( | HealthyGroups | ) |
Definition at line 229 of file group_saveload.cpp.
References GROUP0, GROUP1, NAME_GROUP3, testSaveLoad(), TEXT0, TEXT1, TEXT2, TEXT3, TEXT4, TEXT5, and TEXT6.
| BOOST_AUTO_TEST_CASE | ( | InvalidGroups | ) |
Definition at line 259 of file group_saveload.cpp.
References BOOST_CHECK_EQUAL(), createBoard(), GROUP0, GROUP1, GROUP2, NAME_GROUP3, NAME_GROUP4, s_removedGroup, s_removedText, TEXT0, TEXT1, TEXT2, TEXT3, and TEXT4.
| BOOST_AUTO_TEST_CASE | ( | SingleMemberGroupsSaved | ) |
Definition at line 248 of file group_saveload.cpp.
References BOOST_CHECK_EQUAL(), createBoard(), KI_TEST::DumpBoardToFile(), path, KI_TEST::ReadBoardFromFileOrStream(), and TEXT0.
Definition at line 79 of file group_saveload.cpp.
References _, BOOST_CHECK_EQUAL(), EDA_GROUP::GetName(), group, GROUP0, name, NAME_GROUP3, NAME_GROUP3_DUP, NUM_ITEMS, REMOVED_GROUP, REMOVED_TEXT, s_removedGroup, s_removedText, EDA_GROUP::SetName(), and EDA_TEXT::SetText().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and testSaveLoad().
Definition at line 165 of file group_saveload.cpp.
References KIID::AsString(), BOOST_CHECK_EQUAL(), EDA_GROUP::GetItems(), EDA_GROUP::GetName(), and EDA_ITEM::m_Uuid.
Referenced by testGroupsEqual().
Definition at line 191 of file group_saveload.cpp.
References BOOST_CHECK_EQUAL(), and testGroupEqual().
Referenced by testSaveLoad().
| void testSaveLoad | ( | const std::vector< std::vector< ItemType > > & | spec | ) |
Definition at line 215 of file group_saveload.cpp.
References createBoard(), KI_TEST::DumpBoardToFile(), path, KI_TEST::ReadBoardFromFileOrStream(), and testGroupsEqual().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 71 of file group_saveload.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and createBoard().
|
static |
Definition at line 70 of file group_saveload.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and createBoard().