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

Test suite for embedded files in LIB_SYMBOL objects, including derived symbols. More...

#include <qa_utils/wx_utils/unit_test_utils.h>
#include <lib_symbol.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_io/sch_io_mgr.h>
#include <embedded_files.h>
#include <mmh3_hash.h>
#include <schematic.h>
#include <sch_screen.h>
#include <sch_sheet.h>
#include <sch_symbol.h>
#include <project.h>
#include <lib_id.h>
#include <wx/filename.h>
#include <wx/dir.h>

Go to the source code of this file.

Classes

class  SYMBOL_EMBEDDED_FILES_TEST_FIXTURE
 

Functions

 BOOST_AUTO_TEST_CASE (DerivedSymbolEmbeddedFiles)
 Test embedded files in parent and derived symbols: 1) Create a symbol and add an embedded file and save.
 
 BOOST_AUTO_TEST_CASE (CopySymbolPreservesEmbeddedFiles)
 Test that copying a symbol with embedded files preserves the files.
 
 BOOST_AUTO_TEST_CASE (AssignmentPreservesEmbeddedFiles)
 Test that assignment operator preserves embedded files.
 

Detailed Description

Test suite for embedded files in LIB_SYMBOL objects, including derived symbols.

Definition in file test_symbol_embedded_files.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/3]

BOOST_AUTO_TEST_CASE ( AssignmentPreservesEmbeddedFiles )

Test that assignment operator preserves embedded files.

Definition at line 254 of file test_symbol_embedded_files.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), and EMBEDDED_FILES::EMBEDDED_FILE::Validate().

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( CopySymbolPreservesEmbeddedFiles )

Test that copying a symbol with embedded files preserves the files.

Definition at line 226 of file test_symbol_embedded_files.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), copy, and EMBEDDED_FILES::EMBEDDED_FILE::Validate().

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( DerivedSymbolEmbeddedFiles )

Test embedded files in parent and derived symbols: 1) Create a symbol and add an embedded file and save.

2) Close and reload the symbol to verify that the embedded file still exists. 3) Create a derived symbol based on the first symbol and save. 4) Close and re-open the derived symbol. Ensure that the embedded file does not exist in the derived symbol. 5) Embed a new file in the derived symbol. 6) Close and reopen the derived symbol. Ensure that the new embedded file exists. 7) Add only the derived symbol to a new schematic sheet. Ensure that both embedded files are present in the schematic.

Definition at line 108 of file test_symbol_embedded_files.cpp.

References EMBEDDED_FILES::AddFile(), SCH_SCREEN::Append(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), EMBEDDED_FILES::EmbeddedFileMap(), SCH_SYMBOL::GetLibSymbolRef(), EMBEDDED_FILES::HasFile(), SCH_SHEET_PATH::push_back(), SCHEMATIC::Root(), LIB_SYMBOL::SetParent(), SCHEMATIC::SetRoot(), and SCH_SHEET::SetScreen().