thermal: fix VTS test for default implementation

Bug: 36097196
Test: vts
Change-Id: I67cceb672a9ba67ae760019c0521d31544416882
This commit is contained in:
Polina Bondarenko
2017-04-05 16:51:23 +02:00
committed by Daniel Cardenas
parent 4ccc3b0140
commit 3e4a4ce3ae

View File

@@ -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;