diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-04-06 18:18:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-06 18:18:25 +0000 |
commit | 4cb19c55b5d336a0cdbc584d8c4b240d1abe8f3e (patch) | |
tree | 60fc314d23ac437a8ff064865bd0d31512a05657 | |
parent | a30017aa9aa8d2ce26788ea0efa3738b2f98cdd2 (diff) | |
parent | 2ff86c4bcf0c071b2256297d8f28d6322aed9a29 (diff) | |
download | android_hardware_interfaces-4cb19c55b5d336a0cdbc584d8c4b240d1abe8f3e.tar.gz android_hardware_interfaces-4cb19c55b5d336a0cdbc584d8c4b240d1abe8f3e.tar.bz2 android_hardware_interfaces-4cb19c55b5d336a0cdbc584d8c4b240d1abe8f3e.zip |
Merge "thermal: fix VTS test for default implementation"
-rw-r--r-- | thermal/1.0/vts/functional/VtsHalThermalV1_0TargetTest.cpp | 17 |
1 files 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 3989c94bc..dfa11a1dc 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; |