diff options
author | hyunho <hhstark.kang@samsung.com> | 2020-09-17 16:26:44 +0900 |
---|---|---|
committer | hyunho <hhstark.kang@samsung.com> | 2020-09-17 16:36:14 +0900 |
commit | 752885e271cc4208d3465c26bf37c0c4f790e9ac (patch) | |
tree | ba1207ab8e8e1bc899739455994403e52f0936bb | |
parent | 92b7d048f863201c3db45321c0df3a91312364ae (diff) | |
download | appcore-watch-752885e271cc4208d3465c26bf37c0c4f790e9ac.tar.gz appcore-watch-752885e271cc4208d3465c26bf37c0c4f790e9ac.tar.bz2 appcore-watch-752885e271cc4208d3465c26bf37c0c4f790e9ac.zip |
Fix gtest memmory leak
Change-Id: I83656ac76701c811c2d9479c15fc02d2f7e875a3
Signed-off-by: hyunho <hhstark.kang@samsung.com>
-rw-r--r-- | test/unit_tests/test_watch_app.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit_tests/test_watch_app.cc b/test/unit_tests/test_watch_app.cc index 43394e2..7267fd8 100644 --- a/test/unit_tests/test_watch_app.cc +++ b/test/unit_tests/test_watch_app.cc @@ -94,8 +94,8 @@ TEST_F(WatchAppTest, watch_app_main) { char** argv = nullptr; int argc = bundle_export_to_argv(b.GetHandle(), &argv); ASSERT_EQ(get_last_result(), BUNDLE_ERROR_NONE); - ASSERT_NE(argv, nullptr); ASSERT_NE(argc, 0); + ASSERT_NE(argv, nullptr); watch_app_lifecycle_callback_s callback; callback.create = __app_create_cb; @@ -118,6 +118,7 @@ TEST_F(WatchAppTest, watch_app_main) { WillOnce(Return(0)); ret = watch_app_main(argc, argv, &callback, nullptr); + bundle_free_exported_argv(argc, &argv); EXPECT_EQ(APP_ERROR_NONE, ret); } @@ -173,6 +174,8 @@ TEST_F(WatchAppTest, watch_app_get_ambient_tick_type) { TEST_F(WatchAppTest, watch_time_get_current_time) { watch_time_h time; int ret = watch_time_get_current_time(&time); + auto p = std::unique_ptr<std::remove_pointer<watch_time_h>::type, + decltype(watch_time_delete)*>(time, watch_time_delete); EXPECT_EQ(APP_ERROR_NONE, ret); } @@ -196,6 +199,8 @@ TEST_F(WatchAppTest, watch_time_info) { bool status; bool daylight; + auto p = std::unique_ptr<std::remove_pointer<watch_time_h>::type, + decltype(watch_time_delete)*>(time, watch_time_delete); ret = watch_time_get_year(time, &year); EXPECT_EQ(APP_ERROR_NONE, ret); ret = watch_time_get_month(time, &month); |