33 #include <wx/string.h> 83 std::vector<struct TEST_DATA> testData = {
88 {
".ac dec 10 1 10K",
ST_AC },
89 {
".ac dec 10 1K 100MEG",
ST_AC },
90 {
".ac lin 100 1 100HZ",
ST_AC },
91 {
".dc VIN 0.25 5.0 0.25",
ST_DC },
92 {
".dc VDS 0 10 .5 VGS 0 5 1",
ST_DC },
93 {
".dc VCE 0 10 .25 IB 0 10u 1u",
ST_DC },
94 {
".dc RLoad 1k 2k 100",
ST_DC },
95 {
".dc TEMP -15 75 5",
ST_DC },
98 {
".noise v(5) VIN dec 10 1kHz 100MEG",
ST_NOISE },
99 {
".noise v(5,3) V1 oct 8 1.0 1.0e6 1",
ST_NOISE },
110 for(
auto& step : testData )
114 BOOST_CHECK_EQUAL( result, step.type );
117 for(
auto& step : testData )
119 step.command.Append(
"\n" );
122 BOOST_CHECK_EQUAL( result, step.type );
139 std::vector<struct TEST_DATA> testData = {
170 {
"net-_q3-pad2_",
"V(net-_q3-pad2_)",
SPT_VOLTAGE },
171 {
"net-_q2-pad3_",
"V(net-_q2-pad3_)",
SPT_VOLTAGE },
172 {
"net-_q2-pad1_",
"V(net-_q2-pad1_)",
SPT_VOLTAGE },
173 {
"net-_q1-pad3_",
"V(net-_q1-pad3_)",
SPT_VOLTAGE },
174 {
"net-_l2-pad1_",
"V(net-_l2-pad1_)",
SPT_VOLTAGE },
175 {
"net-_c4-pad2_",
"V(net-_c4-pad2_)",
SPT_VOLTAGE },
176 {
"net-_c3-pad1_",
"V(net-_c3-pad1_)",
SPT_VOLTAGE },
177 {
"net-_c1-pad2_",
"V(net-_c1-pad2_)",
SPT_VOLTAGE },
190 for(
auto& step : testData )
192 wxString outputSignalName;
195 retVal = m_exporter.VectorToSignal( step.vector, outputSignalName );
197 BOOST_CHECK_EQUAL( retVal, step.type );
198 BOOST_CHECK_EQUAL( outputSignalName.Cmp( step.signal ), 0 );
203 BOOST_AUTO_TEST_SUITE_END()
NETLIST_EXPORTER_PSPICE_SIM m_exporter
virtual ~TEST_NETLIST_EXPORTER_PSPICE_SIM()
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
Holds all the data relating to one schematic.
BOOST_AUTO_TEST_CASE(CommandToSimType)
Declare the test suite.
SETTINGS_MANAGER m_manager
static SIM_TYPE CommandToSimType(const wxString &aCmd)
Return simulation type basing on a simulation command directive.
SIM_TYPE
< Possible simulation types
TEST_NETLIST_EXPORTER_PSPICE_SIM()
void SetProject(PROJECT *aPrj)
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Loads a project or sets up a new project with a specified path.
void Reset()
Initialize this schematic to a blank one, unloading anything existing.
Special netlist exporter flavor that allows one to override simulation commands.