|
KiCad PCB EDA Suite
|
Test suite for import of Protel Autotrax / Easytrax (.PCB) layout files. More...
#include <pcbnew_utils/board_test_utils.h>#include <pcbnew_utils/board_file_utils.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include <pcbnew/pcb_io/autotrax/pcb_io_autotrax.h>#include <board.h>#include <footprint.h>#include <pad.h>#include <pcb_track.h>#include <pcb_shape.h>#include <pcb_text.h>#include <reporter.h>#include <wx/filename.h>Go to the source code of this file.
Classes | |
| struct | AUTOTRAX_IMPORT_FIXTURE |
Functions | |
| BOOST_AUTO_TEST_CASE (SniffRecognizesPcb) | |
| CanReadBoard must accept a real Autotrax file by sniffing the magic header, not just the (gEDA-shared) .PCB extension. | |
| BOOST_AUTO_TEST_CASE (SimpleBoardStructure) | |
| The simplest sample is a board of through-hole components: it must yield footprints with pads and some free tracks. | |
| BOOST_AUTO_TEST_CASE (RichBoardStructure) | |
| The richest sample exercises every record family (FT/FA/FV/FP/FS plus component CT/CA/CV/CP). | |
| BOOST_AUTO_TEST_CASE (AllSamplesLoad) | |
| Every sample must load without throwing and produce a positive board extent; none should crash the Y-axis flip or layer mapping. | |
| BOOST_AUTO_TEST_CASE (NetdefAssignsPadNets) | |
| NETDEF nodes must land on the pads they name. | |
| BOOST_AUTO_TEST_CASE (CompHeaderPlacesFields) | |
| COMP headers carry the value placement, then the designator placement, then their display flags. | |
| BOOST_AUTO_TEST_CASE (TextRotationAndMirror) | |
| Rotation codes turn counterclockwise, and codes 16..19 mirror the text after rotating it. | |
| BOOST_AUTO_TEST_CASE (ArcQuadrantsBulgeIntoPart) | |
| Arc quadrant bits follow a Y-up frame. U7's pin 1 notch sits on the left edge and must bulge right. | |
| BOOST_AUTO_TEST_CASE (KeepoutBecomesBoardOutline) | |
| DEMOSMD draws its board edge only on the keepout layer, around every pad. | |
| BOOST_AUTO_TEST_CASE (PlaneConnectionsAreReported) | |
| DEMO.PCB has pads wired to the ground and power planes, which KiCad cannot represent. | |
Test suite for import of Protel Autotrax / Easytrax (.PCB) layout files.
Sample files are real, openly-available boards from the PRONOM file-format research corpus (glepore70/pronom-research, sample_files/p/pcb2), which the UK National Archives published as reference samples for the Autotrax/Easytrax format. DEMO.PCB and DEMOSMD.PCB are demo boards shipped with the Protel Autotrax 1.61 freeware release. Every file carries the "PCB FILE 4" Autotrax header.
Definition in file test_autotrax_import.cpp.
| BOOST_AUTO_TEST_CASE | ( | AllSamplesLoad | ) |
Every sample must load without throwing and produce a positive board extent; none should crash the Y-axis flip or layer mapping.
Definition at line 150 of file test_autotrax_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), name, and path.
| BOOST_AUTO_TEST_CASE | ( | ArcQuadrantsBulgeIntoPart | ) |
Arc quadrant bits follow a Y-up frame. U7's pin 1 notch sits on the left edge and must bulge right.
Definition at line 247 of file test_autotrax_import.cpp.
References ARC, BOOST_REQUIRE(), EDA_SHAPE::GetArcMid(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetShape(), FOOTPRINT::GraphicalItems(), path, PCB_SHAPE_T, and VECTOR2< T >::x.
| BOOST_AUTO_TEST_CASE | ( | CompHeaderPlacesFields | ) |
COMP headers carry the value placement, then the designator placement, then their display flags.
Definition at line 201 of file test_autotrax_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), PCB_TEXT::GetPosition(), EDA_TEXT::IsVisible(), path, pcbIUScale, FOOTPRINT::Reference(), FOOTPRINT::Value(), and VECTOR2< T >::x.
| BOOST_AUTO_TEST_CASE | ( | KeepoutBecomesBoardOutline | ) |
DEMOSMD draws its board edge only on the keepout layer, around every pad.
Definition at line 269 of file test_autotrax_import.cpp.
References BOOST_CHECK_EQUAL(), Edge_Cuts, and path.
| BOOST_AUTO_TEST_CASE | ( | NetdefAssignsPadNets | ) |
NETDEF nodes must land on the pads they name.
Definition at line 177 of file test_autotrax_import.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), FOOTPRINT::FindPadByNumber(), pad, and path.
| BOOST_AUTO_TEST_CASE | ( | PlaneConnectionsAreReported | ) |
DEMO.PCB has pads wired to the ground and power planes, which KiCad cannot represent.
Definition at line 288 of file test_autotrax_import.cpp.
| BOOST_AUTO_TEST_CASE | ( | RichBoardStructure | ) |
The richest sample exercises every record family (FT/FA/FV/FP/FS plus component CT/CA/CV/CP).
Verify the importer produces a non-trivial board with copper tracks, vias and footprints.
Definition at line 111 of file test_autotrax_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), path, PCB_TRACE_T, and PCB_VIA_T.
| BOOST_AUTO_TEST_CASE | ( | SimpleBoardStructure | ) |
The simplest sample is a board of through-hole components: it must yield footprints with pads and some free tracks.
Definition at line 83 of file test_autotrax_import.cpp.
References BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), and path.
| BOOST_AUTO_TEST_CASE | ( | SniffRecognizesPcb | ) |
CanReadBoard must accept a real Autotrax file by sniffing the magic header, not just the (gEDA-shared) .PCB extension.
Definition at line 69 of file test_autotrax_import.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_TEST_MESSAGE(), and path.
| BOOST_AUTO_TEST_CASE | ( | TextRotationAndMirror | ) |
Rotation codes turn counterclockwise, and codes 16..19 mirror the text after rotating it.
Definition at line 219 of file test_autotrax_import.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), F_SilkS, BOARD_ITEM::GetLayer(), EDA_TEXT::IsMirrored(), EDA_ANGLE::Normalize(), path, and FOOTPRINT::Reference().