summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2018-08-22 11:01:42 +0900
committerlokilee73 <changjoo.lee@samsung.com>2018-08-22 11:07:17 +0900
commit6f31fedb77fc2f61b7e7c560a980a046bf062cc6 (patch)
tree32a638904bc7b1b5224b777aa28f646c99cc6700
parent3df4cb828e94d86a76a8af1858b4c0a348d2a40b (diff)
downloadlibdevice-node-6f31fedb77fc2f61b7e7c560a980a046bf062cc6.tar.gz
libdevice-node-6f31fedb77fc2f61b7e7c560a980a046bf062cc6.tar.bz2
libdevice-node-6f31fedb77fc2f61b7e7c560a980a046bf062cc6.zip
To fix gtest errorssubmit/tizen/20180822.022033
There were errors by unsupported devices. ex) thermal and cpu in wearable target Old value of h/w info remained and it caused errors. So, initialize h/w info at the beggining of gtest. Change-Id: I95edc88ff7020346f0a9d1bf5c0edff6dea28bc0 Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rwxr-xr-xunittest/device_haltests.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittest/device_haltests.cpp b/unittest/device_haltests.cpp
index 9d0cb37..e45533b 100755
--- a/unittest/device_haltests.cpp
+++ b/unittest/device_haltests.cpp
@@ -209,6 +209,7 @@ TEST_F(BATTERYHalTest, InitP)
if (!supported)
return;
+ info = NULL;
ret = hw_get_info(BATTERY_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
EXPECT_EQ(ret, 0) << "Fail to load battery hal (" << ret << ")";
@@ -290,6 +291,7 @@ TEST_F(CPUHalTest, InitP)
{
int ret;
+ info = NULL;
ret = hw_get_info(CPU_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
@@ -354,6 +356,7 @@ TEST_F(DISPLAYHalTest, InitP)
{
int ret;
+ info = NULL;
ret = hw_get_info(DISPLAY_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
@@ -533,6 +536,7 @@ TEST_F(EXTCONHalTest, InitP)
{
int ret;
+ info = NULL;
ret = hw_get_info(EXTERNAL_CONNECTION_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
@@ -610,6 +614,7 @@ TEST_F(IRHalTest, InitP)
if (!supported)
return;
+ info = NULL;
ret = hw_get_info(IR_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
EXPECT_EQ(ret, 0) << "Fail to get hal for ir (" << ret << ")";
@@ -679,6 +684,7 @@ TEST_F(RGBHalTest, InitP)
if (!supported)
return;
+ info = NULL;
ret = hw_get_info(LED_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
EXPECT_EQ(ret, 0) << "Fail to get hal for rgb (" << ret << ")";
@@ -734,6 +740,7 @@ TEST_F(THERMALHalTest, InitP)
{
int ret;
+ info = NULL;
ret = hw_get_info(THERMAL_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
@@ -809,6 +816,7 @@ TEST_F(TOUCHSCREENHalTest, InitP)
{
int ret;
+ info = NULL;
ret = hw_get_info(TOUCHSCREEN_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
@@ -861,6 +869,7 @@ TEST_F(USBCLIENTHalTest, InitP)
if (!supported)
return;
+ info = NULL;
ret = hw_get_info(USB_CLIENT_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
@@ -1037,6 +1046,7 @@ TEST_F(USBGADGETHalTest, InitP)
{
int ret;
+ info = NULL;
ret = hw_get_info(USB_GADGET_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {