Fixed Coverity issue : 1018945, 1018944 71/186171/1 accepted/tizen/unified/20180808.063419 submit/tizen/20180808.022814
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 8 Aug 2018 01:59:52 +0000 (10:59 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Wed, 8 Aug 2018 01:59:52 +0000 (10:59 +0900)
- There is no exception handler for unknown exception and
  testing::internal::GoogleTestFailureException. So, added handler.

Change-Id: I83c271a2fa9288899cbd59a82c48c9cc18ba5676
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
haltest/nfc_manager_hal_tc.cpp

index 0e53402..15595e7 100644 (file)
@@ -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;
 }