From 75f27c6cbcd40bd2b9a27a055b3fed8901e81023 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 3 Aug 2021 19:54:11 -0400 Subject: [PATCH] unit test for vehicle_speed.cpp fix #3081 --- unit_tests/tests/test_vehicle_speed.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/unit_tests/tests/test_vehicle_speed.cpp b/unit_tests/tests/test_vehicle_speed.cpp index c3cd9959a1..abf6c92c0e 100644 --- a/unit_tests/tests/test_vehicle_speed.cpp +++ b/unit_tests/tests/test_vehicle_speed.cpp @@ -38,8 +38,6 @@ static void simulatePeriodicSignalForCallback( } TEST(VehicleSpeedSensor, testValidSpeedDetection) { - // Setup - setMockVehicleSpeed(-1); WITH_ENGINE_TEST_HELPER(TEST_ENGINE); CONFIG(vehicleSpeedSensorInputPin) = anyPin; engineConfiguration->vehicleSpeedCoef = 0.5f; @@ -50,13 +48,10 @@ TEST(VehicleSpeedSensor, testValidSpeedDetection) { float measuredSpeed = getVehicleSpeed(PASS_ENGINE_PARAMETER_SIGNATURE); EXPECT_NEAR(15.0f, measuredSpeed, 0.01); - // Tear down - setMockVehicleSpeed(-1); } TEST(VehicleSpeedSensor, testInvalidSpeed) { - // Setup - setMockVehicleSpeed(-1); + WITH_ENGINE_TEST_HELPER(TEST_ENGINE); CONFIG(vehicleSpeedSensorInputPin) = anyPin; engineConfiguration->vehicleSpeedCoef = 0.5f; @@ -68,7 +63,5 @@ TEST(VehicleSpeedSensor, testInvalidSpeed) { // Direct comparasion as invalid speed shoud return true zero EXPECT_EQ(0.0f, measuredSpeed); - // Tear down - setMockVehicleSpeed(-1); }