Opened 11 years ago

Closed 11 years ago

#1984 closed defect (fixed)

Improperly tests simulations

Reported by: sjoelund.se Owned by: cschubert
Priority: high Milestone: 1.9.0
Component: Build Environment Version: trunk
Keywords: Cc: bruno

Description

When doing simulation tests, you need to call getErrorString() after the simulate() command so we test warnings and notifications.

The following msl32 tests are not properly tested:

Modelica.Mechanics.MultiBody.Examples.Elementary.ForceAndTorque.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.FreeBody.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.InitSpringConstant.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.PendulumWithSpringDamper.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravity.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses2.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravityWithPointMasses.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem.mos
Modelica.Mechanics.MultiBody.Examples.Elementary.SpringWithMass.mos
Modelica.Mechanics.MultiBody.Examples.Loops.Engine1a.mos
Modelica.Mechanics.MultiBody.Examples.Loops.Engine1b_analytic.mos
Modelica.Mechanics.MultiBody.Examples.Loops.Engine1b.mos
Modelica.Mechanics.MultiBody.Examples.Loops.Fourbar1.mos
Modelica.Mechanics.MultiBody.Examples.Loops.Fourbar2.mos
Modelica.Mechanics.MultiBody.Examples.Loops.Fourbar_analytic.mos
Modelica.Mechanics.MultiBody.Examples.Loops.PlanarLoops_analytic.mos
Modelica.Mechanics.MultiBody.Examples.Rotational3DEffects.ActuatedDrive.mos
Modelica.Mechanics.MultiBody.Examples.Rotational3DEffects.GearConstraint.mos
Modelica.Mechanics.MultiBody.Examples.Rotational3DEffects.GyroscopicEffects.mos
Modelica.Mechanics.MultiBody.Examples.Rotational3DEffects.MovingActuatedDrive.mos
Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.oneAxis.mos
Modelica.Mechanics.Rotational.Examples.Backlash.mos
Modelica.Mechanics.Rotational.Examples.CoupledClutches.mos
Modelica.Mechanics.Rotational.Examples.ElasticBearing.mos
Modelica.Mechanics.Rotational.Examples.FirstGrounded.mos
Modelica.Mechanics.Rotational.Examples.First.mos
Modelica.Mechanics.Rotational.Examples.Friction.mos
Modelica.Mechanics.Rotational.Examples.HeatLosses.mos
Modelica.Mechanics.Rotational.Examples.LossyGearDemo1.mos
Modelica.Mechanics.Rotational.Examples.LossyGearDemo2.mos
Modelica.Mechanics.Rotational.Examples.LossyGearDemo3.mos
Modelica.Mechanics.Rotational.Examples.RollingWheel.mos
Modelica.Mechanics.Translational.Examples.Accelerate.mos
Modelica.Mechanics.Translational.Examples.Brake.mos
Modelica.Mechanics.Translational.Examples.Damper.mos
Modelica.Mechanics.Translational.Examples.ElastoGap.mos
Modelica.Mechanics.Translational.Examples.Friction.mos
Modelica.Mechanics.Translational.Examples.HeatLosses.mos
Modelica.Mechanics.Translational.Examples.InitialConditions.mos
Modelica.Mechanics.Translational.Examples.Oscillator.mos
Modelica.Mechanics.Translational.Examples.PreLoad.mos
Modelica.Mechanics.Translational.Examples.Sensors.mos
Modelica.Mechanics.Translational.Examples.SignConvention.mos
Modelica.Mechanics.Translational.Examples.WhyArrows.mos

Change History (5)

comment:1 Changed 11 years ago by adrpo

I would say getErrorString() should be added after each API command (except getErrorString()).
So even for load* and set* commands that set flags, etc we should have it.
Is easier to catch errors that way.

comment:2 Changed 11 years ago by cschubert

I've added getErrorString() to the models mentioned.
However, I am not sure how to efficiently add getErrorString(); to every API command. "Search and Replace" won't do.
I am open for suggestions which saves me from manually editing >200 files?

Could getErrorString be run automatically after each API command?

comment:3 Changed 11 years ago by sjoelund.se

That could perhaps be done. It might mess with output in if-statements in scripts (uncommon, but it exists). An easier way would probably be to force getErrorString() on omc exit.

comment:4 Changed 11 years ago by adrpo

Is fine for now just after simulate().
Maybe we should call it after each API command.
Or each command should return a record:

record Result
  AnyType result;
  String errorMsg;
end Result;

or a tuple as in Modelica you can use functions returning
multiple outputs in place where just one element is expected:

(result, errorMsg)

comment:5 Changed 11 years ago by cschubert

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.