Check evas validity before invocations

master
Daniel Zaoui 6 years ago
parent 8a76345c15
commit 62298eb8ff
  1. 61
      src/lib/tsuite_hook_player.c

@ -253,53 +253,51 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_MOUSE_IN:
{
mouse_in_mouse_out *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
_tsuite_verbosef("Mouse in\n");
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_mouse_in timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
evas_event_feed_mouse_in(eina_list_nth(evas_list, t->n_evas),
time(NULL), NULL);
if (e) evas_event_feed_mouse_in(e, time(NULL), NULL);
break;
}
case TSUITE_EVENT_MOUSE_OUT:
{
mouse_in_mouse_out *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
_tsuite_verbosef("Mouse out\n");
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_mouse_out timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
evas_event_feed_mouse_out(eina_list_nth(evas_list, t->n_evas),
time(NULL), NULL);
if (e) evas_event_feed_mouse_out(e, time(NULL), NULL);
break;
}
case TSUITE_EVENT_MOUSE_DOWN:
{
mouse_down_mouse_up *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
_tsuite_verbosef("Mouse down\n");
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_mouse_down timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
if (rect) evas_object_color_set(rect, 255, 255, 0, 255);
evas_event_feed_mouse_down(eina_list_nth(evas_list, t->n_evas),
t->b, t->flags, time(NULL),
NULL);
if (e) evas_event_feed_mouse_down(e, t->b, t->flags, time(NULL), NULL);
break;
}
case TSUITE_EVENT_MOUSE_UP:
{
mouse_down_mouse_up *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
_tsuite_verbosef("Mouse up\n");
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_mouse_up timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
evas_event_feed_mouse_up(eina_list_nth(evas_list, t->n_evas),
t->b, t->flags, time(NULL),
NULL);
if (e) evas_event_feed_mouse_up(e, t->b, t->flags, time(NULL), NULL);
if (rect) evas_object_color_set(rect, 255, 0, 0, 255);
break;
@ -307,12 +305,12 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_MOUSE_MOVE:
{
mouse_move *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_mouse_move (x,y)=(%d,%d) timestamp=<%u> t->n_evas=<%d>\n", __func__, t->x, t->y, t->timestamp,t->n_evas);
#endif
evas_event_feed_mouse_move(eina_list_nth(evas_list, t->n_evas),
t->x, t->y, time(NULL), NULL);
if (e) evas_event_feed_mouse_move(e, t->x, t->y, time(NULL), NULL);
if (rect)
{
@ -324,33 +322,32 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_MOUSE_WHEEL:
{
mouse_wheel *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
_tsuite_verbosef("Mouse wheel\n");
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_mouse_wheel timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
evas_event_feed_mouse_wheel(eina_list_nth(evas_list, t->n_evas),
t->direction, t->z,
time(NULL), NULL);
if (e) evas_event_feed_mouse_wheel(e, t->direction, t->z, time(NULL), NULL);
break;
}
case TSUITE_EVENT_MULTI_DOWN:
{
multi_event *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_multi_down timestamp=<%u>, t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
if (!t->d)
{
evas_event_feed_mouse_down(eina_list_nth(evas_list, t->n_evas),
t->b, t->flags, time(NULL), NULL);
if (e) evas_event_feed_mouse_down(e, t->b, t->flags, time(NULL), NULL);
if (rect) evas_object_color_set(rect, 255, 255, 0, 255);
}
else
{
evas_event_feed_multi_down(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_multi_down(e,
t->d, t->x, t->y, t->rad,
t->radx, t->rady, t->pres, t->ang, t->fx, t->fy,
t->flags, time(NULL), NULL);
@ -361,19 +358,19 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_MULTI_UP:
{
multi_event *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_multi_up timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp,t->n_evas);
#endif
if (!t->d)
{
evas_event_feed_mouse_up(eina_list_nth(evas_list, t->n_evas),
t->b, t->flags, time(NULL), NULL);
if (e) evas_event_feed_mouse_up(e, t->b, t->flags, time(NULL), NULL);
if (rect) evas_object_color_set(rect, 255, 0, 0, 255);
}
else
{
evas_event_feed_multi_up(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_multi_up(e,
t->d, t->x, t->y, t->rad,
t->radx, t->rady, t->pres, t->ang, t->fx, t->fy,
t->flags, time(NULL), NULL);
@ -384,14 +381,14 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_MULTI_MOVE:
{
multi_move *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_multi_move timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
if (!t->d)
{
evas_event_feed_mouse_move(eina_list_nth(evas_list, t->n_evas),
t->x, t->y, time(NULL), NULL);
if (e) evas_event_feed_mouse_move(e, t->x, t->y, time(NULL), NULL);
if (rect)
{
evas_object_move(rect, t->x, t->y);
@ -400,7 +397,7 @@ tsuite_feed_event(void *data)
}
else
{
evas_event_feed_multi_move(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_multi_move(e,
t->d, t->x, t->y, t->rad,
t->radx, t->rady, t->pres, t->ang, t->fx, t->fy,
time(NULL), NULL);
@ -411,11 +408,12 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_KEY_DOWN:
{
key_down_key_up *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_key_down timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
evas_event_feed_key_down(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_key_down(e,
t->keyname, t->key, t->string,
t->compose, time(NULL), NULL);
@ -424,11 +422,12 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_KEY_UP:
{
key_down_key_up *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_key_up timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
#endif
evas_event_feed_key_up(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_key_up(e,
t->keyname, t->key, t->string,
t->compose, time(NULL), NULL);
@ -437,11 +436,12 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_KEY_DOWN_WITH_KEYCODE:
{
key_down_key_up_with_keycode *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_key_down_with_keycode timestamp=<%u> t->n_evas=<%d> t->keycode=<%u>\n", __func__, t->timestamp, t->n_evas, t->keycode);
#endif
evas_event_feed_key_down_with_keycode(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_key_down_with_keycode(e,
t->keyname, t->key, t->string,
t->compose, time(NULL), NULL, t->keycode);
@ -450,11 +450,12 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_KEY_UP_WITH_KEYCODE:
{
key_down_key_up_with_keycode *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s evas_event_feed_key_up_with_keycode timestamp=<%u> t->n_evas=<%d> t->keycode=<%u>\n", __func__, t->timestamp, t->n_evas, t->keycode);
#endif
evas_event_feed_key_up(eina_list_nth(evas_list, t->n_evas),
if (e) evas_event_feed_key_up(e,
t->keyname, t->key, t->string,
t->compose, time(NULL), NULL);
@ -464,6 +465,7 @@ tsuite_feed_event(void *data)
case TSUITE_EVENT_TAKE_SHOT:
{
take_screenshot *t = v->data;
Eo *e = eina_list_nth(evas_list, t->n_evas);
evt_time = t->timestamp;
#ifdef DEBUG_TSUITE
printf("%s take shot timestamp=<%u> t->n_evas=<%d>\n", __func__, t->timestamp, t->n_evas);
@ -472,8 +474,7 @@ tsuite_feed_event(void *data)
ts.serial++;
if (_hook_setting->dest_dir)
{
_shot_do(NULL,
eina_list_nth(evas_list, t->n_evas)); /* Serial name based on test-name */
if (e) _shot_do(NULL, e); /* Serial name based on test-name */
if (_hook_setting->store_objects) _objects_snapshot_do();
}
break;

Loading…
Cancel
Save