From dd62969e33b0fc78c61000cd8bb9857225879af3 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Fri, 5 Apr 2019 10:54:20 -0700 Subject: [PATCH] Check temperature and cooling device name not empty Bug: 116540200 Test: atest VtsHalThermalV2_0TargetTest Change-Id: I61bfb32ed6115d711dfcc82c2c3ff6eb29951ef2 --- .../2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp b/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp index cc2f3df612..d0f2e84afd 100644 --- a/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp +++ b/thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp @@ -192,6 +192,9 @@ TEST_F(ThermalHidlTest, TemperatureTest) { } else { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_LT(0u, temperatures[i].name.size()); + } }); auto types = hidl_enum_range(); for (const auto& type : types) { @@ -204,6 +207,7 @@ TEST_F(ThermalHidlTest, TemperatureTest) { } for (int i = 0; i < temperatures.size(); ++i) { EXPECT_EQ(type, temperatures[i].type); + EXPECT_LT(0u, temperatures[i].name.size()); } }); } @@ -246,6 +250,9 @@ TEST_F(ThermalHidlTest, CoolingDeviceTest) { } else { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); } + for (int i = 0; i < cooling_devices.size(); ++i) { + EXPECT_LT(0u, cooling_devices[i].name.size()); + } }); for (int i = 0; i <= static_cast(CoolingType::COMPONENT); ++i) { auto type = static_cast(i); @@ -258,6 +265,7 @@ TEST_F(ThermalHidlTest, CoolingDeviceTest) { } for (int i = 0; i < cooling_devices.size(); ++i) { EXPECT_EQ(type, cooling_devices[i].type); + EXPECT_LT(0u, cooling_devices[i].name.size()); } }); }