29#ifndef QA_EESCHEMA_LIB_FIELD_TEST_UTILS__H
30#define QA_EESCHEMA_LIB_FIELD_TEST_UTILS__H
50struct print_log_value<
std::vector<SCH_FIELD>>
52 inline void operator()( std::ostream& os, std::vector<SCH_FIELD>
const& f )
54 os <<
"SCH_FIELDS[ " << f.size() <<
" ]";
76 if( gotName != aExpectedName )
78 BOOST_TEST_INFO(
"Field name: got '" << gotName <<
"', expected '" << aExpectedName );
82 const int gotId = aField.
GetId();
84 if( gotId != aExpectedId )
86 BOOST_TEST_INFO(
"Field ID: got '" << gotId <<
"', expected '" << aExpectedId );
98 const unsigned expectedCount = MANDATORY_FIELD_T::MANDATORY_FIELDS;
100 if( aFields.size() < expectedCount )
102 BOOST_TEST_INFO(
"Expected at least " << expectedCount <<
" fields, got " << aFields.size() );
108 ok &=
FieldNameIdMatches( aFields[0],
"Reference", MANDATORY_FIELD_T::REFERENCE_FIELD );
110 ok &=
FieldNameIdMatches( aFields[2],
"Footprint", MANDATORY_FIELD_T::FOOTPRINT_FIELD );
111 ok &=
FieldNameIdMatches( aFields[3],
"Datasheet", MANDATORY_FIELD_T::DATASHEET_FIELD );
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
Before Boost 1.64, nullptr_t wasn't handled.
bool AreDefaultFieldsCorrect(const std::vector< SCH_FIELD > &aFields)
Predicate to check that the mandatory fields look sensible.
bool FieldNameIdMatches(const SCH_FIELD &aField, const std::string &aExpectedName, int aExpectedId)
Predicate to check a field name is as expected.
void operator()(std::ostream &os, SCH_FIELD const &f)
void operator()(std::ostream &os, std::vector< SCH_FIELD > const &f)
#define BOOST_TEST_PRINT_NAMESPACE_CLOSE
#define BOOST_TEST_INFO(A)
If HAVE_EXPECTED_FAILURES is defined, this means that boost::unit_test::expected_failures is availabl...