From d4c8c7654d9c72018b93f4765adc82a166a1ad44 Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Thu, 23 Sep 2021 16:43:18 +0200 Subject: [PATCH] updated test cases to work with new interface (PCCState on Databus) --- .../Integration/ADAS/ADASTestsConventional.cs | 8 ++++---- VectoCore/VectoCoreTest/Utils/MockDriver.cs | 1 + VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VectoCore/VectoCoreTest/Integration/ADAS/ADASTestsConventional.cs b/VectoCore/VectoCoreTest/Integration/ADAS/ADASTestsConventional.cs index 620272e80f..1ba4c6303b 100644 --- a/VectoCore/VectoCoreTest/Integration/ADAS/ADASTestsConventional.cs +++ b/VectoCore/VectoCoreTest/Integration/ADAS/ADASTestsConventional.cs @@ -16,7 +16,7 @@ using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.FileIO; using TUGraz.VectoCore.Tests.Utils; using TUGraz.VectoCore.Utils; -using static TUGraz.VectoCore.Models.SimulationComponent.Impl.DefaultDriverStrategy.PCCStates; +using static TUGraz.VectoCore.Models.SimulationComponent.Impl.PCCStates; using static TUGraz.VectoCore.Models.SimulationComponent.Impl.DrivingAction; namespace TUGraz.VectoCore.Tests.Integration.ADAS @@ -1377,7 +1377,7 @@ namespace TUGraz.VectoCore.Tests.Integration.ADAS (4723, 1e6, OutsideSegment, Accelerate)); - private void TestPCC(string jobName, string cycleName, params (double start, double end, DefaultDriverStrategy.PCCStates pcc, DrivingAction action)[] data) + private void TestPCC(string jobName, string cycleName, params (double start, double end, PCCStates pcc, DrivingAction action)[] data) { jobName = Path.Combine(BasePath, jobName + ".vecto"); @@ -1395,7 +1395,7 @@ namespace TUGraz.VectoCore.Tests.Integration.ADAS var expected = data; var segmentWasTested = false; var distances = mod.Columns[ModalResultField.dist.GetName()].Values<Meter>(); - var pccStates = mod.Columns["PCCState"].Values<DefaultDriverStrategy.PCCStates>(); + var pccStates = mod.Columns["PCCState"].Values<PCCStates>(); var actions = mod.Columns["DriverAction"].Values<DrivingAction>(); var vActs = mod.Columns[ModalResultField.v_act.GetName()].Values<MeterPerSecond>(); @@ -1432,7 +1432,7 @@ namespace TUGraz.VectoCore.Tests.Integration.ADAS var pccCol = mod.Columns["PCCState"]; var driverActionCol = mod.Columns["DriverAction"]; - var pccStates = pccCol.Values<DefaultDriverStrategy.PCCStates>(); + var pccStates = pccCol.Values<PCCStates>(); var driverAction = driverActionCol.Values<DrivingAction>(); var distances = sCol.Values<Meter>(); var sections = GetDistancesOfStateChanges(pccStates.Zip(driverAction), distances).ToArray(); diff --git a/VectoCore/VectoCoreTest/Utils/MockDriver.cs b/VectoCore/VectoCoreTest/Utils/MockDriver.cs index 527f36a371..27ff91a02f 100644 --- a/VectoCore/VectoCoreTest/Utils/MockDriver.cs +++ b/VectoCore/VectoCoreTest/Utils/MockDriver.cs @@ -123,5 +123,6 @@ namespace TUGraz.VectoCore.Tests.Utils public DrivingAction DrivingAction { get; set; } public MeterPerSquareSecond DriverAcceleration { get; set; } + public PCCStates PCCState => PCCStates.OutsideSegment; } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs b/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs index 700aae6934..5a5a688980 100644 --- a/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs +++ b/VectoCore/VectoCoreTest/Utils/MockVehicleContainer.cs @@ -232,6 +232,7 @@ namespace TUGraz.VectoCore.Tests.Utils public DrivingAction DrivingAction { get; set; } public MeterPerSquareSecond DriverAcceleration { get; set; } + public PCCStates PCCState => PCCStates.OutsideSegment; public CycleData CycleData { get; set; } -- GitLab