|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <qa_utils/wx_utils/unit_test_utils.h>#include <sch_io/orcad/sch_io_orcad.h>#include <sch_io/orcad/orcad_cache.h>#include <sch_io/orcad/orcad_converter.h>#include <sch_io/orcad/orcad_ole.h>#include <sch_io/orcad/orcad_page.h>#include <schematic.h>#include <connection_graph.h>#include <sch_screen.h>#include <sch_sheet.h>#include <sch_sheet_pin.h>#include <sch_sheet_path.h>#include <sch_symbol.h>#include <sch_label.h>#include <sch_line.h>#include <sch_bitmap.h>#include <sch_shape.h>#include <sch_pin.h>#include <lib_symbol.h>#include <reporter.h>#include <settings/settings_manager.h>#include <wx/ffile.h>#include <wx/filefn.h>#include <wx/filename.h>#include <algorithm>#include <filesystem>#include <fstream>#include <map>#include <memory>#include <set>#include <sstream>#include <string>Go to the source code of this file.
Classes | |
| struct | ORCAD_SCH_IMPORT_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (PrimitiveLineWidth) | |
| BOOST_AUTO_TEST_CASE (CaptureColorPalette) | |
| BOOST_AUTO_TEST_CASE (CaptureCompoundFileName) | |
| BOOST_AUTO_TEST_CASE (CaptureStrokeAndFillSemantics) | |
| BOOST_AUTO_TEST_CASE (CapturePageOrder) | |
| BOOST_AUTO_TEST_CASE (PrimitiveStrokeAndFillStyles) | |
| BOOST_AUTO_TEST_CASE (PrimitivePolygonStylesBeforePoints) | |
| BOOST_AUTO_TEST_CASE (PrimitiveSymbolVectorContents) | |
| BOOST_AUTO_TEST_CASE (OleMetafilePreviewExtraction) | |
| BOOST_AUTO_TEST_CASE (OleNativeBitmapExtraction) | |
| BOOST_AUTO_TEST_CASE (LegacyPageNetGroups) | |
| BOOST_AUTO_TEST_CASE (RejectsSpecctraTextDsn) | |
| BOOST_AUTO_TEST_CASE (RejectsNonexistentFile) | |
| BOOST_AUTO_TEST_CASE (RejectsWrongExtension) | |
| static std::string | trimCell (std::string aText) |
| static std::vector< std::string > | splitRefs (const std::string &aCell) |
| static std::set< std::string > | parseBomRefs (const std::string &aPath) |
| static std::set< std::string > | parseNetComs (const std::string &aPath) |
| static std::set< std::string > | collectImportedRefs (SCHEMATIC &aSchematic) |
| Unique refdes of real (non-power) parts. | |
| static std::string | terminalToken (const std::string &aRef, const std::string &aPin) |
| static std::vector< std::set< std::string > > | parseNetTerminals (const std::string &aPath) |
| Net terminal sets from .NET. | |
| static std::pair< int, int > | checkConnectivity (SCHEMATIC &aSchematic, const std::vector< std::set< std::string > > &aNets, std::vector< std::set< std::string > > *aInconsistent=nullptr) |
| Count ground-truth nets whose resolvable terminals all land on one KiCad net after connectivity rebuild. | |
| static std::set< std::string > | expectedRefsFor (const std::filesystem::path &aDsn, std::string &aSource) |
| Ground-truth companion beside .DSN, .NET preferred over .BOM. | |
| BOOST_AUTO_TEST_CASE (CorpusValidation) | |
| static std::filesystem::path | findCorpusDesign (const std::filesystem::path &aRoot, const std::string &aFileName) |
| BOOST_AUTO_TEST_CASE (Issue25005Hierarchy) | |
| BOOST_AUTO_TEST_CASE (Issue25009PageOrderAndGraphics) | |
| BOOST_AUTO_TEST_CASE (OlbLibraryImport) | |
| BOOST_AUTO_TEST_CASE (MultiPageFlatImport) | |
| BOOST_AUTO_TEST_CASE (ComponentDetailImport) | |
| BOOST_AUTO_TEST_CASE | ( | CaptureColorPalette | ) |
Definition at line 237 of file test_orcad_sch_import.cpp.
References OrcadColor(), and KIGFX::COLOR4D::UNSPECIFIED.
| BOOST_AUTO_TEST_CASE | ( | CaptureCompoundFileName | ) |
Definition at line 249 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), and OrcadNormalizeCfbName().
| BOOST_AUTO_TEST_CASE | ( | CapturePageOrder | ) |
Definition at line 275 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), and OrcadPageOrder().
| BOOST_AUTO_TEST_CASE | ( | CaptureStrokeAndFillSemantics | ) |
Definition at line 256 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), CROSS_HATCH, DASHDOTDOT, DEFAULT, FILLED_WITH_BG_BODYCOLOR, HATCH, NO_FILL, OrcadFillType(), OrcadLineStyle(), OrcadLineWidthIu(), REVERSE_HATCH, schIUScale, and SOLID.
| BOOST_AUTO_TEST_CASE | ( | ComponentDetailImport | ) |
Definition at line 1529 of file test_orcad_sch_import.cpp.
References ANGLE_HORIZONTAL, ANGLE_VERTICAL, BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), SPIN_STYLE::BOTTOM, SCH_FIELD::GetDrawRotation(), SCH_SYMBOL::GetField(), EDA_TEXT::GetHorizJustify(), SCH_FIELD::GetPosition(), SCH_SYMBOL::GetRef(), SCH_LABEL_BASE::GetSpinStyle(), EDA_TEXT::GetText(), SCH_FIELD::GetText(), GR_TEXT_H_ALIGN_LEFT, SETTINGS_MANAGER::LoadProject(), SCH_IO_ORCAD::LoadSchematicFile(), path, SETTINGS_MANAGER::Prj(), REFERENCE, SCH_GLOBAL_LABEL_T, SCH_NO_CONNECT_T, SCH_SYMBOL_T, SCHEMATIC, top(), SPIN_STYLE::UP, VALUE, and VECTOR2< T >::x.
| BOOST_AUTO_TEST_CASE | ( | CorpusValidation | ) |
Definition at line 834 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), SCH_IO_ORCAD::CanReadSchematicFile(), checkConnectivity(), collectImportedRefs(), expected, expectedRefsFor(), SCH_ITEM::GetLayer(), SCH_LINE::GetLineColor(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetValue(), SCH_SCREEN::Items(), LAYER_BUS, LAYER_WIRE, SETTINGS_MANAGER::LoadProject(), SCH_IO_ORCAD::LoadSchematicFile(), OrcadColor(), parseNetTerminals(), path, SETTINGS_MANAGER::Prj(), reporter, SCH_BITMAP_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_LINE_T, SCH_SHAPE_T, SCH_SYMBOL_T, SCH_TEXT_T, SCHEMATIC, and IO_BASE::SetReporter().
| BOOST_AUTO_TEST_CASE | ( | Issue25005Hierarchy | ) |
Definition at line 1200 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), findCorpusDesign(), SCH_SHEET::GetField(), SCH_SHEET::GetPins(), SCH_SHEET::GetScreen(), SCH_FIELD::GetText(), SCH_SCREEN::Items(), SETTINGS_MANAGER::LoadProject(), SCH_IO_ORCAD::LoadSchematicFile(), EE_RTREE::OfType(), pin, SETTINGS_MANAGER::Prj(), SCH_HIER_LABEL_T, SCH_SHEET_T, SCHEMATIC, and SHEET_NAME.
| BOOST_AUTO_TEST_CASE | ( | Issue25009PageOrderAndGraphics | ) |
Definition at line 1281 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), findCorpusDesign(), EDA_SHAPE::GetFillMode(), SCH_LINE::GetLineWidth(), SETTINGS_MANAGER::LoadProject(), SCH_IO_ORCAD::LoadSchematicFile(), NO_FILL, SETTINGS_MANAGER::Prj(), SCH_LINE_T, SCH_SHAPE_T, SCH_TABLE_T, SCH_TEXT_T, SCHEMATIC, and SHEET_NAME.
| BOOST_AUTO_TEST_CASE | ( | LegacyPageNetGroups | ) |
Definition at line 431 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), ORCAD_RAW_PAGE::netGroups, ORCAD_ST_PAGE, and OrcadParsePageV2().
| BOOST_AUTO_TEST_CASE | ( | MultiPageFlatImport | ) |
Definition at line 1454 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), SCH_SYMBOL::GetField(), SCH_FIELD::GetPosition(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), SETTINGS_MANAGER::LoadProject(), SCH_IO_ORCAD::LoadSchematicFile(), path, SETTINGS_MANAGER::Prj(), REFERENCE, SCH_GLOBAL_LABEL_T, SCH_SYMBOL_T, SCHEMATIC, SHEET_NAME, top(), and VECTOR2< T >::x.
| BOOST_AUTO_TEST_CASE | ( | OlbLibraryImport | ) |
Definition at line 1371 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), and SCH_IO_ORCAD::EnumerateSymbolLib().
| BOOST_AUTO_TEST_CASE | ( | OleMetafilePreviewExtraction | ) |
Definition at line 394 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), ORCAD_OLE_PREVIEW::data, name, OrcadExtractOlePreview(), ORCAD_OLE_PREVIEW::type, and WMF.
| BOOST_AUTO_TEST_CASE | ( | OleNativeBitmapExtraction | ) |
Definition at line 413 of file test_orcad_sch_import.cpp.
References BMP, BOOST_CHECK_EQUAL(), ORCAD_OLE_PREVIEW::data, name, OrcadExtractOlePreview(), and ORCAD_OLE_PREVIEW::type.
| BOOST_AUTO_TEST_CASE | ( | PrimitiveLineWidth | ) |
Definition at line 216 of file test_orcad_sch_import.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), LINE, ORCAD_PRIM_LINE, and OrcadReadPrimitive().
| BOOST_AUTO_TEST_CASE | ( | PrimitivePolygonStylesBeforePoints | ) |
Definition at line 324 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), ORCAD_PRIM_POLYGON, and OrcadReadPrimitive().
| BOOST_AUTO_TEST_CASE | ( | PrimitiveStrokeAndFillStyles | ) |
Definition at line 299 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), ORCAD_PRIM_RECT, and OrcadReadPrimitive().
| BOOST_AUTO_TEST_CASE | ( | PrimitiveSymbolVectorContents | ) |
Definition at line 353 of file test_orcad_sch_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), GROUP, ORCAD_PRIM_SYMBOL_VECTOR, OrcadReadPrimitive(), POLYLINE, and ORCAD_STREAM::PREAMBLE.
| BOOST_AUTO_TEST_CASE | ( | RejectsNonexistentFile | ) |
Definition at line 481 of file test_orcad_sch_import.cpp.
References BOOST_REQUIRE().
| BOOST_AUTO_TEST_CASE | ( | RejectsSpecctraTextDsn | ) |
Definition at line 471 of file test_orcad_sch_import.cpp.
References BOOST_REQUIRE().
| BOOST_AUTO_TEST_CASE | ( | RejectsWrongExtension | ) |
Definition at line 490 of file test_orcad_sch_import.cpp.
References BOOST_REQUIRE().
|
static |
Count ground-truth nets whose resolvable terminals all land on one KiCad net after connectivity rebuild.
Returns {consistent, checkable}.
Definition at line 723 of file test_orcad_sch_import.cpp.
References SCHEMATIC::BuildSheetListSortedByPageNumbers(), SCHEMATIC::ConnectionGraph(), CONNECTION_GRAPH::GetNetMap(), SCH_SYMBOL::GetRef(), pin, CONNECTION_GRAPH::Recalculate(), SCH_PIN_T, and terminalToken().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Unique refdes of real (non-power) parts.
Annotated refs live in per-sheet-path instance data, so walk sheet list and query GetRef() per path (same screen may recur on several paths).
Definition at line 639 of file test_orcad_sch_import.cpp.
References SCHEMATIC::BuildSheetListSortedByPageNumbers(), SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), EE_RTREE::OfType(), path, and SCH_SYMBOL_T.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Ground-truth companion beside .DSN, .NET preferred over .BOM.
Definition at line 811 of file test_orcad_sch_import.cpp.
References parseBomRefs(), and parseNetComs().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 1186 of file test_orcad_sch_import.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 557 of file test_orcad_sch_import.cpp.
References splitRefs(), and trimCell().
Referenced by expectedRefsFor().
|
static |
Definition at line 606 of file test_orcad_sch_import.cpp.
References trimCell().
Referenced by expectedRefsFor().
|
static |
Net terminal sets from .NET.
Net starts at .ADD_TER <ref> <pin>, gathers following .TER/indented <ref> <pin> continuations until next net.
Definition at line 676 of file test_orcad_sch_import.cpp.
References pin, and terminalToken().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 526 of file test_orcad_sch_import.cpp.
References trimCell().
Referenced by parseBomRefs().
|
static |
Definition at line 668 of file test_orcad_sch_import.cpp.
References trimCell().
Referenced by checkConnectivity(), and parseNetTerminals().
|
static |
Definition at line 513 of file test_orcad_sch_import.cpp.
Referenced by parseBomRefs(), parseNetComs(), splitRefs(), and terminalToken().