21#include <boost/test/unit_test.hpp>
33 BOOST_CHECK(
id.Parse(
"Package_SO:DGG56" ) == -1 );
56 LIB_ID a( wxT(
"Package_SO" ), wxT(
"DGG56" ) );
57 LIB_ID b( wxT(
"Package_SO" ), wxT(
"DGG56" ) );
58 LIB_ID c( wxT(
"OtherLib" ), wxT(
"DGG56" ) );
68 legacy.
Parse(
"DGG56" );
70 LIB_ID qualified( wxT(
"Package_SO" ), wxT(
"DGG56" ) );
83 LIB_ID qualified( wxT(
"Package_SO" ), wxT(
"DGG56" ) );
87 legacy.
Parse(
"DGG56" );
127 BOOST_CHECK( libIdBad.Find( wxUniChar(
':' ) ) != wxNOT_FOUND );
128 BOOST_CHECK( libIdBad.Find( wxUniChar(
'"' ) ) != wxNOT_FOUND );
130 for( wxUniChar ch : libIdBad )
132 std::string
name =
"abc";
133 name +=
static_cast<char>( ch.GetValue() );
136 "LIB_ID accepted a shared-forbidden char 0x"
137 << std::hex << ch.GetValue() );
152 for( wxUniChar ch : libId )
155 for( wxUniChar ch : { wxUniChar(
'%' ), wxUniChar(
'$' ), wxUniChar(
'/' ) } )
160 std::string
name =
"abc";
161 name +=
static_cast<char>( ch.GetValue() );
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
static int HasIllegalChars(const UTF8 &aLibItemName)
Examine aLibItemName for invalid LIB_ID item name characters.
const UTF8 & GetLibItemName() const
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
static bool empty(const wxTextEntryBase *aCtrl)
const wxString & GetLibFilenameForbiddenChars()
Characters illegal in a footprint library filename.
const wxString & GetLibIdForbiddenChars()
Characters illegal in a LIB_ID item name.
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_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ParseFullyQualified)