Add exception handle for HAL test 61/187761/1 accepted/tizen/unified/20180828.181916 submit/tizen/20180828.075148
authorlokilee73 <changjoo.lee@samsung.com>
Tue, 28 Aug 2018 07:34:35 +0000 (16:34 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Tue, 28 Aug 2018 07:34:40 +0000 (16:34 +0900)
Change-Id: Ifbfa3fd48e57debb70a4f9f6e3954f46c29ecdd7
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
unittest/device_haltests.cpp

index e45533b..71d189f 100755 (executable)
@@ -1104,7 +1104,20 @@ TEST_F(USBGADGETHalTest, DeinitP)
 
 int main(int argc, char **argv)
 {
-       testing::InitGoogleTest(&argc, 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;
 }