Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

modified testcase for distance test: distanceBasedDrivingCycle now drives...

modified testcase for distance test: distanceBasedDrivingCycle now drives across slope changes (only speed changes are met exactly)
parent 9ab8ce85
No related branches found
No related tags found
No related merge requests found
......@@ -179,11 +179,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
absTime += response.SimulationInterval;
var exceeded = (ResponseDrivingCycleDistanceExceeded)cycle.OutPort().Request(absTime, 300.SI<Meter>());
Assert.AreEqual(16, exceeded.MaxDistance.Value(), Tolerance);
Assert.AreEqual(5.SI<MeterPerSecond>().Value(), driver.LastRequest.TargetVelocity.Value(), Tolerance);
Assert.AreEqual(0.0284160694958265, driver.LastRequest.Gradient.Value(), 1E-12);
Assert.AreEqual(2 + startDistance, cycle.CurrentState.Distance.Value(), Tolerance);
var exceeded = (ResponseDrivingCycleDistanceExceeded)cycle.OutPort().Request(absTime, 1000.SI<Meter>());
Assert.AreEqual(811, exceeded.MaxDistance.Value(), Tolerance);
AssertHelper.Exception<VectoSimulationException>(() => {
container.CommitSimulationStep(absTime, exceeded.SimulationInterval);
......@@ -193,8 +190,8 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
response = cycle.OutPort().Request(absTime, exceeded.MaxDistance);
Assert.AreEqual(5.SI<MeterPerSecond>().Value(), driver.LastRequest.TargetVelocity.Value(), Tolerance);
Assert.AreEqual(0.0284160694958265, driver.LastRequest.Gradient.Value(), 1E-12);
Assert.AreEqual(18 + startDistance, cycle.CurrentState.Distance.Value(), Tolerance);
Assert.AreEqual(0.020140043264606885, driver.LastRequest.Gradient.Value(), 1E-12);
Assert.AreEqual(813 + startDistance, cycle.CurrentState.Distance.Value(), Tolerance);
container.CommitSimulationStep(absTime, response.SimulationInterval);
......
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