|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <drc/rule_editor/drc_re_overlay_types.h>#include <algorithm>#include <vector>#include <wx/gdicmn.h>Go to the source code of this file.
Namespaces | |
| namespace | BITMAP_OVERLAY_TEST_HELPERS |
| Helper functions that mirror the logic from DRC_RE_BITMAP_OVERLAY_PANEL. | |
Functions | |
| double | BITMAP_OVERLAY_TEST_HELPERS::ComputeScaleFactor (double aRawScale) |
| Compute the scale factor from a raw content scale factor. | |
| wxPoint | BITMAP_OVERLAY_TEST_HELPERS::ScalePosition (int aX, int aY, double aScaleFactor) |
| Scale a position from 1x bitmap coordinates to display coordinates. | |
| wxSize | BITMAP_OVERLAY_TEST_HELPERS::ScaleSize (int aWidth, int aHeight, double aScaleFactor) |
| Scale a size from 1x bitmap coordinates to display coordinates. | |
| bool | BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds (const wxPoint &aScaledPos, const wxSize &aScaledSize, const wxSize &aBitmapSize) |
| Check if a field position exceeds bitmap bounds. | |
| void | BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder (std::vector< DRC_RE_FIELD_POSITION > &aPositions) |
| Sort field positions by tab order. | |
| BOOST_AUTO_TEST_CASE (ScalePosition_1x) | |
| BOOST_AUTO_TEST_CASE (ScalePosition_1_5x) | |
| BOOST_AUTO_TEST_CASE (ScalePosition_2x) | |
| BOOST_AUTO_TEST_CASE (ScaleSize_AllFactors) | |
| BOOST_AUTO_TEST_CASE (GetScaleFactor_Returns1x_ForLowDPI) | |
| BOOST_AUTO_TEST_CASE (GetScaleFactor_Returns1_5x_ForMediumDPI) | |
| BOOST_AUTO_TEST_CASE (GetScaleFactor_Returns2x_ForHighDPI) | |
| BOOST_AUTO_TEST_CASE (GetScaleFactor_BoundaryValues) | |
| BOOST_AUTO_TEST_CASE (TabOrderSorting_AlreadySorted) | |
| BOOST_AUTO_TEST_CASE (TabOrderSorting_ReversedOrder) | |
| BOOST_AUTO_TEST_CASE (TabOrderSorting_MixedOrder) | |
| BOOST_AUTO_TEST_CASE (TabOrderSorting_DuplicateOrders) | |
| BOOST_AUTO_TEST_CASE (TabOrderSorting_SingleField) | |
| BOOST_AUTO_TEST_CASE (TabOrderSorting_EmptyVector) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_WithinBounds) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_ExceedsWidth) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_ExceedsHeight) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_ExceedsBothDimensions) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_FieldLargerThanBitmap) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_AtScaledPositions) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_EdgeCases) | |
| BOOST_AUTO_TEST_CASE (BoundsWarning_ZeroSizedField) | |
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_AtScaledPositions | ) |
Definition at line 464 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds(), BITMAP_OVERLAY_TEST_HELPERS::ScalePosition(), and BITMAP_OVERLAY_TEST_HELPERS::ScaleSize().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_EdgeCases | ) |
Definition at line 494 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_ExceedsBothDimensions | ) |
Definition at line 436 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_ExceedsHeight | ) |
Definition at line 422 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_ExceedsWidth | ) |
Definition at line 408 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_FieldLargerThanBitmap | ) |
Definition at line 450 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_WithinBounds | ) |
Definition at line 385 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | BoundsWarning_ZeroSizedField | ) |
Definition at line 515 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds().
| BOOST_AUTO_TEST_CASE | ( | GetScaleFactor_BoundaryValues | ) |
Definition at line 255 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::ComputeScaleFactor().
| BOOST_AUTO_TEST_CASE | ( | GetScaleFactor_Returns1_5x_ForMediumDPI | ) |
Definition at line 228 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::ComputeScaleFactor().
| BOOST_AUTO_TEST_CASE | ( | GetScaleFactor_Returns1x_ForLowDPI | ) |
Definition at line 213 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::ComputeScaleFactor().
| BOOST_AUTO_TEST_CASE | ( | GetScaleFactor_Returns2x_ForHighDPI | ) |
Definition at line 243 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::ComputeScaleFactor().
| BOOST_AUTO_TEST_CASE | ( | ScalePosition_1_5x | ) |
Definition at line 135 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), scale, and BITMAP_OVERLAY_TEST_HELPERS::ScalePosition().
| BOOST_AUTO_TEST_CASE | ( | ScalePosition_1x | ) |
Definition at line 109 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), scale, and BITMAP_OVERLAY_TEST_HELPERS::ScalePosition().
| BOOST_AUTO_TEST_CASE | ( | ScalePosition_2x | ) |
Definition at line 161 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), scale, and BITMAP_OVERLAY_TEST_HELPERS::ScalePosition().
| BOOST_AUTO_TEST_CASE | ( | ScaleSize_AllFactors | ) |
Definition at line 187 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::ScaleSize().
| BOOST_AUTO_TEST_CASE | ( | TabOrderSorting_AlreadySorted | ) |
Definition at line 271 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder().
| BOOST_AUTO_TEST_CASE | ( | TabOrderSorting_DuplicateOrders | ) |
Definition at line 334 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder().
| BOOST_AUTO_TEST_CASE | ( | TabOrderSorting_EmptyVector | ) |
Definition at line 369 of file test_drc_bitmap_overlay_panel.cpp.
References BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder().
| BOOST_AUTO_TEST_CASE | ( | TabOrderSorting_MixedOrder | ) |
Definition at line 312 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder().
| BOOST_AUTO_TEST_CASE | ( | TabOrderSorting_ReversedOrder | ) |
Definition at line 289 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder().
| BOOST_AUTO_TEST_CASE | ( | TabOrderSorting_SingleField | ) |
Definition at line 356 of file test_drc_bitmap_overlay_panel.cpp.
References BOOST_CHECK_EQUAL(), and BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder().