|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <filesystem>#include <set>#include <board.h>#include <eda_text.h>#include <i18n_utility.h>#include <board_design_settings.h>#include <footprint.h>#include <pad.h>#include <pcb_drill_chart.h>#include <pcb_table.h>#include <pcb_tablecell.h>#include <pcb_drill_map.h>#include <pcb_shape.h>#include <drill/drill_enumerator.h>#include <drill/drill_symbol_assigner.h>#include <drill/drill_symbol_profile.h>#include <pcb_track.h>#include <base_units.h>#include <core/kicad_algo.h>#include <properties/property_mgr.h>#include <view/view.h>#include <pcbnew_utils/board_file_utils.h>#include <google/protobuf/any.pb.h>#include <wx/filename.h>Go to the source code of this file.
Functions | |
| BOOST_AUTO_TEST_CASE (GroupsHolesBySizeAndPlating) | |
| BOOST_AUTO_TEST_CASE (RebuildKeepsCellIdentity) | |
| BOOST_AUTO_TEST_CASE (AChartFollowsTheBoardWithoutBeingAsked) | |
| BOOST_AUTO_TEST_CASE (HolesReportTheDrillSymbolLayerOfAMap) | |
| BOOST_AUTO_TEST_CASE (MapIsHitAtItsMarksAndNowhereElse) | |
| BOOST_AUTO_TEST_CASE (MapIgnoresRotateAndFlipsOnlyItsLayer) | |
| BOOST_AUTO_TEST_CASE (MapWithoutABoardIsUsableAndFlippable) | |
| BOOST_AUTO_TEST_CASE (MapIsHitOnItsOutlineWhenTheBoardHasNoHoles) | |
| BOOST_AUTO_TEST_CASE (MapOwnsItsSymbolSizeAndOnlyExposesOffsets) | |
| BOOST_AUTO_TEST_CASE (MapSymbolSizeSurvivesCloneSwapAndProtobuf) | |
| BOOST_AUTO_TEST_CASE (MapSymbolSizeSurvivesBoardFileRoundTrip) | |
| BOOST_AUTO_TEST_CASE (HoleViewBoundsIncludeDisplacedMapSymbols) | |
| BOOST_AUTO_TEST_CASE (MapBoardOutlineFollowsItsOffset) | |
| BOOST_AUTO_TEST_CASE (SpanChoiceRoundTripsThroughTheBoardSpans) | |
| BOOST_AUTO_TEST_CASE (ChartCellTextIsNotUserEditableButItsFormattingIs) | |
| BOOST_AUTO_TEST_CASE (OnlyHolesCarryTheDrillSymbolMargin) | |
| BOOST_AUTO_TEST_CASE (MovingAMapUpdatesTheHoleViewBounds) | |
| BOOST_AUTO_TEST_CASE (CellFormattingSurvivesARebuild) | |
| int | rowShowingDiameter (const PCB_DRILL_CHART &aChart, const wxString &aText) |
| The row reporting a given drill group, or -1. | |
| BOOST_AUTO_TEST_CASE (CellFormattingFollowsItsGroupWhenAGroupIsAdded) | |
| BOOST_AUTO_TEST_CASE (CellFormattingFollowsItsGroupWhenAGroupIsRemoved) | |
| BOOST_AUTO_TEST_CASE (RowsKeepSeparateCellsWhenARebuildReordersThem) | |
| BOOST_AUTO_TEST_CASE (RowKeysSurviveABoardFileRoundTrip) | |
| BOOST_AUTO_TEST_CASE (ChartIsVisitedOnceWhenBothTypesAreScanned) | |
| BOOST_AUTO_TEST_CASE (FreshChartIsBuiltAtTheOrigin) | |
| BOOST_AUTO_TEST_CASE (RebuildKeepsChartPosition) | |
| BOOST_AUTO_TEST_CASE (CloneAndSwapPreserveChartSettings) | |
| BOOST_AUTO_TEST_CASE (EverySymbolResolvesWithoutAChart) | |
| BOOST_AUTO_TEST_CASE (HandFormattedCellsSurviveABoardFileRoundTrip) | |
| BOOST_AUTO_TEST_CASE (DefaultColumnHeadingsSurviveBeingLeftOutOfTheFile) | |
| BOOST_AUTO_TEST_CASE | ( | AChartFollowsTheBoardWithoutBeingAsked | ) |
Definition at line 175 of file test_drill_chart.cpp.
References BOARD::Add(), PADSTACK::ALL_LAYERS, B_Cu, BOOST_CHECK_EQUAL(), F_Cu, PCB_DRILL_CHART::GetBuiltGeneration(), BOARD::GetDrillModelGeneration(), PCB_TABLE::GetRowCount(), PADSTACK::NORMAL, pcbIUScale, PCB_DRILL_CHART::RebuildCells(), RefreshDrillCharts(), PCB_TABLE::SetLayer(), User_1, and via.
| BOOST_AUTO_TEST_CASE | ( | CellFormattingFollowsItsGroupWhenAGroupIsAdded | ) |
Definition at line 671 of file test_drill_chart.cpp.
References BOARD::Add(), PADSTACK::ALL_LAYERS, B_Cu, BOOST_REQUIRE(), F_Cu, PCB_TABLE::GetCell(), PCB_TABLE::GetColCount(), EDA_TEXT::IsBold(), PCB_DRILL_CHART::IsDataRow(), PADSTACK::NORMAL, pcbIUScale, PCB_DRILL_CHART::RebuildCells(), rowShowingDiameter(), EDA_TEXT::SetBold(), PCB_VIA::SetDrill(), PCB_VIA::SetLayerPair(), PCB_VIA::SetPadstackMode(), PCB_VIA::SetPosition(), and PCB_VIA::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | CellFormattingFollowsItsGroupWhenAGroupIsRemoved | ) |
Definition at line 711 of file test_drill_chart.cpp.
References BOOST_REQUIRE(), PCB_TABLE::GetCell(), PCB_TABLE::GetColCount(), PCB_VIA::GetDrillValue(), PCB_TABLE::GetRowCount(), EDA_TEXT::IsBold(), PCB_VIA_T, pcbIUScale, PCB_DRILL_CHART::RebuildCells(), BOARD::Remove(), rowShowingDiameter(), EDA_TEXT::SetBold(), and BOARD::Tracks().
| BOOST_AUTO_TEST_CASE | ( | CellFormattingSurvivesARebuild | ) |
Definition at line 628 of file test_drill_chart.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), PCB_TABLE::GetCell(), PCB_TABLE::GetColCount(), PCB_TABLE::GetRowCount(), EDA_TEXT::GetTextHeight(), EDA_TEXT::IsBold(), pcbIUScale, PCB_DRILL_CHART::RebuildCells(), EDA_TEXT::SetBold(), and PCB_TEXTBOX::SetTextSize().
| BOOST_AUTO_TEST_CASE | ( | ChartCellTextIsNotUserEditableButItsFormattingIs | ) |
Definition at line 537 of file test_drill_chart.cpp.
References _HKI, BOOST_REQUIRE(), PCB_TABLE::GetCells(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_MANAGER::IsWriteableFor(), PROPERTY_MANAGER::Rebuild(), PCB_DRILL_CHART::RebuildCells(), table, text, and TYPE_HASH.
| BOOST_AUTO_TEST_CASE | ( | ChartIsVisitedOnceWhenBothTypesAreScanned | ) |
Definition at line 857 of file test_drill_chart.cpp.
References BOOST_CHECK_EQUAL(), CONTINUE, PCB_DRILL_CHART_T, PCB_TABLE_T, PCB_DRILL_CHART::RebuildCells(), EDA_ITEM::Type(), and PCB_DRILL_CHART::Visit().
| BOOST_AUTO_TEST_CASE | ( | CloneAndSwapPreserveChartSettings | ) |
Definition at line 929 of file test_drill_chart.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), PCB_DRILL_CHART::Clone(), copy, PCB_DRILL_CHART::GetPrecision(), INCH, PCB_DRILL_CHART_T, PCB_DRILL_CHART::RebuildCells(), PCB_DRILL_CHART::SetPrecision(), PCB_DRILL_CHART::SetUnits(), and BOARD_ITEM::SwapItemData().
| BOOST_AUTO_TEST_CASE | ( | DefaultColumnHeadingsSurviveBeingLeftOutOfTheFile | ) |
Definition at line 1031 of file test_drill_chart.cpp.
References BOARD::Add(), BOOST_REQUIRE(), PCB_DRILL_CHART::Columns(), KI_TEST::DumpBoardToFile(), path, PCB_DRILL_CHART_T, KI_TEST::ReadBoardFromFileOrStream(), PCB_DRILL_CHART::RebuildCells(), PCB_TABLE::SetLayer(), ToStdString(), and User_1.
| BOOST_AUTO_TEST_CASE | ( | EverySymbolResolvesWithoutAChart | ) |
Definition at line 957 of file test_drill_chart.cpp.
References DRILL_SYMBOL_PROFILE::Assignments(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), EnumerateDrillSpans(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetDrillSymbolProfile(), group, model, and ResolveDrillSymbols().
| BOOST_AUTO_TEST_CASE | ( | FreshChartIsBuiltAtTheOrigin | ) |
Definition at line 884 of file test_drill_chart.cpp.
References std::abs(), Cmts_User, PCB_TABLE::GetBoundingBox(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), pcbIUScale, PCB_DRILL_CHART::RebuildCells(), and PCB_TABLE::SetLayer().
| BOOST_AUTO_TEST_CASE | ( | GroupsHolesBySizeAndPlating | ) |
Definition at line 130 of file test_drill_chart.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), PCB_TABLE::GetRowCount(), and PCB_DRILL_CHART::RebuildCells().
| BOOST_AUTO_TEST_CASE | ( | HandFormattedCellsSurviveABoardFileRoundTrip | ) |
Definition at line 982 of file test_drill_chart.cpp.
References BOARD::Add(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), KI_TEST::DumpBoardToFile(), PCB_TABLE::GetCell(), PCB_TABLE::GetColCount(), PCB_TABLE::GetRowCount(), EDA_TEXT::GetTextHeight(), EDA_TEXT::IsBold(), path, PCB_DRILL_CHART_T, pcbIUScale, KI_TEST::ReadBoardFromFileOrStream(), PCB_DRILL_CHART::RebuildCells(), EDA_TEXT::SetBold(), PCB_TABLE::SetLayer(), PCB_TEXTBOX::SetTextSize(), ToStdString(), User_1, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | HolesReportTheDrillSymbolLayerOfAMap | ) |
Definition at line 210 of file test_drill_chart.cpp.
References BOARD::Add(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), LSET::Contains(), alg::contains(), DRILL_SYMBOL_LAYER_FOR, BOARD::DrillSymbolLayers(), Eco1_User, BOARD::Footprints(), GAL_LAYER_ID_END, LAYER_DRILL_SYMBOL_END, LAYER_DRILL_SYMBOL_START, pad, FOOTPRINT::Pads(), PCB_VIA_T, BOARD::RefreshDrillSymbolLayers(), BOARD_ITEM::SetLayer(), BOARD::Tracks(), User_1, and KIGFX::VIEW::VIEW_MAX_LAYERS.
| BOOST_AUTO_TEST_CASE | ( | HoleViewBoundsIncludeDisplacedMapSymbols | ) |
Definition at line 469 of file test_drill_chart.cpp.
References BOARD::Add(), PCB_DRILL_MAP::GetOffset(), PCB_DRILL_MAP::GetSymbolSize(), pcbIUScale, BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetOffset(), PCB_DRILL_MAP::SetSymbolSize(), BOARD::Tracks(), User_1, and via.
| BOOST_AUTO_TEST_CASE | ( | MapBoardOutlineFollowsItsOffset | ) |
Definition at line 488 of file test_drill_chart.cpp.
References PCB_DRILL_MAP::GetBoardOutlines(), pcbIUScale, and PCB_DRILL_MAP::SetOffset().
| BOOST_AUTO_TEST_CASE | ( | MapIgnoresRotateAndFlipsOnlyItsLayer | ) |
Definition at line 314 of file test_drill_chart.cpp.
References B_Fab, BOOST_CHECK_EQUAL(), DEGREES_T, F_Fab, PCB_DRILL_MAP::Flip(), BOARD_ITEM::GetLayer(), PCB_DRILL_MAP::GetOffset(), LEFT_RIGHT, pcbIUScale, PCB_DRILL_MAP::Rotate(), BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetOffset(), TOP_BOTTOM, and User_1.
| BOOST_AUTO_TEST_CASE | ( | MapIsHitAtItsMarksAndNowhereElse | ) |
Definition at line 290 of file test_drill_chart.cpp.
References BOARD::Add(), empty(), PCB_DRILL_MAP::HitTest(), pcbIUScale, BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetOffset(), and User_1.
| BOOST_AUTO_TEST_CASE | ( | MapIsHitOnItsOutlineWhenTheBoardHasNoHoles | ) |
Definition at line 367 of file test_drill_chart.cpp.
References PCB_DRILL_MAP::HitTest(), pcbIUScale, BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetOffset(), and User_1.
| BOOST_AUTO_TEST_CASE | ( | MapOwnsItsSymbolSizeAndOnlyExposesOffsets | ) |
Definition at line 392 of file test_drill_chart.cpp.
References BOOST_CHECK_EQUAL(), defaultSize(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetDrillSymbolProfile(), PROPERTY_MANAGER::GetProperties(), PCB_DRILL_MAP::GetSymbolSize(), PROPERTY_MANAGER::Instance(), pcbIUScale, DRILL_SYMBOL_PROFILE::SetSymbolSize(), and TYPE_HASH.
| BOOST_AUTO_TEST_CASE | ( | MapSymbolSizeSurvivesBoardFileRoundTrip | ) |
Definition at line 446 of file test_drill_chart.cpp.
References BOARD::Add(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), KI_TEST::DumpBoardToFile(), path, pcbIUScale, KI_TEST::ReadBoardFromFileOrStream(), BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetSymbolSize(), ToStdString(), and User_1.
| BOOST_AUTO_TEST_CASE | ( | MapSymbolSizeSurvivesCloneSwapAndProtobuf | ) |
Definition at line 415 of file test_drill_chart.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), PCB_DRILL_MAP::Clone(), copy, PCB_DRILL_MAP::Deserialize(), PCB_DRILL_MAP::GetSymbolSize(), pcbIUScale, PCB_DRILL_MAP::Serialize(), BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetSymbolSize(), BOARD_ITEM::SwapItemData(), and User_1.
| BOOST_AUTO_TEST_CASE | ( | MapWithoutABoardIsUsableAndFlippable | ) |
Definition at line 351 of file test_drill_chart.cpp.
References B_Fab, BOOST_CHECK_EQUAL(), F_Fab, PCB_DRILL_MAP::Flip(), BOARD_ITEM::GetLayer(), PCB_DRILL_MAP::GetSymbolExtent(), PCB_DRILL_MAP::GetSymbolSize(), LEFT_RIGHT, pcbIUScale, and BOARD_ITEM::SetLayer().
| BOOST_AUTO_TEST_CASE | ( | MovingAMapUpdatesTheHoleViewBounds | ) |
Definition at line 606 of file test_drill_chart.cpp.
References BOARD::Add(), PCB_DRILL_MAP::GetOffset(), pcbIUScale, BOARD::RefreshDrillSymbolLayers(), BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetOffset(), PCB_DRILL_MAP::SetSymbolSize(), BOARD::Tracks(), User_1, and via.
| BOOST_AUTO_TEST_CASE | ( | OnlyHolesCarryTheDrillSymbolMargin | ) |
Definition at line 569 of file test_drill_chart.cpp.
References BOARD::Add(), FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, BOX2< Vec >::Contains(), FOOTPRINT, PCB_DRILL_MAP::GetOffset(), PCB_TRACK::GetStart(), PAD, pcbIUScale, BOARD::RefreshDrillSymbolLayers(), PAD::SetAttribute(), PCB_TRACK::SetEnd(), BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetOffset(), FOOTPRINT::SetPosition(), PAD::SetPosition(), PAD::SetSize(), PCB_TRACK::SetStart(), PCB_TRACK::SetWidth(), SMD, User_1, PAD::ViewBBox(), and PCB_TRACK::ViewBBox().
| BOOST_AUTO_TEST_CASE | ( | RebuildKeepsCellIdentity | ) |
Definition at line 149 of file test_drill_chart.cpp.
References PCB_TABLE::GetCells(), and PCB_DRILL_CHART::RebuildCells().
| BOOST_AUTO_TEST_CASE | ( | RebuildKeepsChartPosition | ) |
Definition at line 908 of file test_drill_chart.cpp.
References BOOST_CHECK_EQUAL(), Cmts_User, PCB_TABLE::GetPosition(), PCB_TABLE::Move(), pcbIUScale, PCB_DRILL_CHART::RebuildCells(), PCB_TABLE::SetLayer(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | RowKeysSurviveABoardFileRoundTrip | ) |
Definition at line 820 of file test_drill_chart.cpp.
References BOARD::Add(), BOOST_REQUIRE(), KI_TEST::DumpBoardToFile(), path, PCB_DRILL_CHART_T, KI_TEST::ReadBoardFromFileOrStream(), PCB_DRILL_CHART::RebuildCells(), PCB_DRILL_CHART::RowKeys(), PCB_TABLE::SetLayer(), ToStdString(), and User_1.
| BOOST_AUTO_TEST_CASE | ( | RowsKeepSeparateCellsWhenARebuildReordersThem | ) |
Definition at line 762 of file test_drill_chart.cpp.
References BOARD::Add(), PADSTACK::ALL_LAYERS, B_Cu, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BURIED, F_Cu, PCB_TABLE::GetCells(), In1_Cu, In2_Cu, PADSTACK::NORMAL, pcbIUScale, PCB_DRILL_CHART::RebuildCells(), PCB_DRILL_CHART::RowKeys(), PCB_VIA::SetDrill(), PCB_VIA::SetLayerPair(), PCB_VIA::SetPadstackMode(), PCB_VIA::SetPosition(), PCB_VIA::SetViaType(), and PCB_VIA::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | SpanChoiceRoundTripsThroughTheBoardSpans | ) |
Definition at line 508 of file test_drill_chart.cpp.
References BOARD::Add(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), EnumerateDrillSpans(), PCB_DRILL_MAP::GetAllSpans(), PCB_DRILL_MAP::GetSpan(), PCB_DRILL_MAP::GetSpanChoice(), BOARD_ITEM::SetLayer(), PCB_DRILL_MAP::SetSpanChoice(), and User_1.
| int rowShowingDiameter | ( | const PCB_DRILL_CHART & | aChart, |
| const wxString & | aText ) |
The row reporting a given drill group, or -1.
Groups are ordered by size, so the diameter text is what identifies the row to a reader.
Definition at line 659 of file test_drill_chart.cpp.
References PCB_TABLE::GetCells().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().