Inspect: colorize differences

This commit is contained in:
Daniel Zaoui 2018-02-21 12:11:00 +02:00
parent 56cfef5694
commit 44cc8381bf
1 changed files with 14 additions and 11 deletions

View File

@ -11,6 +11,9 @@
#include "tsuite_file_data.h" #include "tsuite_file_data.h"
#define LDIFF(x) "<b><color=#F0F>"#x"</color></b>"
#define RDIFF(x) "<b><color=#0FF>"#x"</color></b>"
typedef enum typedef enum
{ {
EX_SCENARIO, EX_SCENARIO,
@ -344,11 +347,11 @@ _scn_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
Tsuite_Event_Type t1 = v1 ? tsuite_event_mapping_type_get(v1->t.type) : TSUITE_EVENT_NOT_SUPPORTED; Tsuite_Event_Type t1 = v1 ? tsuite_event_mapping_type_get(v1->t.type) : TSUITE_EVENT_NOT_SUPPORTED;
Tsuite_Event_Type t2 = v2 ? tsuite_event_mapping_type_get(v2->t.type) : TSUITE_EVENT_NOT_SUPPORTED; Tsuite_Event_Type t2 = v2 ? tsuite_event_mapping_type_get(v2->t.type) : TSUITE_EVENT_NOT_SUPPORTED;
if (tm1 != tm2) eina_strbuf_append_printf(buf, "[%.3f/%.3f]: ", tm1/1000.0, tm2/1000.0); if (tm1 != tm2) eina_strbuf_append_printf(buf, "["LDIFF(%.3f)"/"RDIFF(%.3f)"]: ", tm1/1000.0, tm2/1000.0);
else eina_strbuf_append_printf(buf, "%.3f: ", tm1 / 1000.0); else eina_strbuf_append_printf(buf, "%.3f: ", tm1 / 1000.0);
if (t1 != t2) if (t1 != t2)
eina_strbuf_append_printf(buf, "[%s/%s] - XXXXXX", _event_name_get(v1), _event_name_get(v2)); eina_strbuf_append_printf(buf, "["LDIFF(%s)"/"RDIFF(%s)"] - XXXXXX", _event_name_get(v1), _event_name_get(v2));
else else
{ {
char params1[1024]; char params1[1024];
@ -360,7 +363,7 @@ _scn_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
if (*params1 || *params2) if (*params1 || *params2)
{ {
if (strcmp(params1, params2)) if (strcmp(params1, params2))
eina_strbuf_append_printf(buf, " - [%s/%s]", params1, params2); eina_strbuf_append_printf(buf, " - ["LDIFF(%s)"/"RDIFF(%s)"]", params1, params2);
else else
eina_strbuf_append_printf(buf, " - %s", params1); eina_strbuf_append_printf(buf, " - %s", params1);
} }
@ -433,7 +436,7 @@ _obj_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
Exactness_Object *e_obj1 = vv->p1; Exactness_Object *e_obj1 = vv->p1;
Exactness_Object *e_obj2 = vv->p2; Exactness_Object *e_obj2 = vv->p2;
if ((!e_obj1 ^ !e_obj2) || strcmp(e_obj1->kl_name, e_obj2->kl_name)) if ((!e_obj1 ^ !e_obj2) || strcmp(e_obj1->kl_name, e_obj2->kl_name))
eina_strbuf_append_printf(buf, "(%s/%s)", eina_strbuf_append_printf(buf, "("LDIFF(%s)"/"RDIFF(%s)")",
e_obj1 ? e_obj1->kl_name : "XXXXX", e_obj1 ? e_obj1->kl_name : "XXXXX",
e_obj2 ? e_obj2->kl_name : "XXXXX"); e_obj2 ? e_obj2->kl_name : "XXXXX");
else else
@ -441,7 +444,7 @@ _obj_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
eina_strbuf_append(buf, " x = "); eina_strbuf_append(buf, " x = ");
if ((!e_obj1 ^ !e_obj2) || e_obj1->x != e_obj2->x) if ((!e_obj1 ^ !e_obj2) || e_obj1->x != e_obj2->x)
eina_strbuf_append_printf(buf, "%d/%d", eina_strbuf_append_printf(buf, LDIFF(%d)"/"RDIFF(%d),
e_obj1 ? e_obj1->x : -1, e_obj1 ? e_obj1->x : -1,
e_obj2 ? e_obj2->x : -1); e_obj2 ? e_obj2->x : -1);
else else
@ -449,7 +452,7 @@ _obj_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
eina_strbuf_append(buf, " y = "); eina_strbuf_append(buf, " y = ");
if ((!e_obj1 ^ !e_obj2) || e_obj1->y != e_obj2->y) if ((!e_obj1 ^ !e_obj2) || e_obj1->y != e_obj2->y)
eina_strbuf_append_printf(buf, "%d/%d", eina_strbuf_append_printf(buf, LDIFF(%d)"/"RDIFF(%d),
e_obj1 ? e_obj1->y : -1, e_obj1 ? e_obj1->y : -1,
e_obj2 ? e_obj2->y : -1); e_obj2 ? e_obj2->y : -1);
else else
@ -457,7 +460,7 @@ _obj_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
eina_strbuf_append(buf, " w = "); eina_strbuf_append(buf, " w = ");
if ((!e_obj1 ^ !e_obj2) || e_obj1->w != e_obj2->w) if ((!e_obj1 ^ !e_obj2) || e_obj1->w != e_obj2->w)
eina_strbuf_append_printf(buf, "%d/%d", eina_strbuf_append_printf(buf, LDIFF(%d)"/"RDIFF(%d),
e_obj1 ? e_obj1->w : -1, e_obj1 ? e_obj1->w : -1,
e_obj2 ? e_obj2->w : -1); e_obj2 ? e_obj2->w : -1);
else else
@ -465,7 +468,7 @@ _obj_text_get(void *data, Evas_Object *gl, const char *part EINA_UNUSED)
eina_strbuf_append(buf, " h = "); eina_strbuf_append(buf, " h = ");
if ((!e_obj1 ^ !e_obj2) || e_obj1->h != e_obj2->h) if ((!e_obj1 ^ !e_obj2) || e_obj1->h != e_obj2->h)
eina_strbuf_append_printf(buf, "%d/%d", eina_strbuf_append_printf(buf, LDIFF(%d)"/"RDIFF(%d),
e_obj1 ? e_obj1->h : -1, e_obj1 ? e_obj1->h : -1,
e_obj2 ? e_obj2->h : -1); e_obj2 ? e_obj2->h : -1);
else else
@ -501,7 +504,7 @@ _itc_init()
if (!_scn_itc) if (!_scn_itc)
{ {
_scn_itc = elm_genlist_item_class_new(); _scn_itc = elm_genlist_item_class_new();
_scn_itc->item_style = "default"; _scn_itc->item_style = "default_style";
_scn_itc->func.text_get = _scn_text_get; _scn_itc->func.text_get = _scn_text_get;
} }
@ -515,14 +518,14 @@ _itc_init()
if (!_objs_itc) if (!_objs_itc)
{ {
_objs_itc = elm_genlist_item_class_new(); _objs_itc = elm_genlist_item_class_new();
_objs_itc->item_style = "default"; _objs_itc->item_style = "default_style";
_objs_itc->func.text_get = _objs_text_get; _objs_itc->func.text_get = _objs_text_get;
} }
if (!_obj_itc) if (!_obj_itc)
{ {
_obj_itc = elm_genlist_item_class_new(); _obj_itc = elm_genlist_item_class_new();
_obj_itc->item_style = "default"; _obj_itc->item_style = "default_style";
_obj_itc->func.text_get = _obj_text_get; _obj_itc->func.text_get = _obj_text_get;
} }
} }