Skip to content

Commit

Permalink
Tests for removeComponentModifiers and removeExtendsModifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 2, 2015
1 parent d51186c commit eca3094
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion openmodelica/interactive-API/interactive_api_annotations.mos
Expand Up @@ -73,10 +73,14 @@ getComponentAnnotations(Modelica.Electrical.Analog.Basic.Ground); getErrorString
getParameterNames(Modelica.Electrical.Analog.Basic.Resistor); getErrorString();
// R one doesn't have a default value!
getParameterValue(Modelica.Electrical.Analog.Basic.Resistor, "R"); getErrorString();
// the the modification names
// the modification names
getComponentModifierNames(Modelica.Electrical.Analog.Basic.Resistor, "R"); getErrorString();
// retrieve the start value
getComponentModifierValue(Modelica.Electrical.Analog.Basic.Resistor, R.start); getErrorString();
// remove the component modifiers
removeComponentModifiers(Modelica.Electrical.Analog.Basic.Resistor, "R"); getErrorString();
// the modification names again, should be empty now
getComponentModifierNames(Modelica.Electrical.Analog.Basic.Resistor, "R"); getErrorString();
getParameterValue(Modelica.Electrical.Analog.Basic.Resistor, "T_ref"); getErrorString();
getComponentModifierNames(Modelica.Electrical.Analog.Basic.Resistor, "T_ref"); getErrorString();
getParameterValue(Modelica.Electrical.Analog.Basic.Resistor, "alpha"); getErrorString();
Expand Down Expand Up @@ -8186,6 +8190,14 @@ getDocumentationAnnotation(Modelica.UsersGuide.Contact); getErrorString();
// = 1
// Evaluating: getErrorString()
// ""
// Evaluating: removeComponentModifiers(Modelica.Electrical.Analog.Basic.Resistor, "R")
// true
// Evaluating: getErrorString()
// ""
// Evaluating: getComponentModifierNames(Modelica.Electrical.Analog.Basic.Resistor, "R")
// {}
// Evaluating: getErrorString()
// ""
// Evaluating: getParameterValue(Modelica.Electrical.Analog.Basic.Resistor, "T_ref")
// "300.15"
// Evaluating: getErrorString()
Expand Down
12 changes: 12 additions & 0 deletions openmodelica/interactive-API/interactive_api_param.mos
Expand Up @@ -73,6 +73,12 @@ getExtendsModifierValue(K3,Resistor,R);
getExtendsModifierNames(K4,Resistor);
setExtendsModifierValue(K4,Resistor,x,$Code(()));
getExtendsModifierValue(K4,Resistor,x);
// returns modifier applied on Resistor
getExtendsModifierNames(K4,Resistor);
// removes the modifiers applied on Resistor
removeExtendsModifiers(K4,Resistor);
// returns modifier applied on Resistor, should be empty now
getExtendsModifierNames(K4,Resistor);
setExtendsModifierValue(K5,Resistor,x,$Code(()));
getExtendsModifierNames(K5,Resistor);
getExtendsModifierValue(K5,Resistor,x.fixed);
Expand Down Expand Up @@ -212,6 +218,12 @@ isExtendsModifierFinal(K6,Resistor,x);
// Ok
// Evaluating: getExtendsModifierValue(K4, Resistor, x)
// (start = 2, fixed = true)
// Evaluating: getExtendsModifierNames(K4, Resistor)
// {x.start, x.fixed}
// Evaluating: removeExtendsModifiers(K4, Resistor)
// true
// Evaluating: getExtendsModifierNames(K4, Resistor)
// {}
// Evaluating: setExtendsModifierValue(K5, Resistor, x, $Code())
// Ok
// Evaluating: getExtendsModifierNames(K5, Resistor)
Expand Down

0 comments on commit eca3094

Please sign in to comment.