Sim QA: Add test for Numparam expressions inside .subckt

This commit is contained in:
Mikolaj Wielgus 2022-11-27 06:31:57 +01:00
parent 71d194071b
commit f2fb734e06
2 changed files with 21 additions and 1 deletions

View File

@ -27,10 +27,23 @@ R1 1 2 1K
R1 1 2 1K
.ends
.subckt two_params_short_form_4 1 2 param1=1.1E+1 param2=2.2E+2
R1 1 2 1K
.ends
.subckt NOTHING_5
R1 1 2 1K
.ends
.subckt Numparam_inside_6 1 2
.param a = 10
.param b = 20
.model DIODE D kf={PWR(a,0.25)*b/10}
D1 1 2 DIODE
.ends

View File

@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE( Subckts )
const std::vector<SIM_LIBRARY::MODEL> models = m_library->GetModels();
BOOST_CHECK_EQUAL( models.size(), 6 );
BOOST_CHECK_EQUAL( models.size(), 7 );
for( int i = 0; i < models.size(); ++i )
{
@ -199,6 +199,13 @@ BOOST_AUTO_TEST_CASE( Subckts )
BOOST_CHECK_EQUAL( model.GetParamCount(), 0 );
BOOST_CHECK_EQUAL( model.GetPinCount(), 0 );
break;
case 6:
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::SUBCKT );
BOOST_CHECK_EQUAL( modelName, "Numparam_inside_6" );
BOOST_CHECK_EQUAL( model.GetParamCount(), 0 );
BOOST_CHECK_EQUAL( model.GetPinCount(), 2 );
break;
}
}
}