EtEventLoop::EtEventLoop()
{
this->log_dom_ = -1;
- this->time_for_wait_work_ = E_TEST_WORK_TIME;
+ this->Worker.work_timer_ = NULL;
+ this->Worker.time_for_wait_work_ = E_TEST_WORK_TIME;
this->tizen_policy_ = NULL;
this->tizen_surface_ = NULL;
void EtEventLoop::Work()
{
/* give a turn to deal with deferred job for E_TEST_WORK_TIME */
- ecore_timer_add(time_for_wait_work_, _cb_work_timeout, NULL);
+ this->Worker.work_timer_ = ecore_timer_add(this->Worker.time_for_wait_work_, _cb_work_timeout, this);
elm_run();
}
+void EtEventLoop::FinishWork()
+{
+ if (this->Worker.work_timer_)
+ {
+ ecore_timer_del(this->Worker.work_timer_);
+ this->Worker.work_timer_ = NULL;
+ }
+
+ elm_exit();
+}
+
void EtEventLoop::PrintWinInfoList()
{
EtWin *tw = NULL;
void EtEventLoop::DelTimer()
{
- if (this->Ev.expire_timer)
+ if (this->Worker.work_timer_)
{
- ecore_timer_del(this->Ev.expire_timer);
- this->Ev.expire_timer = NULL;
+ ecore_timer_del(this->Worker.work_timer_);
+ this->Worker.work_timer_ = NULL;
}
}
void EtEventLoop::RunTimer()
{
- if (this->Ev.expire_timer)
+ if (this->Worker.work_timer_)
this->DelTimer();
- this->Ev.expire_timer = ecore_timer_add(this->time_for_wait_work_, _cb_work_timeout, NULL);
+ this->Worker.work_timer_ = ecore_timer_add(this->Worker.time_for_wait_work_, _cb_work_timeout, this);
}
void EtEventLoop::WaitForDestroy()
static Eina_Bool _cb_work_timeout(void *data)
{
- elm_exit();
+ EtEventLoop *ev_loop = (EtEventLoop *)data;
+
+ ev_loop->FinishWork();
+
return ECORE_CALLBACK_CANCEL;
}
struct tizen_surface *tizen_surface_ = NULL;
int log_dom_ = -1;
- double time_for_wait_work_ = 0.0;
struct
{
struct
{
+ Ecore_Timer *work_timer_;
+ double time_for_wait_work_;
+ } Worker;
+
+ struct
+ {
Eldbus_Connection *conn;
Eldbus_Proxy *proxy;
Eldbus_Object *obj;
Eina_Bool Init();
void Shutdown();
void Work();
+ void FinishWork();
void PrintWinInfoList();
- void SetWaitWorkTime(double time) { this->time_for_wait_work_ = time; };
+ void SetWaitWorkTime(double time) { this->Worker.time_for_wait_work_ = time; };
void DelTimer();
void RunTimer();
void WaitForDestroy();
class EtTestEasy : public ::testing::Test
{
+ public:
+ EtTestEasy()
+ {
+ };
+ ~EtTestEasy()
+ {
+ if (HasFailure())
+ gLoop->WaitForDestroy();
+ };
+
protected:
static void SetUpTestCase() {};
static void TearDownTestCase() {};
if (*result == EINA_FALSE)
ERR("errname:%s errmsg:%s\n", name, text);
- elm_exit();
+ gLoop->FinishWork();
}
static void
ERR("errname:%s errmsg:%s\n", name, text);
}
- elm_exit();
+ gLoop->FinishWork();
}
TEST_F(EtTestEasy, base_pass)
ASSERT_TRUE(p != NULL);
gLoop->Work();
-
ASSERT_TRUE(result);
}