25#include <boost/test/unit_test.hpp>
39 std::string identifier =
"R1";
93 std::string longId =
"VERY_LONG_COMPONENT_NAME_WITH_LOTS_OF_CHARACTERS_12345";
109 std::string schematicId =
"PADS:IC_QUAD_NAND/U1";
110 std::string pcbId =
"PADS:IC_QUAD_NAND/U1";
268 std::string latin1 = std::string(
"\xA9 2015 TEXMATE INC." );
280 std::string
utf8 = std::string(
"\xC2\xA9 OK" );
282 wxString::FromUTF8(
"© OK" ) );
305 wxString testFile = wxString::FromUTF8(
307 +
"/plugins/pads/issue23420_codepage_schematic.txt" );
333 pcbOnly.
pcbFile = wxS(
"test.asc" );
345 both.
pcbFile = wxS(
"test_pcb.asc" );
wxString AsString() const
std::string utf8(const wxString &aText)
static bool empty(const wxTextEntryBase *aCtrl)
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
RELATED_FILES FindRelatedPadsFiles(const wxString &aFilePath)
Find the related PADS project file (schematic for a PCB source, or vice versa) in the same directory,...
int ParseInt(const std::string &aStr, int aDefault, const std::string &aContext)
Parse integer from string with error context.
wxString ConvertText(const std::string &aText)
Decode text from a PADS file, which uses an 8-bit codepage rather than UTF-8.
PADS_FILE_TYPE DetectPadsFileType(const wxString &aFilePath)
Detect the type of a PADS file by examining its header.
wxString ConvertInvertedNetName(const std::string &aNetName)
Convert a PADS net name to KiCad notation.
LINE_STYLE PadsLineStyleToKiCad(int aPadsStyle)
Convert a PADS line style integer to a KiCad LINE_STYLE enum value.
KIID GenerateDeterministicUuid(const std::string &aIdentifier)
Generate a deterministic KIID from a PADS component identifier.
double ParseDouble(const std::string &aStr, double aDefault, const std::string &aContext)
Parse double from string with error context.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(GenerateDeterministicUuid_Deterministic)
wxString result
Test unit parsing edge cases and error handling.