From: saerome.kim Date: Wed, 8 Aug 2018 01:59:52 +0000 (+0900) Subject: Fixed Coverity issue : 1018945, 1018944 X-Git-Tag: accepted/tizen/unified/20180808.063419^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=04281cb5dd6e17f6f69ffce0941ffebd32df35bc;p=platform%2Fcore%2Fapi%2Fnfc.git Fixed Coverity issue : 1018945, 1018944 - There is no exception handler for unknown exception and testing::internal::GoogleTestFailureException. So, added handler. Change-Id: I83c271a2fa9288899cbd59a82c48c9cc18ba5676 Signed-off-by: saerome.kim --- diff --git a/haltest/nfc_manager_hal_tc.cpp b/haltest/nfc_manager_hal_tc.cpp index 0e53402..15595e7 100644 --- a/haltest/nfc_manager_hal_tc.cpp +++ b/haltest/nfc_manager_hal_tc.cpp @@ -134,6 +134,21 @@ TEST(Hal_nfc, Deinit_p) int main(int argc, char **argv) { - InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + int ret = 0; + try { + testing::InitGoogleTest(&argc, argv); + } catch (const ::testing::internal::GoogleTestFailureException& ex) { + std::cerr << "Caught: GoogleTestFailureException& " << ex.what() << std::endl; + } catch (...) { + std::cerr << "Caught: unknown exception" << std::endl; + } + + try { + ret = RUN_ALL_TESTS(); + } catch (const ::testing::internal::GoogleTestFailureException& ex) { + std::cerr << "Caught: GoogleTestFailureException& " << ex.what() << std::endl; + } catch (...) { + std::cerr << "Caught: unknown exception" << std::endl; + } + return ret; }