From f5fcf4be3a70761bcafd949a6e60859e7456d88b Mon Sep 17 00:00:00 2001 From: gichan-jang Date: Tue, 11 Feb 2020 11:31:27 +0900 Subject: [PATCH] Fix/Coverity/1123652/1123668 : Handle thrown exception Fix to catch exception from GTest Coverity CID : 1123652, 1123668 Signed-off-by: gichan-jang --- tests/tizen_capi/unittest_tizen_capi.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/tizen_capi/unittest_tizen_capi.cc b/tests/tizen_capi/unittest_tizen_capi.cc index be4b5d8..5b2a6f8 100644 --- a/tests/tizen_capi/unittest_tizen_capi.cc +++ b/tests/tizen_capi/unittest_tizen_capi.cc @@ -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::::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; -- 2.7.4