Combine try-catch statement in recovery test 68/241168/2
authorIlho Kim <ilho159.kim@samsung.com>
Tue, 18 Aug 2020 08:25:51 +0000 (17:25 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Tue, 18 Aug 2020 08:28:30 +0000 (17:28 +0900)
Change-Id: I8f26d8c9b714eada2537ddd2f60547aecc7c97fd
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/unit_tests/recovery_test.cc

index 6a8615282d88c5bdac463bc11eba0dc2a95f8f43..a9dbbb80a2a6de1f1d3db8a741fa8588350d0b45 100644 (file)
@@ -354,18 +354,18 @@ TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
 const int kBufSize = 1024;
 
 int main(int argc,  char** argv) {
-  bool no_backup = false;
-  int repeat_count = 10;
-  ReqType req_type = ReqType::UNKNOWN_REQ;
-  bool repeat = false;
-  BackupType backup_type = BackupType::MOVE;
-  ci::RequestMode request_mode = smoke_test::ParseRequestMode(argc, argv);
-  if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL)
-    std::cout << "Run recovery test with user request mode" << std::endl;
-
-  bpo::options_description options("Allowed options");
-  bpo::variables_map opt_map;
   try {
+    bool no_backup = false;
+    int repeat_count = 10;
+    ReqType req_type = ReqType::UNKNOWN_REQ;
+    bool repeat = false;
+    BackupType backup_type = BackupType::MOVE;
+    ci::RequestMode request_mode = smoke_test::ParseRequestMode(argc, argv);
+    if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL)
+      std::cout << "Run recovery test with user request mode" << std::endl;
+
+    bpo::options_description options("Allowed options");
+    bpo::variables_map opt_map;
     options.add_options()
         ("help", "display this help message")
         ("install",
@@ -446,14 +446,7 @@ int main(int argc,  char** argv) {
       std::cerr << options << std::endl;
       return 0;
     }
-  } catch (...) {
-    std::cerr << "Exception occurred: "
-              << boost::current_exception_diagnostic_information()
-              << std::endl;
-    return -1;
-  }
 
-  try {
     testing::GTEST_FLAG(filter) = install_req_filter[req_type];
     if (repeat) {
       testing::GTEST_FLAG(repeat) = repeat_count;