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

Test suite for #ALTIUM_PARSER. More...

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

Go to the source code of this file.

Classes

struct  ALTIUM_PARSER_UTILS_FIXTURE
 
struct  SPECIAL_STRINGS_TO_KICAD
 Declares the struct as the Boost test fixture. More...
 
struct  PIN_DESIGNATOR_CASE
 

Functions

std::ostream & operator<< (std::ostream &strm, SPECIAL_STRINGS_TO_KICAD const &data)
 
 BOOST_DATA_TEST_CASE (AltiumSchSpecialStringsToKiCadVariablesProperties, boost::unit_test::data::make(sch_special_string_to_kicad_property), data)
 Test conversation from Altium Schematic Special String to a KiCad String with variables.
 
 BOOST_DATA_TEST_CASE (AltiumPcbSpecialStringsToKiCadStringsProperties, boost::unit_test::data::make(pcb_special_string_to_kicad_property), data)
 Test conversation from Altium Board Special String to a KiCad String with variables.
 
std::ostream & operator<< (std::ostream &strm, PIN_DESIGNATOR_CASE const &data)
 
 BOOST_DATA_TEST_CASE (AltiumPinDesignatorToKiCadProperties, boost::unit_test::data::make(pin_designator_cases), data)
 

Variables

static const std::vector< SPECIAL_STRINGS_TO_KICADsch_special_string_to_kicad_property
 A list of valid test strings and the expected results.
 
static const std::vector< SPECIAL_STRINGS_TO_KICADpcb_special_string_to_kicad_property
 A list of valid test strings and the expected results.
 
static const std::vector< PIN_DESIGNATOR_CASEpin_designator_cases
 

Detailed Description

Test suite for #ALTIUM_PARSER.

Definition in file test_altium_parser_utils.cpp.

Function Documentation

◆ BOOST_DATA_TEST_CASE() [1/3]

BOOST_DATA_TEST_CASE ( AltiumPcbSpecialStringsToKiCadStringsProperties ,
boost::unit_test::data::make(pcb_special_string_to_kicad_property) ,
data  )

Test conversation from Altium Board Special String to a KiCad String with variables.

Definition at line 207 of file test_altium_parser_utils.cpp.

References AltiumPcbSpecialStringsToKiCadStrings(), BOOST_CHECK_EQUAL(), pcb_special_string_to_kicad_property, and result.

◆ BOOST_DATA_TEST_CASE() [2/3]

BOOST_DATA_TEST_CASE ( AltiumPinDesignatorToKiCadProperties ,
boost::unit_test::data::make(pin_designator_cases) ,
data  )

◆ BOOST_DATA_TEST_CASE() [3/3]

BOOST_DATA_TEST_CASE ( AltiumSchSpecialStringsToKiCadVariablesProperties ,
boost::unit_test::data::make(sch_special_string_to_kicad_property) ,
data  )

Test conversation from Altium Schematic Special String to a KiCad String with variables.

Definition at line 142 of file test_altium_parser_utils.cpp.

References AltiumSchSpecialStringsToKiCadVariables(), BOOST_CHECK_EQUAL(), result, and sch_special_string_to_kicad_property.

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & strm,
PIN_DESIGNATOR_CASE const & data )

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & strm,
SPECIAL_STRINGS_TO_KICAD const & data )

Variable Documentation

◆ pcb_special_string_to_kicad_property

const std::vector<SPECIAL_STRINGS_TO_KICAD> pcb_special_string_to_kicad_property
static

A list of valid test strings and the expected results.

Definition at line 156 of file test_altium_parser_utils.cpp.

Referenced by BOOST_DATA_TEST_CASE().

◆ pin_designator_cases

const std::vector<PIN_DESIGNATOR_CASE> pin_designator_cases
static
Initial value:
= {
{ wxT( "" ), wxT( "" ) },
{ wxT( "1" ), wxT( "1" ) },
{ wxT( "A1" ), wxT( "A1" ) },
{ wxT( "GND" ), wxT( "GND" ) },
{ wxT( " 1 " ), wxT( "1" ) },
{ wxT( " A1 " ), wxT( "A1" ) },
{ wxT( "1,2" ), wxT( "[1,2]" ) },
{ wxT( "1,2,3" ), wxT( "[1,2,3]" ) },
{ wxT( "A1,A2,A3" ), wxT( "[A1,A2,A3]" ) },
{ wxT( "1, 2, 3" ), wxT( "[1,2,3]" ) },
{ wxT( " 1 , 2 , 3 " ), wxT( "[1,2,3]" ) },
{ wxT( "1,2," ), wxT( "[1,2]" ) },
{ wxT( "1,,2" ), wxT( "[1,2]" ) },
{ wxT( "1," ), wxT( "1" ) },
{ wxT( "," ), wxT( "," ) },
}

Definition at line 230 of file test_altium_parser_utils.cpp.

Referenced by BOOST_DATA_TEST_CASE().

◆ sch_special_string_to_kicad_property

const std::vector<SPECIAL_STRINGS_TO_KICAD> sch_special_string_to_kicad_property
static

A list of valid test strings and the expected results.

Definition at line 60 of file test_altium_parser_utils.cpp.

Referenced by BOOST_DATA_TEST_CASE().