KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_reference_image_load.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <boost/test/data/test_case.hpp>
#include <board.h>
#include <kiid.h>
#include <layer_ids.h>
#include <pcb_reference_image.h>
#include <reference_image.h>
#include <bitmap_base.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h>
#include <pcbnew_utils/board_file_utils.h>
#include <pcbnew_utils/board_test_utils.h>
#include <richio.h>
#include <settings/settings_manager.h>
#include <filesystem>
#include <fstream>
#include <sstream>

Go to the source code of this file.

Functions

 BOOST_DATA_TEST_CASE_F (REFERENCE_IMAGE_LOAD_TEST_FIXTURE, ReferenceImageLoading, boost::unit_test::data::make(ReferenceImageLoading_testCases), testCase)
 
 BOOST_FIXTURE_TEST_CASE (ReferenceImageFlipLayer, REFERENCE_IMAGE_LOAD_TEST_FIXTURE)
 Test that flipping a reference image changes its associated layer, matching the behavior of all other PCB item types.
 
 BOOST_FIXTURE_TEST_CASE (ReferenceImagePpiScaleMigration, REFERENCE_IMAGE_LOAD_TEST_FIXTURE)
 A board predating the PNG pixel-density fix stored an image scale that compensated for the truncated PPI.
 

Function Documentation

◆ BOOST_DATA_TEST_CASE_F()

BOOST_DATA_TEST_CASE_F ( REFERENCE_IMAGE_LOAD_TEST_FIXTURE ,
ReferenceImageLoading ,
boost::unit_test::data::make(ReferenceImageLoading_testCases) ,
testCase  )

◆ BOOST_FIXTURE_TEST_CASE() [1/2]

BOOST_FIXTURE_TEST_CASE ( ReferenceImageFlipLayer ,
REFERENCE_IMAGE_LOAD_TEST_FIXTURE  )

Test that flipping a reference image changes its associated layer, matching the behavior of all other PCB item types.

Definition at line 168 of file test_reference_image_load.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOARD::FlipLayer(), image, LEFT_RIGHT, KI_TEST::LoadAndTestBoardFile(), PCB_REFERENCE_IMAGE_T, KI_TEST::RequireBoardItemWithTypeAndId(), and TOP_BOTTOM.

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

BOOST_FIXTURE_TEST_CASE ( ReferenceImagePpiScaleMigration ,
REFERENCE_IMAGE_LOAD_TEST_FIXTURE  )

A board predating the PNG pixel-density fix stored an image scale that compensated for the truncated PPI.

Loading it must re-scale by the corrected/truncated PPI ratio so the rendered size is preserved, while a current-version board is loaded verbatim.

Definition at line 219 of file test_reference_image_load.cpp.

References BOARD::Add(), BOOST_REQUIRE(), KI_TEST::DumpBoardToFile(), F_Cu, image, and path.