Fix a bug in VUR VTS test.
The logic is to check whether each element is not the same as
previous element. We forgot to increase i.
Test: Presubmit
Bug: 326987403
Change-Id: I5cab61a86092fb14d17551a533e8cdaff1abfee5
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index ccc0f3f..4ea6dfe 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -640,13 +640,12 @@
size_t i = 0;
float previousValue;
for (const auto& [_, value] : valuesByTimestamp) {
- if (i == 0) {
- previousValue = value;
- } else {
+ if (i != 0) {
ASSERT_FALSE(value != previousValue) << "received duplicate value: " << value
<< " when variable update rate is true";
- previousValue = value;
}
+ previousValue = value;
+ i++;
}
}