Skip to content

Commit

Permalink
Expected output for changing unparsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Dec 14, 2016
1 parent 3e1f360 commit ffd20b2
Show file tree
Hide file tree
Showing 16 changed files with 99 additions and 48 deletions.
5 changes: 3 additions & 2 deletions openmodelica/diff/AddComponent2.mos
Expand Up @@ -15,7 +15,8 @@ getErrorString();
addComponent(m1, Real, M1, annotate=Placement(visible=true, transformation=transformation(origin={-24,-54}, extent={{-10,-10},{10,10}}, rotation=0)));
getErrorString();
answer := "model M1
Real m1 annotation(Placement(visible = true, transformation(origin = {-24, -54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Real m1 annotation(
Placement(visible = true, transformation(origin = {-24, -54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
annotation(Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}}), graphics={
Expand All @@ -28,7 +29,7 @@ s2 := listFile(M1);
//print(s2);
res := diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain);
if answer<>res then
print("\nFailed \n");
print("\nFailed:\nGot:\n"+diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain)+"\nExpected:\n"+diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.color));
exit(1);
end if;

Expand Down
13 changes: 9 additions & 4 deletions openmodelica/interactive-API/Bug2943.mos
Expand Up @@ -25,11 +25,16 @@ getErrorString();
// true
// ""
// "model TestMyModel
// Modelica.Fluid.Vessels.OpenTank tank annotation(Placement(visible = true, transformation(origin = {20, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// Modelica.Fluid.Vessels.OpenTank opentank1 annotation(Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// Modelica.Fluid.Vessels.OpenTank tank annotation(
// Placement(visible = true, transformation(origin = {20, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// Modelica.Fluid.Vessels.OpenTank opentank1 annotation(
// Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// equation
// connect(opentank1.heatPort, tank.heatPort) annotation(Line(points = {{-70, 0}, {-87.395, 0}, {-87.395, 40.056}, {10.9244, 40.056}, {10.9244, 40.056}}, color = {191, 0, 0}));
// annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
// connect(opentank1.heatPort, tank.heatPort) annotation(
// Line(points = {{-70, 0}, {-87.395, 0}, {-87.395, 40.056}, {10.9244, 40.056}, {10.9244, 40.056}}, color = {191, 0, 0}));
// annotation(
// Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})),
// Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
// end TestMyModel;"
// ""
// endResult
18 changes: 12 additions & 6 deletions openmodelica/interactive-API/Bug3783.mos
Expand Up @@ -18,17 +18,21 @@ list(Bug3783); getErrorString();
// ""
// "model Bug3783
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 100) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(uses(Modelica(version = \"3.2.1\")));
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 100) annotation(
// Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(
// uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// "remove modifiers except redeclares"
// true
// ""
// "model Bug3783
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(uses(Modelica(version = \"3.2.1\")));
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid) annotation(
// Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(
// uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// Ok
Expand All @@ -39,8 +43,10 @@ list(Bug3783); getErrorString();
// ""
// "model Bug3783
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 10e5) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(uses(Modelica(version = \"3.2.1\")));
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 10e5) annotation(
// Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(
// uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// endResult
3 changes: 2 additions & 1 deletion openmodelica/interactive-API/ListAnnotation.mos
Expand Up @@ -32,7 +32,8 @@ list(M2); getErrorString();
// end M;"
// ""
// "model M2
// annotation(test = true);
// annotation(
// test = true);
// end M2;"
// ""
// endResult
6 changes: 4 additions & 2 deletions openmodelica/interactive-API/ListMultilineComment.mos
Expand Up @@ -19,7 +19,8 @@ x := str1 == str2;
// ""
// "model test \"Line 1
// Line2\"
// annotation(test = \"Line1
// annotation(
// test = \"Line1
// Line2\");
// end test;"
// true
Expand All @@ -30,7 +31,8 @@ x := str1 == str2;
// ""
// "model test \"Line 1
// Line2\"
// annotation(test = \"Line1
// annotation(
// test = \"Line1
// Line2\");
// end test;"
// true
Expand Down
9 changes: 5 additions & 4 deletions openmodelica/interactive-API/ProtectedHandlingBug2917.mos
Expand Up @@ -70,7 +70,7 @@ getErrorString();
// package p2
// model m1
// end m1;
//
//
// model m2
// end m2;
// end p2;
Expand All @@ -90,7 +90,7 @@ getErrorString();
// model m1
// Real var;
// end m1;
//
//
// model m2
// end m2;
// end p2;
Expand All @@ -107,9 +107,10 @@ getErrorString();
// package p2
// model m1
// Real var;
// Real var annotation(Placement);
// Real var annotation(
// Placement);
// end m1;
//
//
// model m2
// end m2;
// end p2;
Expand Down
3 changes: 2 additions & 1 deletion openmodelica/interactive-API/getDialogAnnotation.mos
Expand Up @@ -17,7 +17,8 @@ getComponentAnnotations(Modelica.Blocks.Sources.RealExpression); getErrorString(
// ""
// "model GetDialogAnnotation
// parameter Real x = 1;
// parameter Real y = 2 annotation(Dialog);
// parameter Real y = 2 annotation(
// Dialog);
// end GetDialogAnnotation;"
// ""
// {{},{Dialog("General","",true,-,false,"","","","","",false)}}
Expand Down
3 changes: 2 additions & 1 deletion openmodelica/interactive-API/interactive_api_annotations.mos
Expand Up @@ -26518,7 +26518,8 @@ getDocumentationAnnotation(Modelica.UsersGuide.Contact); getErrorString();
// Evaluating: getErrorString()
// ""
// Evaluating: getIconAnnotation(Modelica.Electrical.Analog.Basic.M_Transformer)
// {annotation(Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Ellipse(extent = {{-36, 24}, {-18, 42}}), Ellipse(extent = {{18, 24}, {36, 42}}), Ellipse(extent = {{0, 24}, {18, 42}}), Ellipse(extent = {{-18, 24}, {0, 42}}), Rectangle(extent = {{42, 24}, {-44, 34}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-36, 34}, {-62, 34}}, color = {0, 0, 255}, pattern = LinePattern.None), Line(points = {{62, 34}, {36, 34}}, color = {0, 0, 255}, pattern = LinePattern.None), Ellipse(extent = {{-36, 8}, {-18, 26}}), Ellipse(extent = {{18, 8}, {36, 26}}), Ellipse(extent = {{0, 8}, {18, 26}}), Ellipse(extent = {{-18, 8}, {0, 26}}), Rectangle(extent = {{42, 6}, {-44, 18}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-36, 18}, {-62, 18}}, color = {0, 0, 255}, pattern = LinePattern.None), Line(points = {{62, 18}, {36, 18}}, color = {0, 0, 255}, pattern = LinePattern.None), Line(points = {{-36, -29}, {-62, -29}}, color = {0, 0, 255}, pattern = LinePattern.None), Ellipse(extent = {{-36, -40}, {-18, -22}}), Ellipse(extent = {{-18, -40}, {0, -22}}), Ellipse(extent = {{0, -40}, {18, -22}}), Ellipse(extent = {{18, -40}, {36, -22}}), Line(points = {{62, -29}, {36, -29}}, color = {0, 0, 255}, pattern = LinePattern.None), Rectangle(extent = {{42, -42}, {-44, -30}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 8}, {0, -18}}, color = {0, 0, 255}, pattern = LinePattern.Dot), Text(extent = {{-150, 103}, {150, 63}}, textString = "%name", lineColor = {0, 0, 255})}, Ellipse(extent = [-36, 24; -18, 42]), Ellipse(extent = [18, 24; 36, 42]), Ellipse(extent = [0, 24; 18, 42]), Ellipse(extent = [-18, 24; 0, 42]), Rectangle(extent = [42, 24; -44, 34], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255})), Line(points = [-36, 34; -62, 34], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Line(points = [62, 34; 36, 34], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Ellipse(extent = [-36, 8; -18, 26]), Ellipse(extent = [18, 8; 36, 26]), Ellipse(extent = [0, 8; 18, 26]), Ellipse(extent = [-18, 8; 0, 26]), Rectangle(extent = [42, 6; -44, 18], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255})), Line(points = [-36, 18; -62, 18], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Line(points = [62, 18; 36, 18], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Line(points = [-36, -29; -62, -29], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Ellipse(extent = [-36, -40; -18, -22]), Ellipse(extent = [-18, -40; 0, -22]), Ellipse(extent = [0, -40; 18, -22]), Ellipse(extent = [18, -40; 36, -22]), Line(points = [62, -29; 36, -29], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Rectangle(extent = [42, -42; -44, -30], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255})), Line(points = [0, 8; 0, -18], style(pattern = 3, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)))) }
// {annotation(
// Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Ellipse(extent = {{-36, 24}, {-18, 42}}), Ellipse(extent = {{18, 24}, {36, 42}}), Ellipse(extent = {{0, 24}, {18, 42}}), Ellipse(extent = {{-18, 24}, {0, 42}}), Rectangle(extent = {{42, 24}, {-44, 34}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-36, 34}, {-62, 34}}, color = {0, 0, 255}, pattern = LinePattern.None), Line(points = {{62, 34}, {36, 34}}, color = {0, 0, 255}, pattern = LinePattern.None), Ellipse(extent = {{-36, 8}, {-18, 26}}), Ellipse(extent = {{18, 8}, {36, 26}}), Ellipse(extent = {{0, 8}, {18, 26}}), Ellipse(extent = {{-18, 8}, {0, 26}}), Rectangle(extent = {{42, 6}, {-44, 18}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-36, 18}, {-62, 18}}, color = {0, 0, 255}, pattern = LinePattern.None), Line(points = {{62, 18}, {36, 18}}, color = {0, 0, 255}, pattern = LinePattern.None), Line(points = {{-36, -29}, {-62, -29}}, color = {0, 0, 255}, pattern = LinePattern.None), Ellipse(extent = {{-36, -40}, {-18, -22}}), Ellipse(extent = {{-18, -40}, {0, -22}}), Ellipse(extent = {{0, -40}, {18, -22}}), Ellipse(extent = {{18, -40}, {36, -22}}), Line(points = {{62, -29}, {36, -29}}, color = {0, 0, 255}, pattern = LinePattern.None), Rectangle(extent = {{42, -42}, {-44, -30}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 8}, {0, -18}}, color = {0, 0, 255}, pattern = LinePattern.Dot), Text(extent = {{-150, 103}, {150, 63}}, textString = "%name", lineColor = {0, 0, 255})}, Ellipse(extent = [-36, 24; -18, 42]), Ellipse(extent = [18, 24; 36, 42]), Ellipse(extent = [0, 24; 18, 42]), Ellipse(extent = [-18, 24; 0, 42]), Rectangle(extent = [42, 24; -44, 34], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255})), Line(points = [-36, 34; -62, 34], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Line(points = [62, 34; 36, 34], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Ellipse(extent = [-36, 8; -18, 26]), Ellipse(extent = [18, 8; 36, 26]), Ellipse(extent = [0, 8; 18, 26]), Ellipse(extent = [-18, 8; 0, 26]), Rectangle(extent = [42, 6; -44, 18], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255})), Line(points = [-36, 18; -62, 18], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Line(points = [62, 18; 36, 18], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Line(points = [-36, -29; -62, -29], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Ellipse(extent = [-36, -40; -18, -22]), Ellipse(extent = [-18, -40; 0, -22]), Ellipse(extent = [0, -40; 18, -22]), Ellipse(extent = [18, -40; 36, -22]), Line(points = [62, -29; 36, -29], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)), Rectangle(extent = [42, -42; -44, -30], style(pattern = 0, fillColor = 7, rgbfillColor = {255, 255, 255})), Line(points = [0, 8; 0, -18], style(pattern = 3, fillColor = 7, rgbfillColor = {255, 255, 255}, fillPattern = 1)))) }
// Evaluating: getErrorString()
// ""
// Evaluating: getDiagramAnnotation(Modelica.Electrical.Analog.Basic.M_Transformer)
Expand Down
12 changes: 8 additions & 4 deletions openmodelica/interactive-API/interactive_api_attributes.mos
Expand Up @@ -175,7 +175,8 @@ list(A);
// final inner discrete Integer x \"comment for x\";
// protected
// equation
// connect(a, b) annotation(Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// connect(a, b) annotation(
// Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// end A;"
// Evaluating: getErrorString()
// ""
Expand Down Expand Up @@ -217,7 +218,8 @@ list(A);
// final stream Real y;
// protected
// equation
// connect(a, b) annotation(Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// connect(a, b) annotation(
// Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// end A;"
// Evaluating: getErrorString()
// ""
Expand Down Expand Up @@ -313,7 +315,8 @@ list(A);
// final inner discrete Integer x \"comment for x\";
// protected
// equation
// connect(a, b) annotation(Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// connect(a, b) annotation(
// Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// end A;"
// Evaluating: getErrorString()
// ""
Expand Down Expand Up @@ -355,7 +358,8 @@ list(A);
// final stream Real y;
// protected
// equation
// connect(a, b) annotation(Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// connect(a, b) annotation(
// Line(points = {{-22.0, 15.0}, {32.0, 15.0}, {32.0, 16.0}}));
// end A;"
// Evaluating: getErrorString()
// ""
Expand Down
12 changes: 8 additions & 4 deletions openmodelica/interactive-API/interactive_api_calls.mos
Expand Up @@ -322,14 +322,15 @@ getMessagesStringInternal(unique = false); // not unique
// Evaluating: getErrorString()
// ""
// Evaluating: getNthAnnotationString(Modelica.Electrical.Analog.Basic.Resistor, 1)
// "annotation(Documentation(info = \"<HTML>
// "annotation(
// Documentation(info = \"<HTML>
// <P>
// The linear resistor connects the branch voltage <i>v</i> with the
// branch current <i>i</i> by <i>i*R = v</i>.
// The Resistance <i>R</i> is allowed to be positive, zero, or negative.
// </P>
// </HTML>
// \", revisions = \"<html>
// \", revisions = \"<html>
// <ul>
// <li><i> August 07, 2009 </i>
// by Anton Haumer<br> temperature dependency of resistance added<br>
Expand All @@ -341,7 +342,9 @@ getMessagesStringInternal(unique = false); // not unique
// by Christoph Clauss<br> initially implemented<br>
// </li>
// </ul>
// </html>\"), Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-70, 30}, {70, -30}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-90, 0}, {-70, 0}}, color = {0, 0, 255}), Line(points = {{70, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-144, -40}, {142, -72}}, lineColor = {0, 0, 0}, textString = \"R=%R\"), Line(visible = useHeatPort, points = {{0, -100}, {0, -30}}, color = {127, 0, 0}, smooth = Smooth.None, pattern = LinePattern.Dot), Text(extent = {{-152, 87}, {148, 47}}, textString = \"%name\", lineColor = {0, 0, 255})}), Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-70, 30}, {70, -30}}, lineColor = {0, 0, 255}), Line(points = {{-96, 0}, {-70, 0}}, color = {0, 0, 255}), Line(points = {{70, 0}, {96, 0}}, color = {0, 0, 255})}));"
// </html>\"),
// Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-70, 30}, {70, -30}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-90, 0}, {-70, 0}}, color = {0, 0, 255}), Line(points = {{70, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-144, -40}, {142, -72}}, lineColor = {0, 0, 0}, textString = \"R=%R\"), Line(visible = useHeatPort, points = {{0, -100}, {0, -30}}, color = {127, 0, 0}, smooth = Smooth.None, pattern = LinePattern.Dot), Text(extent = {{-152, 87}, {148, 47}}, textString = \"%name\", lineColor = {0, 0, 255})}),
// Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-70, 30}, {70, -30}}, lineColor = {0, 0, 255}), Line(points = {{-96, 0}, {-70, 0}}, color = {0, 0, 255}), Line(points = {{70, 0}, {96, 0}}, color = {0, 0, 255})}));"
// Evaluating: getErrorString()
// ""
// Evaluating: getImportCount(Modelica.Mechanics.Rotational)
Expand Down Expand Up @@ -619,7 +622,8 @@ getMessagesStringInternal(unique = false); // not unique
// Evaluating: list(Modelica.UsersGuide.Conventions.Documentation.Format.Code)
// "class Code \"Code\"
// extends Modelica.Icons.Information;
// annotation(Documentation(info = \"<html>
// annotation(
// Documentation(info = \"<html>
// <p>
// <a href=\\\"modelica://Modelica.UsersGuide.Conventions.ModelicaCode\\\">Modelica code</a> conventions of class and instance names,
// parameters and variables are specified separately. In this section it is summarized how to refer to
Expand Down

0 comments on commit ffd20b2

Please sign in to comment.