diff options
author | Changgyu Choi <changyu.choi@samsung.com> | 2021-06-11 13:52:41 +0900 |
---|---|---|
committer | Changgyu Choi <changyu.choi@samsung.com> | 2021-06-11 14:28:14 +0900 |
commit | 9484b431696d9cdf0faa07d9fdc1cd8f3bd0353b (patch) | |
tree | 19f215255173064e9d2be97194659375c029faf7 | |
parent | bdb748676ded4f2359ba11314bc34410f61060fb (diff) | |
download | aul-1-9484b431696d9cdf0faa07d9fdc1cd8f3bd0353b.tar.gz aul-1-9484b431696d9cdf0faa07d9fdc1cd8f3bd0353b.tar.bz2 aul-1-9484b431696d9cdf0faa07d9fdc1cd8f3bd0353b.zip |
Fix to unit test fail that is timing issue.
Some aul API object use glib API at destructor.
This patch removes mock from some functions used at destructor.
Change-Id: I7eb977b5ef683427e04b6a86c8bd1b26b07bbf94
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
-rw-r--r-- | test/app_control_tests/test_app_control.cc | 2 | ||||
-rw-r--r-- | test/unit_tests/mock/glib_mock.cc | 3 | ||||
-rw-r--r-- | test/unit_tests/mock/glib_mock.h | 3 |
3 files changed, 1 insertions, 7 deletions
diff --git a/test/app_control_tests/test_app_control.cc b/test/app_control_tests/test_app_control.cc index 68145f4a..c2c30547 100644 --- a/test/app_control_tests/test_app_control.cc +++ b/test/app_control_tests/test_app_control.cc @@ -161,7 +161,7 @@ class AppControlTest : public TestFixture { } if (result1.size() != result2.size()) { - fprintf(stderr, "resul1.size(%u) is not equal to result2.size(%u)\n", + fprintf(stderr, "resul1.size(%zu) is not equal to result2.size(%zu)\n", result1.size(), result2.size()); return false; } diff --git a/test/unit_tests/mock/glib_mock.cc b/test/unit_tests/mock/glib_mock.cc index 06cf8261..c662df84 100644 --- a/test/unit_tests/mock/glib_mock.cc +++ b/test/unit_tests/mock/glib_mock.cc @@ -30,11 +30,9 @@ extern "C" guint g_io_add_watch(GIOChannel* channel, GIOCondition condition, extern "C" void g_io_channel_set_close_on_unref(GIOChannel* channel, gboolean do_close) { - MOCK_HOOK_P2(GlibMock, g_io_channel_set_close_on_unref, channel, do_close); } extern "C" void g_io_channel_unref(GIOChannel* channel) { - MOCK_HOOK_P1(GlibMock, g_io_channel_unref, channel); } extern "C" gint g_io_channel_unix_get_fd(GIOChannel* channel) { @@ -53,7 +51,6 @@ extern "C" GSource* g_io_create_watch(GIOChannel* channel, } extern "C" void g_source_unref(GSource* source) { - MOCK_HOOK_P1(GlibMock, g_source_unref, source); } extern "C" void g_source_set_callback(GSource* source, GSourceFunc func, diff --git a/test/unit_tests/mock/glib_mock.h b/test/unit_tests/mock/glib_mock.h index 16870f68..fe695a16 100644 --- a/test/unit_tests/mock/glib_mock.h +++ b/test/unit_tests/mock/glib_mock.h @@ -55,14 +55,11 @@ class GlibMock : public virtual ModuleMock { MOCK_METHOD1(g_io_channel_unix_new, GIOChannel* (gint)); MOCK_METHOD4(g_io_add_watch, guint (GIOChannel*, GIOCondition, GIOFunc, gpointer)); - MOCK_METHOD2(g_io_channel_set_close_on_unref, void (GIOChannel*, gboolean)); - MOCK_METHOD1(g_io_channel_unref, void (GIOChannel*)); MOCK_METHOD1(g_io_channel_unix_get_fd, gint (GIOChannel*)); MOCK_METHOD4(g_idle_add_full, guint (gint, GSourceFunc, gpointer, GDestroyNotify)); MOCK_METHOD1(g_main_loop_is_running, gboolean (GMainLoop*)); MOCK_METHOD2(g_io_create_watch, GSource* (GIOChannel*, GIOCondition)); - MOCK_METHOD1(g_source_unref, void (GSource*)); MOCK_METHOD4(g_source_set_callback, void (GSource*, GSourceFunc, gpointer, GDestroyNotify)); MOCK_METHOD2(g_source_set_priority, void (GSource*, gint)); |