Fix/Coverity/1123652/1123668 : Handle thrown exception
authorgichan-jang <gichan2.jang@samsung.com>
Tue, 11 Feb 2020 02:31:27 +0000 (11:31 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 11 Feb 2020 03:47:07 +0000 (19:47 -0800)
Fix to catch exception from GTest
Coverity CID : 1123652, 1123668

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
tests/tizen_capi/unittest_tizen_capi.cc

index be4b5d8..5b2a6f8 100644 (file)
@@ -3734,15 +3734,23 @@ TEST (nnstreamer_capi_singleshot, set_input_info_success_02)
 int
 main (int argc, char **argv)
 {
-  int result;
+  int result = -1;
 
-  testing::InitGoogleTest (&argc, argv);
+  try {
+    testing::InitGoogleTest (&argc, argv);
+  } catch (...) {
+    g_warning ("catch 'testing::internal::<unnamed>::ClassUniqueToAlwaysTrue'");
+  }
 
   /* ignore tizen feature status while running the testcases */
   set_feature_state (1);
 
-  result = RUN_ALL_TESTS ();
-
+  try {
+    result = RUN_ALL_TESTS ();
+  } catch (...) {
+    g_warning ("catch `testing::internal::GoogleTestFailureException`");
+  }
+  
   set_feature_state (-1);
 
   return result;