diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2019-04-23 18:12:30 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2019-04-23 18:12:30 +0900 |
commit | bf33cb87c434602895911053d2dbca8e869295c6 (patch) | |
tree | 1219cae797b55aefea1db1cc377df7859e72d06f | |
parent | 73f093bc8fdc18cd8706a165ac057e072ab30312 (diff) | |
download | bundle-bf33cb87c434602895911053d2dbca8e869295c6.tar.gz bundle-bf33cb87c434602895911053d2dbca8e869295c6.tar.bz2 bundle-bf33cb87c434602895911053d2dbca8e869295c6.zip |
Fix static analysis issues
- Initializes bundle pointers to nullptr
- Adds an exception handling
Change-Id: I9f49a1e236f62d0729db57b4e2a1b7e09cc3bd02
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | src/bundle_cpp_implementation.h | 4 | ||||
-rw-r--r-- | unit_tests/src/test_main.cc | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/bundle_cpp_implementation.h b/src/bundle_cpp_implementation.h index 5810f09..71bce84 100644 --- a/src/bundle_cpp_implementation.h +++ b/src/bundle_cpp_implementation.h @@ -54,10 +54,10 @@ class Bundle::Impl { private: friend class Bundle; - bundle* handle_; + bundle* handle_ = nullptr; bool copy_ = true; bool own_ = true; - Bundle* parent_; + Bundle* parent_ = nullptr; }; } // namespace tizen_base diff --git a/unit_tests/src/test_main.cc b/unit_tests/src/test_main.cc index df16333..22cae75 100644 --- a/unit_tests/src/test_main.cc +++ b/unit_tests/src/test_main.cc @@ -17,7 +17,14 @@ #include <gtest/gtest.h> #include <gmock/gmock.h> +#include <exception> + int main(int argc, char** argv) { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + try { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); + } catch (std::exception const &e) { + std::cout << "test_main caught exception: " << e.what() << std::endl; + return -1; + } } |