diff options
author | jh9216.park <jh9216.park@samsung.com> | 2021-06-13 19:48:15 -0400 |
---|---|---|
committer | jh9216.park <jh9216.park@samsung.com> | 2021-06-13 20:36:40 -0400 |
commit | 793edc90a90efd370bf16e9d13a31d10dda97210 (patch) | |
tree | 038b4291f1d4b81f7ebf7dfa0f26f63628fea897 | |
parent | 3dc62a3a3328cdeba9c873b69c4fdf322262c340 (diff) | |
download | aul-1-793edc90a90efd370bf16e9d13a31d10dda97210.tar.gz aul-1-793edc90a90efd370bf16e9d13a31d10dda97210.tar.bz2 aul-1-793edc90a90efd370bf16e9d13a31d10dda97210.zip |
Fix unit test
- Destroy 'aul worker' before removing mock object
- Avoid accessing freed memory
Change-Id: Ie55bea49934bb68074e627f81c6694a9ee5e7ef0
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
-rw-r--r-- | test/unit_tests/test_launch_with_result.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/test/unit_tests/test_launch_with_result.cc b/test/unit_tests/test_launch_with_result.cc index 8f193682..b13ae726 100644 --- a/test/unit_tests/test_launch_with_result.cc +++ b/test/unit_tests/test_launch_with_result.cc @@ -65,6 +65,7 @@ class LaunchWithResultTest : public TestFixture { } virtual void TearDown() { + aul_launch_fini(); } std::unique_ptr<app_pkt_t, decltype(free)*> MakePacket( @@ -104,19 +105,6 @@ TEST_F(LaunchWithResultTest, aul_send_resume_request_for_uid) { cmd = header->cmd; return n; })); - EXPECT_CALL(GetMock<GlibMock>(), g_io_add_watch(_, _, _, _)) - .WillOnce(Invoke([](GIOChannel* channel, GIOCondition condition, - GIOFunc func, gpointer user_data) -> guint { - func(channel, condition, user_data); - return 1; - })); - EXPECT_CALL(GetMock<SocketMock>(), recv(_, _, _, _)) - .Times(1) - .WillOnce(Invoke([](int fd, void* buf, size_t n, int flags) -> ssize_t { - int ret = 100; - memcpy(buf, &ret, sizeof(int)); - return sizeof(int); - })); int ret = aul_send_resume_request_for_uid("test_appid", b.GetHandle(), getuid(), [](int, void*) {}, nullptr); |