42 struct PASSIVE_VALUE_TEST_CASE
49 const std::vector<PASSIVE_VALUE_TEST_CASE> testCases =
51 { wxString(
"C1" ), wxString(
"33M" ), wxString(
"c=\"33Meg\"" ) },
52 { wxString(
"C2" ), wxString(
"33m" ), wxString(
"c=\"33m\"" ) },
53 { wxString(
"C3" ), wxString(
"33Meg" ), wxString(
"c=\"33Meg\"" ) },
55 { wxString(
"C4" ), wxString(
"33,000uF" ), wxString(
"c=\"33000u\"" ) },
56 { wxString(
"C5" ), wxString(
"3,300uF" ), wxString(
"c=\"3300u\"" ) },
57 { wxString(
"C6" ), wxString(
"33000uF" ), wxString(
"c=\"33000u\"" ) },
58 { wxString(
"C7" ), wxString(
"3300uF" ), wxString(
"c=\"3300u\"" ) },
59 { wxString(
"C8" ), wxString(
"3.3uF" ), wxString(
"c=\"3.3u\"" ) },
60 { wxString(
"C9" ), wxString(
"3,3uF" ), wxString(
"c=\"3.3u\"" ) },
61 { wxString(
"C10" ), wxString(
"3,32uF" ), wxString(
"c=\"3.32u\"" ) },
63 { wxString(
"C11" ), wxString(
"3u3" ), wxString(
"c=\"3.3u\"" ) },
64 { wxString(
"C12" ), wxString(
"3p3" ), wxString(
"c=\"3.3p\"" ) },
65 { wxString(
"C13" ), wxString(
"3u32" ), wxString(
"c=\"3.32u\"" ) },
67 { wxString(
"R1" ), wxString(
"3R3" ), wxString(
"r=\"3.3\"" ) },
68 { wxString(
"R2" ), wxString(
"3K3" ), wxString(
"r=\"3.3K\"" ) },
69 { wxString(
"R3" ), wxString(
"3K32" ), wxString(
"r=\"3.32K\"" ) },
71 { wxString(
"R4" ), wxString(
"3,000.5" ), wxString(
"r=\"3000.5\"" ) },
72 { wxString(
"R5" ), wxString(
"3.000,5" ), wxString(
"r=\"3000.5\"" ) },
73 { wxString(
"R6" ), wxString(
"3000.5" ), wxString(
"r=\"3000.5\"" ) },
74 { wxString(
"R7" ), wxString(
"3,000K" ), wxString(
"r=\"3000K\"" ) },
75 { wxString(
"R8" ), wxString(
"3.000K" ), wxString(
"r=\"3.000K\"" ) },
76 { wxString(
"R9" ), wxString(
"3.0,000,000" ), wxString(
"" ) },
78 { wxString(
"X1" ), wxString(
"3.3K" ), wxString(
"" ) },
80 { wxString(
"C14" ), wxString(
"33,000,000uF" ), wxString(
"c=\"33000000u\"" ) },
81 { wxString(
"C15" ), wxString(
"33 000 000uF" ), wxString(
"c=\"33000000u\"" ) },
82 { wxString(
"C16" ), wxString(
"33.000,000uF" ), wxString(
"c=\"33000.000u\"" )},
85 std::unique_ptr<LIB_SYMBOL> symbol = std::make_unique<LIB_SYMBOL>(
"symbol",
nullptr );
86 symbol->AddDrawItem(
new SCH_PIN( symbol.get() ) );
87 symbol->AddDrawItem(
new SCH_PIN( symbol.get() ) );
95 for(
const auto& testCase : testCases )
97 symbol->GetReferenceField().SetText( testCase.reference );
98 symbol->GetValueField().SetText( testCase.value );
100 std::vector<SCH_FIELD> fields;
101 fields.emplace_back( symbol->GetReferenceField() );
102 fields.emplace_back( symbol->GetValueField() );
105 &deviceType, &modelType, &modelParams, &pinMap );
107 msg.Printf(
"Passive model inference %s %s failed [%s != %s]",
112 BOOST_CHECK_MESSAGE( modelParams == testCase.result, msg.ToStdString() );
static bool InferSimModel(T &aSymbol, std::vector< SCH_FIELD > *aFields, bool aResolve, SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString *aDeviceType, wxString *aModelType, wxString *aModelParams, wxString *aPinMap)
TEST_SIM_MODEL_INFERENCE()
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(InferPassiveValues)