Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f9212b87 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

add tolerance for equality comparison of extrapolated values

parent 46006845
No related branches found
No related tags found
No related merge requests found
......@@ -314,7 +314,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
Assert.AreEqual(absTime, port.AbsTime);
Assert.AreEqual(dt, port.Dt);
Assert.AreEqual(inAngularSpeed, port.AngularVelocity.Value() / Constants.RPMToRad, 1e-3);
AssertHelper.AreRelativeEqual(expectedTorque.SI<NewtonMeter>(), port.Torque);
AssertHelper.AreRelativeEqual(expectedTorque.SI<NewtonMeter>(), port.Torque, 1e-2);
var modData = new MockModalDataContainer();
Assert.IsTrue(gearbox.CurrentState.TorqueLossResult.Extrapolated);
......@@ -350,7 +350,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
Assert.AreEqual(absTime, port.AbsTime);
Assert.AreEqual(dt, port.Dt);
Assert.AreEqual(n, port.AngularVelocity);
AssertHelper.AreRelativeEqual(expectedTorque.SI<NewtonMeter>(), port.Torque);
AssertHelper.AreRelativeEqual(expectedTorque.SI<NewtonMeter>(), port.Torque, 1e-2);
var modData = new MockModalDataContainer();
Assert.IsTrue(gearbox.CurrentState.TorqueLossResult.Extrapolated);
......@@ -387,7 +387,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
Assert.AreEqual(dt, port.Dt);
Assert.AreEqual(n, port.AngularVelocity);
Assert.AreEqual(extrapolated, gearbox.CurrentState.TorqueLossResult.Extrapolated);
AssertHelper.AreRelativeEqual(expectedTorque.SI<NewtonMeter>(), port.Torque);
AssertHelper.AreRelativeEqual(expectedTorque.SI<NewtonMeter>(), port.Torque, 1e-2);
var modData = new MockModalDataContainer();
gearbox.CommitSimulationStep(modData);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment