From 21fd08ff2804662923e084d3bad9f304af6df8fc Mon Sep 17 00:00:00 2001 From: "sangwan.kwon" Date: Thu, 19 May 2016 19:21:49 +0900 Subject: Add TC for g_main_loop timeout Change-Id: I70e1185c5b86d8fe8d8b03c0ff9559582d8d96c8 --- tests/logic_.h | 11 ++++++++++- tests/test_logic.cpp | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/logic_.h b/tests/logic_.h index a02a003..2a14a62 100644 --- a/tests/logic_.h +++ b/tests/logic_.h @@ -83,12 +83,21 @@ public: { m_logic.timerStart(interval); } - void timerStop() { m_logic.timerStop(); } + // gio operation + void run(guint timeout) + { + m_logic.run(timeout); + } + bool is_gmain_loop_running() + { + return m_logic.is_gmain_loop_running(); + } + private: Logic_ m_logic; }; diff --git a/tests/test_logic.cpp b/tests/test_logic.cpp index 8b32d7b..397b792 100644 --- a/tests/test_logic.cpp +++ b/tests/test_logic.cpp @@ -457,4 +457,16 @@ BOOST_AUTO_TEST_CASE(logic_workflow_timer) { BOOST_REQUIRE(true); } +BOOST_AUTO_TEST_CASE(logic_workflow_gio_timeout) { + + // Wait for setup. + BOOST_REQUIRE(setup() == NO_ERROR); + wait_for_worker(); + + // Run gmainloop. + run(3); + + BOOST_REQUIRE(is_gmain_loop_running() == false); +} + BOOST_AUTO_TEST_SUITE_END() -- cgit v1.2.3