diff --git a/eeschema/sim/ngspice.cpp b/eeschema/sim/ngspice.cpp index d28b142545..c1f416ebc3 100644 --- a/eeschema/sim/ngspice.cpp +++ b/eeschema/sim/ngspice.cpp @@ -296,12 +296,12 @@ bool NGSPICE::LoadNetlist( const string& aNetlist ) lines.push_back( nullptr ); // sentinel, as requested in ngSpice_Circ description Command( "remcirc" ); - m_ngSpice_Circ( lines.data() ); + bool success = !m_ngSpice_Circ( lines.data() ); for( auto line : lines ) free( line ); - return true; + return success; } @@ -345,8 +345,7 @@ bool NGSPICE::Command( const string& aCmd ) { LOCALE_IO c_locale; // ngspice works correctly only with C locale validate(); - m_ngSpice_Command( (char*) aCmd.c_str() ); - return true; + return !m_ngSpice_Command( (char*) aCmd.c_str() ); } diff --git a/qa/unittests/eeschema/test_netlist_exporter_spice.cpp b/qa/unittests/eeschema/test_netlist_exporter_spice.cpp index c47bbea294..d7edd29a9a 100644 --- a/qa/unittests/eeschema/test_netlist_exporter_spice.cpp +++ b/qa/unittests/eeschema/test_netlist_exporter_spice.cpp @@ -117,8 +117,8 @@ public: //ngspice->Init(); ngspice->Command( "set ngbehavior=ps" ); ngspice->Command( "setseed 1" ); - ngspice->LoadNetlist( netlist.ToStdString() ); - ngspice->Run(); + BOOST_REQUIRE( ngspice->LoadNetlist( netlist.ToStdString() ) ); + BOOST_REQUIRE( ngspice->Run() ); // We need to make sure that the number of points always the same. ngspice->Command( "linearize" );