From 3e4a4ce3ae7cb9626a70c0b5aab2335ee86d6dcd Mon Sep 17 00:00:00 2001 From: Polina Bondarenko Date: Wed, 5 Apr 2017 16:51:23 +0200 Subject: [PATCH] thermal: fix VTS test for default implementation Bug: 36097196 Test: vts Change-Id: I67cceb672a9ba67ae760019c0521d31544416882 --- .../functional/VtsHalThermalV1_0TargetTest.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/thermal/1.0/vts/functional/VtsHalThermalV1_0TargetTest.cpp b/thermal/1.0/vts/functional/VtsHalThermalV1_0TargetTest.cpp index 3989c94bcf..dfa11a1dc1 100644 --- a/thermal/1.0/vts/functional/VtsHalThermalV1_0TargetTest.cpp +++ b/thermal/1.0/vts/functional/VtsHalThermalV1_0TargetTest.cpp @@ -68,10 +68,12 @@ class ThermalHidlTest : public ::testing::VtsHalHidlTargetTestBase { if (i < baseSize_) { EXPECT_EQ(names_[i], temperatures[i].name.c_str()); } else { - // Names must be unique. - EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(), - temperatures[i].name.c_str())); - names_.push_back(temperatures[i].name); + // Names must be unique only for known temperature types. + if (temperatures[i].type != TemperatureType::UNKNOWN) { + EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(), + temperatures[i].name.c_str())); + } + names_.push_back(temperatures[i].name); } } baseSize_ = size; @@ -88,10 +90,9 @@ class ThermalHidlTest : public ::testing::VtsHalHidlTargetTestBase { if (i < baseSize_) { EXPECT_EQ(names_[i], cpuUsages[i].name.c_str()); } else { - // Names must be unique. - EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(), - cpuUsages[i].name.c_str())); - names_.push_back(cpuUsages[i].name); + // Names are not guaranteed to be unique because of the current + // default Thermal HAL implementation. + names_.push_back(cpuUsages[i].name); } } baseSize_ = size;