|
KiCad PCB EDA Suite
|
Lightweight regression tests for EasyEDA Pro v3 raw index and parser behavior. More...
#include <boost/test/unit_test.hpp>#include <array>#include <set>#include <qa_utils/wx_utils/unit_test_utils.h>#include <io/easyedapro/easyedapro_import_utils.h>#include <io/easyedapro/easyedapro_v3_parser.h>#include <sch_io/easyedapro/sch_easyedapro_v3_parser.h>#include <pgm_base.h>#include <schematic.h>#include <sch_io/sch_io.h>#include <sch_io/sch_io_mgr.h>#include <sch_label.h>#include <sch_line.h>#include <sch_pin.h>#include <sch_screen.h>#include <sch_symbol.h>#include <sch_text.h>#include <settings/settings_manager.h>#include <wx/filefn.h>#include <wx/filename.h>#include <wx/wfstream.h>#include <wx/zipstrm.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (LibraryIndexMergeKeepsSymbolAndFootprintNames) | |
| BOOST_AUTO_TEST_CASE (LibraryItemDuplicateNamesGetNumericSuffix) | |
| BOOST_AUTO_TEST_CASE (BuildProjectIndexHasSchematicSheets) | |
| BOOST_AUTO_TEST_CASE (RawSchematicPageContainsTextWireAndNetAttr) | |
| BOOST_AUTO_TEST_CASE (RawSymbolContainsBlobObjectReference) | |
| BOOST_AUTO_TEST_CASE (RawSymbolPartUnitsAndPinOrientationAreStable) | |
| BOOST_AUTO_TEST_CASE (PluginLoadProducesWireTextAndLabel) | |
| BOOST_AUTO_TEST_CASE (PluginLoadPreservesWireNetLabelAlignment) | |
| BOOST_AUTO_TEST_CASE (PluginLoadConvertsNetportsToGlobalLabels) | |
| BOOST_AUTO_TEST_CASE (PluginLoadKeepsSchematicVerticalOrderAndFootprints) | |
| BOOST_AUTO_TEST_CASE (PluginLoadPowerSymbolsKeepValueAndVisibility) | |
| BOOST_AUTO_TEST_CASE (PluginLoadFillsRootSheetWithFirstPage) | |
| The first EasyEDA page must fill the root sheet instead of leaving an empty index sheet above the real pages. | |
| BOOST_AUTO_TEST_CASE (AlignTokenMapsToJustify) | |
| The vertical alignment mapping must read only the vertical token. | |
Lightweight regression tests for EasyEDA Pro v3 raw index and parser behavior.
Definition in file eeschema/test_easyedapro_v3_import.cpp.
| BOOST_AUTO_TEST_CASE | ( | AlignTokenMapsToJustify | ) |
The vertical alignment mapping must read only the vertical token.
CENTER is the horizontal token, so a bare CENTER match used to turn e.g. CENTER_BOTTOM into center-justified text.
Definition at line 1000 of file eeschema/test_easyedapro_v3_import.cpp.
References EASYEDAPRO::AlignToFontH(), EASYEDAPRO::AlignToFontV(), and BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | BuildProjectIndexHasSchematicSheets | ) |
Definition at line 189 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_REQUIRE(), EASYEDAPRO::BuildV3ProjectIndexFromRawDocs(), getEasyEdaProV3ArchivePath(), project, and v3.
| BOOST_AUTO_TEST_CASE | ( | LibraryIndexMergeKeepsSymbolAndFootprintNames | ) |
Definition at line 113 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), EASYEDAPRO::BuildV3LibraryItemMap(), and EASYEDAPRO::V3_DOC_PARSER::LoadLibrary().
| BOOST_AUTO_TEST_CASE | ( | LibraryItemDuplicateNamesGetNumericSuffix | ) |
Definition at line 154 of file eeschema/test_easyedapro_v3_import.cpp.
References EASYEDAPRO::BuildV3LibraryItemMap(), and EASYEDAPRO::V3_DOC_PARSER::LoadLibrary().
| BOOST_AUTO_TEST_CASE | ( | PluginLoadConvertsNetportsToGlobalLabels | ) |
Definition at line 580 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), expected, getEasyEdaProV3ArchivePath(), SCH_SYMBOL::GetRef(), PGM_BASE::GetSettingsManager(), SCH_LABEL_BASE::GetShape(), EDA_TEXT::GetText(), EASYEDAPRO::V3_ROW::inner, SCH_SCREEN::Items(), L_BIDI, L_INPUT, L_OUTPUT, SETTINGS_MANAGER::LoadProject(), name, EE_RTREE::OfType(), Pgm(), Prj(), SCH_GLOBAL_LABEL_T, SCH_SYMBOL_T, EASYEDAPRO::V3_ROW::type, v3, EASYEDAPRO::V3GetInt(), EASYEDAPRO::V3GetString(), and EASYEDAPRO::V3JsonToString().
| BOOST_AUTO_TEST_CASE | ( | PluginLoadFillsRootSheetWithFirstPage | ) |
The first EasyEDA page must fill the root sheet instead of leaving an empty index sheet above the real pages.
Definition at line 962 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_REQUIRE(), getEasyEdaProV3ArchivePath(), BASE_SCREEN::GetPageNumber(), SCH_SHEET::GetScreen(), PGM_BASE::GetSettingsManager(), SCH_SCREEN::Items(), SETTINGS_MANAGER::LoadProject(), EE_RTREE::OfType(), Pgm(), Prj(), and SCH_SYMBOL_T.
| BOOST_AUTO_TEST_CASE | ( | PluginLoadKeepsSchematicVerticalOrderAndFootprints | ) |
Definition at line 742 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), getEasyEdaProV3ArchivePath(), SCH_SYMBOL::GetFootprintFieldText(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), PGM_BASE::GetSettingsManager(), SCH_SCREEN::Items(), SETTINGS_MANAGER::LoadProject(), EE_RTREE::OfType(), Pgm(), Prj(), SCH_SYMBOL_T, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PluginLoadPowerSymbolsKeepValueAndVisibility | ) |
Definition at line 816 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), delta, getEasyEdaProV3ArchivePath(), SCH_SYMBOL::GetField(), EDA_TEXT::GetHorizJustify(), SCH_SYMBOL::GetOrientation(), SCH_SYMBOL::GetPins(), SCH_FIELD::GetPosition(), SCH_SYMBOL::GetPosition(), PGM_BASE::GetSettingsManager(), SCH_FIELD::GetShownText(), SYMBOL::GetTransform(), EDA_TEXT::GetVertJustify(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, SCH_SYMBOL::IsGlobalPower(), EDA_TEXT::IsVisible(), SCH_SCREEN::Items(), SETTINGS_MANAGER::LoadProject(), EE_RTREE::OfType(), Pgm(), PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, Prj(), SCH_SYMBOL_T, SYM_ORIENT_0, VALUE, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | PluginLoadPreservesWireNetLabelAlignment | ) |
Definition at line 443 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), getEasyEdaProV3ArchivePath(), PGM_BASE::GetSettingsManager(), SCH_LABEL_BASE::GetSpinStyle(), EDA_TEXT::GetText(), EASYEDAPRO::V3_ROW::inner, SCH_SCREEN::Items(), SPIN_STYLE::LEFT, SETTINGS_MANAGER::LoadProject(), EE_RTREE::OfType(), Pgm(), Prj(), SPIN_STYLE::RIGHT, SPIN_STYLE::RotateCCW(), SCH_LABEL_T, EASYEDAPRO::V3_ROW::type, v3, EASYEDAPRO::V3GetBool(), EASYEDAPRO::V3GetInt(), EASYEDAPRO::V3GetString(), and EASYEDAPRO::V3JsonToString().
| BOOST_AUTO_TEST_CASE | ( | PluginLoadProducesWireTextAndLabel | ) |
Definition at line 370 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_REQUIRE(), getEasyEdaProV3ArchivePath(), SCH_ITEM::GetLayer(), PGM_BASE::GetSettingsManager(), EDA_TEXT::GetText(), SCH_SCREEN::Items(), LAYER_WIRE, SETTINGS_MANAGER::LoadProject(), EE_RTREE::OfType(), Pgm(), Prj(), SCH_LABEL_T, SCH_LINE_T, SCH_TEXT_T, and text.
| BOOST_AUTO_TEST_CASE | ( | RawSchematicPageContainsTextWireAndNetAttr | ) |
Definition at line 216 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_REQUIRE(), getEasyEdaProV3ArchivePath(), EASYEDAPRO::V3_ROW::inner, EASYEDAPRO::V3_ROW::type, v3, and EASYEDAPRO::V3GetString().
| BOOST_AUTO_TEST_CASE | ( | RawSymbolContainsBlobObjectReference | ) |
Definition at line 256 of file eeschema/test_easyedapro_v3_import.cpp.
References BOOST_REQUIRE(), getEasyEdaProV3ArchivePath(), EASYEDAPRO::V3_ROW::inner, EASYEDAPRO::V3_ROW::type, v3, and EASYEDAPRO::V3GetString().
| BOOST_AUTO_TEST_CASE | ( | RawSymbolPartUnitsAndPinOrientationAreStable | ) |
Definition at line 290 of file eeschema/test_easyedapro_v3_import.cpp.
References EASYEDAPRO::PRJ_DEVICE::attributes, BOOST_CHECK_EQUAL(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), EASYEDAPRO::BuildV3ProjectIndexFromRawDocs(), getEasyEdaProV3ArchivePath(), LIB_SYMBOL::GetPins(), LIB_SYMBOL::GetUnitCount(), EASYEDAPRO::SYM_INFO::libSymbol, SCH_EASYEDAPRO_V3_PARSER::ParseSymbol(), pin, PIN_LEFT, PIN_RIGHT, project, and v3.