From: lokilee73 Date: Wed, 22 Aug 2018 02:01:42 +0000 (+0900) Subject: To fix gtest errors X-Git-Tag: submit/tizen/20180822.022033^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f31fedb77fc2f61b7e7c560a980a046bf062cc6;p=platform%2Fcore%2Fsystem%2Flibdevice-node.git To fix gtest errors 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 --- 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) {