Fix coveriry issue on haltest
[platform/core/telephony/libtapi.git] / haltest / tapi_hal_tc.cpp
index e7775db..fd570da 100644 (file)
@@ -305,7 +305,7 @@ TEST(TAPI_MODEM, tel_get_misc_me_version_sync_P)
 
        TelMiscVersionInformation *info = NULL;
        info = tel_get_misc_me_version_sync(tapi_h);
-       EXPECT_TRUE(NULL != info) << "tel_get_misc_me_version_sync() is failed" << std::endl;
+       ASSERT_TRUE(NULL != info) << "tel_get_misc_me_version_sync() is failed" << std::endl;
 
        std::cout << "  [sw version]: " << info->szSwVersion << std::endl;
        std::cout << "  [hw version]: " << info->szHwVersion << std::endl;
@@ -325,7 +325,7 @@ TEST(TAPI_MODEM, tel_get_misc_me_sn_sync_P)
 
        TelMiscSNInformation *sn;
        sn = tel_get_misc_me_sn_sync(tapi_h);
-       EXPECT_TRUE(NULL != sn) << "tel_get_misc_me_sn_sync() is failed" << std::endl;
+       ASSERT_TRUE(NULL != sn) << "tel_get_misc_me_sn_sync() is failed" << std::endl;
 
 
        std::cout << "  [esn number]: " << sn->szEsn << std::endl;
@@ -343,7 +343,7 @@ TEST(TAPI_MODEM, tel_get_misc_me_imei_sync_P)
 
        char *imei;
        imei = tel_get_misc_me_imei_sync(tapi_h);
-       EXPECT_TRUE(NULL != imei) << "tel_get_misc_me_imei_sync() is failed" << std::endl;
+       ASSERT_TRUE(NULL != imei) << "tel_get_misc_me_imei_sync() is failed" << std::endl;
 
        std::cout << "  [imei number]: " << imei << std::endl;
 
@@ -499,8 +499,20 @@ TEST(TAPI_DEINIT, tel_deinit_P)
        tapi_h = NULL;
 }
 
-int main(int argc, char **argv) {
-  InitGoogleTest(&argc, argv);
+int main(int argc, char **argv)
+{
+       int ret = -1;
 
-  return RUN_ALL_TESTS();
+       try {
+               testing::InitGoogleTest(&argc, argv);
+       } catch(...) {
+               std::cout << "Exception occurred." << std::endl;
+       }
+       try {
+               ret = RUN_ALL_TESTS();
+       } catch (const ::testing::internal::GoogleTestFailureException& e) {
+               ret = -1;
+               std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl;
+       }
+       return ret;
 }