|
KiCad PCB EDA Suite
|
Tests for PROJECT_FILE class. More...
#include <qa_utils/wx_utils/unit_test_utils.h>#include <project/project_file.h>#include <settings/settings_manager.h>#include <wildcards_and_files_ext.h>#include <filesystem>#include <fstream>Go to the source code of this file.
Classes | |
| class | PROJECT_FILE_TEST_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (SaveAsUpdatesTopLevelSheetNames) | |
| Test that SaveAs updates top-level sheet names when they match the old project name. | |
| BOOST_AUTO_TEST_CASE (LoadFixesStaleTopLevelSheetReferences) | |
| Test that LoadFromFile fixes stale top_level_sheets references after template copy. | |
| BOOST_AUTO_TEST_CASE (LoadPreservesValidTopLevelSheetReferences) | |
| Test that LoadFromFile does NOT modify top_level_sheets when references are already valid. | |
Tests for PROJECT_FILE class.
Definition in file test_project_file.cpp.
| BOOST_AUTO_TEST_CASE | ( | LoadFixesStaleTopLevelSheetReferences | ) |
Test that LoadFromFile fixes stale top_level_sheets references after template copy.
When a project is created from a template, files are renamed to match the new project name, but the .kicad_pro content still references the template's filenames. LoadFromFile should detect and correct these stale references.
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/22951
Definition at line 126 of file test_project_file.cpp.
References BOOST_CHECK_EQUAL(), PROJECT_FILE::GetTopLevelSheets(), SETTINGS_MANAGER::LoadProject(), name, SETTINGS_MANAGER::Prj(), and project.
| BOOST_AUTO_TEST_CASE | ( | LoadPreservesValidTopLevelSheetReferences | ) |
Test that LoadFromFile does NOT modify top_level_sheets when references are already valid.
Definition at line 183 of file test_project_file.cpp.
References BOOST_CHECK_EQUAL(), PROJECT_FILE::GetTopLevelSheets(), SETTINGS_MANAGER::LoadProject(), name, SETTINGS_MANAGER::Prj(), and project.
| BOOST_AUTO_TEST_CASE | ( | SaveAsUpdatesTopLevelSheetNames | ) |
Test that SaveAs updates top-level sheet names when they match the old project name.
Regression test for https://gitlab.com/kicad/code/kicad/-/issues/22853
Definition at line 67 of file test_project_file.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), TOP_LEVEL_SHEET_INFO::filename, PROJECT_FILE::GetTopLevelSheets(), name, TOP_LEVEL_SHEET_INFO::name, FILEEXT::ProjectFileExtension, PROJECT_FILE::SaveAs(), and TOP_LEVEL_SHEET_INFO::uuid.