Skip to content

Commit

Permalink
Tests: removed the ids from the sine approximations CellML files.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Sep 29, 2020
1 parent 57a75fe commit aa444bd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
14 changes: 7 additions & 7 deletions tests/printer/printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ TEST(Printer, printModelWithImports)
{
const std::string e_model =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<model xmlns=\"http://www.cellml.org/cellml/2.0#\" name=\"sin_approximations_import\" id=\"sin_approximations_import\">\n"
"<model xmlns=\"http://www.cellml.org/cellml/2.0#\" name=\"sin_approximations_import\">\n"
" <import xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"sin.xml\">\n"
" <component component_ref=\"sin\" name=\"actual_sin\"/>\n"
" </import>\n"
Expand All @@ -226,12 +226,12 @@ TEST(Printer, printModelWithImports)
" <import xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"parabolic_approx_sin.xml\">\n"
" <component component_ref=\"sin\" name=\"parabolic_approx_sin\"/>\n"
" </import>\n"
" <component name=\"main\" id=\"main\">\n"
" <variable name=\"x\" units=\"dimensionless\" interface=\"public_and_private\" id=\"x\"/>\n"
" <variable name=\"sin1\" units=\"dimensionless\" interface=\"public_and_private\" id=\"sin\"/>\n"
" <variable name=\"sin2\" units=\"dimensionless\" interface=\"public_and_private\" id=\"deriv_approx\"/>\n"
" <variable name=\"deriv_approx_initial_value\" units=\"dimensionless\" initial_value=\"0\" interface=\"public_and_private\" id=\"deriv_approx_initial_value\"/>\n"
" <variable name=\"sin3\" units=\"dimensionless\" interface=\"public_and_private\" id=\"parabolic_approx\"/>\n"
" <component name=\"main\">\n"
" <variable name=\"x\" units=\"dimensionless\" interface=\"public_and_private\"/>\n"
" <variable name=\"sin1\" units=\"dimensionless\" interface=\"public_and_private\"/>\n"
" <variable name=\"sin2\" units=\"dimensionless\" interface=\"public_and_private\"/>\n"
" <variable name=\"deriv_approx_initial_value\" units=\"dimensionless\" initial_value=\"0\" interface=\"public_and_private\"/>\n"
" <variable name=\"sin3\" units=\"dimensionless\" interface=\"public_and_private\"/>\n"
" <variable name=\"C\" units=\"dimensionless\" initial_value=\"0.75\" interface=\"public_and_private\"/>\n"
" </component>\n"
" <connection component_1=\"main\" component_2=\"actual_sin\">\n"
Expand Down
8 changes: 4 additions & 4 deletions tests/resources/deriv_approx_sin.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="deriv_approx_sin" id="deriv_approx_sin">
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="deriv_approx_sin">


<component name="sin" id="sin">
<variable id="x" units="dimensionless" name="x" interface="public_and_private"/>
<variable id="sin" units="dimensionless" name="sin" initial_value="sin_initial_value" interface="public_and_private"/>
<component name="sin">
<variable units="dimensionless" name="x" interface="public_and_private"/>
<variable units="dimensionless" name="sin" initial_value="sin_initial_value" interface="public_and_private"/>
<variable units="dimensionless" name="sin_initial_value" interface="public_and_private"/>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><eq/>
Expand Down
22 changes: 11 additions & 11 deletions tests/resources/parabolic_approx_sin.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="parabolic_approx_sin" id="parabolic_approx_sin">
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="parabolic_approx_sin">


<component name="sin" id="sin">
<variable id="x" units="dimensionless" name="x" interface="public_and_private"/>
<variable id="sin" units="dimensionless" name="sin" interface="public_and_private"/>
<component name="sin">
<variable units="dimensionless" name="x" interface="public_and_private"/>
<variable units="dimensionless" name="sin" interface="public_and_private"/>
<variable units="dimensionless" name="k2_oPi" interface="public_and_private"/>
<variable units="dimensionless" name="k2Pi" interface="public_and_private"/>
<variable units="dimensionless" name="kPi_2" interface="public_and_private"/>
Expand All @@ -12,32 +12,32 @@
<variable units="dimensionless" name="z" interface="public_and_private"/>
<variable units="dimensionless" name="C" interface="public_and_private"/>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply id="k2_oPi"><eq/>
<apply><eq/>
<ci>k2_oPi</ci>
<apply><divide/>
<cn cellml:units="dimensionless">2.0</cn>
<pi/>
</apply>
</apply>
<apply id="k2Pi"><eq/>
<apply><eq/>
<ci>k2Pi</ci>
<apply><times/>
<cn cellml:units="dimensionless">2.0</cn>
<pi/>
</apply>
</apply>
<apply id="kPi_2"><eq/>
<apply><eq/>
<ci>kPi_2</ci>
<apply><divide/>
<pi/>
<cn cellml:units="dimensionless">2.0</cn>
</apply>
</apply>
<apply id="kPi"><eq/>
<apply><eq/>
<ci>kPi</ci>
<pi/>
</apply>
<apply id="kPi_32"><eq/>
<apply><eq/>
<ci>kPi_32</ci>
<apply><divide/>
<apply><times/>
Expand All @@ -48,7 +48,7 @@
</apply>
</apply>

<apply id="z"><eq/>
<apply><eq/>
<ci>z</ci>
<piecewise>
<piece>
Expand Down Expand Up @@ -111,7 +111,7 @@
</piecewise>
</apply>

<apply id="sin"><eq/>
<apply><eq/>
<ci>sin</ci>
<piecewise>
<piece>
Expand Down
8 changes: 4 additions & 4 deletions tests/resources/sin.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="sin" id="sin">
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="sin">


<component name="sin" id="sin">
<component name="sin">
<variable name="x" units="dimensionless" interface="public_and_private"/>
<variable id="sin" units="dimensionless" name="sin" interface="public_and_private"/>
<variable units="dimensionless" name="sin" interface="public_and_private"/>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply id="actual_sin"><eq/>
<apply><eq/>
<ci>sin</ci>
<apply><sin/>
<ci>x</ci>
Expand Down
14 changes: 7 additions & 7 deletions tests/resources/sine_approximations_import.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="sin_approximations_import" id="sin_approximations_import">
<?xml version="1.0" encoding="UTF-8"?><model xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#" xmlns:xlink="http://www.w3.org/1999/xlink" name="sin_approximations_import">



Expand All @@ -12,12 +12,12 @@
<component name="parabolic_approx_sin" component_ref="sin"/>
</import>

<component name="main" id="main">
<variable id="x" name="x" units="dimensionless" interface="public_and_private"/>
<variable id="sin" name="sin1" units="dimensionless" interface="public_and_private"/>
<variable id="deriv_approx" units="dimensionless" name="sin2" interface="public_and_private"/>
<variable id="deriv_approx_initial_value" units="dimensionless" name="deriv_approx_initial_value" initial_value="0" interface="public_and_private"/>
<variable id="parabolic_approx" name="sin3" units="dimensionless" interface="public_and_private"/>
<component name="main">
<variable name="x" units="dimensionless" interface="public_and_private"/>
<variable name="sin1" units="dimensionless" interface="public_and_private"/>
<variable units="dimensionless" name="sin2" interface="public_and_private"/>
<variable units="dimensionless" name="deriv_approx_initial_value" initial_value="0" interface="public_and_private"/>
<variable name="sin3" units="dimensionless" interface="public_and_private"/>
<variable name="C" units="dimensionless" interface="public_and_private" initial_value="0.75"/>
</component>

Expand Down

0 comments on commit aa444bd

Please sign in to comment.