KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_altium_parser.cpp File Reference

Test suite for ALTIUM_BINARY_PARSER. More...

#include <qa_utils/wx_utils/unit_test_utils.h>
#include <boost/test/data/test_case.hpp>
#include <common/io/altium/altium_binary_parser.h>

Go to the source code of this file.

Classes

struct  ALTIUM_BINARY_PARSER_FIXTURE
 

Functions

 BOOST_DATA_TEST_CASE (ConvertToKicadUnit, boost::unit_test::data::make(altium_to_kicad_unit), input_value, expected_result)
 Test conversation from Altium internal units into KiCad internal units.
 
 BOOST_DATA_TEST_CASE (PropertiesReadKicadUnit, boost::unit_test::data::make(read_kicad_unit_property), input_value, expected_result)
 Test conversation from Unit property into KiCad internal units.
 
 BOOST_DATA_TEST_CASE (ReadProperties, boost::unit_test::data::make(read_properties), input_value, expected_result)
 Test conversation from binary to properties.
 

Variables

static const std::vector< std::tuple< int, int > > altium_to_kicad_unit
 Declares the struct as the Boost test fixture.
 
static const std::vector< std::tuple< wxString, int > > read_kicad_unit_property
 A list of valid test strings and the expected results.
 
static const std::vector< std::tuple< std::string, std::map< wxString, wxString > > > read_properties
 A list of valid test strings and the expected result map.
 

Detailed Description

Test suite for ALTIUM_BINARY_PARSER.

Definition in file test_altium_parser.cpp.

Function Documentation

◆ BOOST_DATA_TEST_CASE() [1/3]

BOOST_DATA_TEST_CASE ( ConvertToKicadUnit  ,
boost::unit_test::data::make(altium_to_kicad_unit ,
input_value  ,
expected_result   
)

Test conversation from Altium internal units into KiCad internal units.

Definition at line 124 of file test_altium_parser.cpp.

References ALTIUM_PROPS_UTILS::ConvertToKicadUnit().

◆ BOOST_DATA_TEST_CASE() [2/3]

BOOST_DATA_TEST_CASE ( PropertiesReadKicadUnit  ,
boost::unit_test::data::make(read_kicad_unit_property ,
input_value  ,
expected_result   
)

Test conversation from Unit property into KiCad internal units.

Definition at line 189 of file test_altium_parser.cpp.

References ALTIUM_PROPS_UTILS::ReadKicadUnit().

◆ BOOST_DATA_TEST_CASE() [3/3]

BOOST_DATA_TEST_CASE ( ReadProperties  ,
boost::unit_test::data::make(read_properties ,
input_value  ,
expected_result   
)

Test conversation from binary to properties.

Definition at line 266 of file test_altium_parser.cpp.

References ALTIUM_BINARY_PARSER::GetRemainingBytes(), ALTIUM_BINARY_PARSER::HasParsingError(), and ALTIUM_BINARY_PARSER::ReadProperties().

Variable Documentation

◆ altium_to_kicad_unit

const std::vector<std::tuple<int, int> > altium_to_kicad_unit
static

Declares the struct as the Boost test fixture.

A list of valid internal unit conversation factors Rem: altium to kicad importer rounds coordinates to the near 10 nm value when converting altium values in 0.01 mil to pcbnew units (1 nm)

Definition at line 50 of file test_altium_parser.cpp.

◆ read_kicad_unit_property

const std::vector<std::tuple<wxString, int> > read_kicad_unit_property
static

A list of valid test strings and the expected results.

Definition at line 138 of file test_altium_parser.cpp.

◆ read_properties

const std::vector<std::tuple<std::string, std::map<wxString, wxString> > > read_properties
static

A list of valid test strings and the expected result map.

Definition at line 206 of file test_altium_parser.cpp.