29#ifndef QA_EESCHEMA_LIB_FIELD_TEST_UTILS__H
30#define QA_EESCHEMA_LIB_FIELD_TEST_UTILS__H
46 os <<
"SCH_FIELDS[ " << f.size() <<
" ]";
66 if( gotName != aExpectedName )
68 BOOST_TEST_INFO(
"Field name: got '" << gotName <<
"', expected '" << aExpectedName );
72 const int gotId = aField.
GetId();
74 if( gotId != aExpectedId )
76 BOOST_TEST_INFO(
"Field ID: got '" << gotId <<
"', expected '" << aExpectedId );
88 const unsigned expectedCount = MANDATORY_FIELD_T::MANDATORY_FIELDS;
90 if( aFields.size() < expectedCount )
92 BOOST_TEST_INFO(
"Expected at least " << expectedCount <<
" fields, got " << aFields.size() );
98 ok &=
FieldNameIdMatches( aFields[0],
"Reference", MANDATORY_FIELD_T::REFERENCE_FIELD );
100 ok &=
FieldNameIdMatches( aFields[2],
"Footprint", MANDATORY_FIELD_T::FOOTPRINT_FIELD );
101 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,...
std::ostream & boost_test_print_type(std::ostream &os, SCH_FIELD const &f)
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.