Evas textblock: fix split cursor tests; FIXME ligatures tests
- re-enabling split BiDi cursor tests, disabled in 0d68ffbe; ligatures tests are still disabled; - change "fail_if" to "ck_assert_int_*", because it prints error message with values; - fixing usage of embedding LTR/RTL codes in tests; Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
This commit is contained in:
parent
8d7fdf94ed
commit
0389d46014
|
@ -618,12 +618,14 @@ START_TEST(evas_textblock_cursor)
|
|||
|
||||
evas_textblock_cursor_char_next(cur);
|
||||
|
||||
for (i = 0 ; i < 3 ; i++)
|
||||
for (i = 0 ; i < 2 ; i++)
|
||||
{
|
||||
evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
|
||||
ck_assert_int_eq(w, 3);
|
||||
evas_textblock_cursor_char_next(cur);
|
||||
}
|
||||
evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
|
||||
ck_assert_int_eq(w, 3);
|
||||
#else
|
||||
/* FIXME: Disabled because fails on jenkins */
|
||||
#if 0
|
||||
|
@ -651,66 +653,67 @@ START_TEST(evas_textblock_cursor)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
/* FIXME: Disabled because fails on jenkins */
|
||||
#if 0
|
||||
#ifdef HAVE_FRIBIDI
|
||||
START_TEST(evas_textblock_split_cursor)
|
||||
{
|
||||
#ifdef HAVE_FRIBIDI
|
||||
START_TB_TEST();
|
||||
Evas_Coord x, w, x2, w2;
|
||||
Evas_Coord nw, nh;
|
||||
Evas_Coord cx, cy, cx2, cy2;
|
||||
|
||||
/* Split cursor in LTR paragraph. */
|
||||
/*0123456789 10 123 14 5678901234 */
|
||||
evas_object_textblock_text_markup_set(tb, "test נסיון\u202babc\u202cנסיון bang");
|
||||
/* Split cursor in LTR paragraph.
|
||||
* Russian 't' in the beginnning to create additional item.*/
|
||||
/*01234 5 6789012345678 19 01234 */
|
||||
evas_object_textblock_text_markup_set(tb, "тest \u202bנסיוןabcנסיון\u202c bang");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
evas_object_resize(tb, nw, nh);
|
||||
|
||||
/* Logical cursor after "test " */
|
||||
evas_textblock_cursor_pos_set(cur, 5);
|
||||
evas_textblock_cursor_pos_set(cur, 6);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 4);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 5);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
|
||||
/* Logical cursor before " bang" */
|
||||
evas_textblock_cursor_pos_set(cur, 20);
|
||||
evas_textblock_cursor_pos_set(cur, 18);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 19);
|
||||
evas_textblock_cursor_pos_set(cur, 20);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
fail_if(cx2 != x2);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor before "a" */
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 9);
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 10);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
fail_if(cx2 != x2);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor after "c" */
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 14);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 13);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
evas_textblock_cursor_pos_set(cur, 10);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor before " bang" */
|
||||
evas_textblock_cursor_pos_set(cur, 20);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 19);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor in the beginning */
|
||||
evas_textblock_cursor_line_char_first(cur);
|
||||
|
@ -718,80 +721,77 @@ START_TEST(evas_textblock_split_cursor)
|
|||
NULL, NULL, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
|
||||
/* Logical cursor in the end */
|
||||
evas_textblock_cursor_line_char_last(cur);
|
||||
fail_if(evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 24);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx, x);
|
||||
|
||||
/* Logical cursor on the first pos */
|
||||
evas_textblock_cursor_pos_set(cur, 1);
|
||||
/* Logical cursor on the second pos */
|
||||
evas_textblock_cursor_pos_set(cur, 2);
|
||||
fail_if(evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
|
||||
/* Split cursor in RTL paragraph. */
|
||||
/* 1 2
|
||||
0123456789 0 12345 6 7890123456 */
|
||||
evas_object_textblock_text_markup_set(tb, "שלום test \u202aעברית\u202c efl נסיון");
|
||||
/* 1 2
|
||||
01234 5 67890123456789 0 123456 */
|
||||
evas_object_textblock_text_markup_set(tb, "שלום \u202atest עברית efl\u202c נסיון");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
evas_object_resize(tb, nw, nh);
|
||||
|
||||
/* Logical cursor before "test" */
|
||||
evas_textblock_cursor_pos_set(cur, 6);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 4);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 5);
|
||||
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 5);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 6);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
fail_if(cx2 != x2);
|
||||
|
||||
/* Logical cursor after " efl" */
|
||||
evas_textblock_cursor_pos_set(cur, 21);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 20);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
|
||||
/* Logical cursor before " efl" */
|
||||
evas_textblock_cursor_pos_set(cur, 17);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
fail_if(cx != x2);
|
||||
fail_if(cx2 != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor after "test " */
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 9);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
evas_textblock_cursor_pos_set(cur, 16);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor before " efl" */
|
||||
evas_textblock_cursor_pos_set(cur, 16);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor after " efl" */
|
||||
evas_textblock_cursor_pos_set(cur, 21);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 6);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 4);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Logical cursor in the beginning */
|
||||
evas_textblock_cursor_line_char_first(cur);
|
||||
|
@ -799,7 +799,7 @@ START_TEST(evas_textblock_split_cursor)
|
|||
NULL, NULL, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
ck_assert_int_eq(cx, (x + w));
|
||||
|
||||
/* Logical cursor in the end */
|
||||
evas_textblock_cursor_line_char_last(cur);
|
||||
|
@ -808,16 +808,14 @@ START_TEST(evas_textblock_split_cursor)
|
|||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 26);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
|
||||
/* Corner cases for split cursor. */
|
||||
|
||||
/* End of line in LTR paragraph */
|
||||
/* 1
|
||||
01234567890123 4 567 */
|
||||
evas_object_textblock_text_markup_set(tb, "test נסיוןشسيب\u202babc");
|
||||
evas_textblock_cursor_line_char_last(cur);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
/* End of line in LTR paragraph with embedding*/
|
||||
/* 1
|
||||
01234 5 678901234567 */
|
||||
evas_object_textblock_text_markup_set(tb, "test \u202bנסיוןشسيبabc");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
evas_object_resize(tb, nw, nh);
|
||||
|
||||
|
@ -825,17 +823,17 @@ START_TEST(evas_textblock_split_cursor)
|
|||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, &cx2, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 4);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 5);
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 6);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
ck_assert_int_eq(cx, (x + w));
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* End of line in RTL paragraph */
|
||||
/* 1 2
|
||||
0123456789012345678 9 0123 */
|
||||
evas_object_textblock_text_markup_set(tb, "נסיוןشسي testпривет\u202aשלום");
|
||||
/* 1 2
|
||||
012345678 9 01234567890123 */
|
||||
evas_object_textblock_text_markup_set(tb, "נסיוןشسي \u202atestприветשלום");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
evas_object_resize(tb, nw, nh);
|
||||
|
||||
|
@ -845,18 +843,18 @@ START_TEST(evas_textblock_split_cursor)
|
|||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 8);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
evas_textblock_cursor_pos_set(cur, 9);
|
||||
evas_textblock_cursor_pos_set(cur, 10);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
fail_if(cx2 != x2);
|
||||
ck_assert_int_eq(cx, x);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
|
||||
/* Cursor is between items of the same direction */
|
||||
evas_textblock_cursor_pos_set(cur, 13);
|
||||
evas_textblock_cursor_pos_set(cur, 14);
|
||||
fail_if(evas_textblock_cursor_geometry_bidi_get(cur, &cx, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
|
||||
/* Cursor type is UNDER */
|
||||
evas_textblock_cursor_pos_set(cur, 0);
|
||||
|
@ -864,7 +862,7 @@ START_TEST(evas_textblock_split_cursor)
|
|||
NULL, NULL, NULL, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_UNDER));
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
|
||||
/* Multiline */
|
||||
Evas_Coord ly;
|
||||
|
@ -884,14 +882,14 @@ START_TEST(evas_textblock_split_cursor)
|
|||
NULL, &cx2, &cy2, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy != ly);
|
||||
ck_assert_int_eq(cy, ly);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy2 != ly);
|
||||
ck_assert_int_eq(cy2, ly);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
fail_if(cx2 != x2);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
}
|
||||
/* 01234567890123456789 */
|
||||
evas_object_textblock_text_markup_set(tb, "<wrap=char>נסיוןhelloприветשלום");
|
||||
|
@ -902,27 +900,25 @@ START_TEST(evas_textblock_split_cursor)
|
|||
for (i = 0; i < nw; i++)
|
||||
{
|
||||
evas_object_resize(tb, i, nh);
|
||||
|
||||
evas_textblock_cursor_pos_set(cur, 16);
|
||||
fail_if(!evas_textblock_cursor_geometry_bidi_get(cur, &cx, &cy, NULL,
|
||||
NULL, &cx2, &cy2, NULL, NULL,
|
||||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy != ly);
|
||||
ck_assert_int_eq(cy, ly);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
ck_assert_int_eq(cx, (x + w));
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy2 != ly);
|
||||
ck_assert_int_eq(cy2, ly);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
ck_assert_int_eq(cx2, (x2 + w2));
|
||||
}
|
||||
|
||||
/* Testing multiline, when only RTL item is in the line. */
|
||||
/* 012345678901234567890123 */
|
||||
evas_object_textblock_text_markup_set(tb, "<wrap=char>testtesttestтестשלוםشسيب");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
nh = nh * 23;
|
||||
evas_object_resize(tb, nw, nh);
|
||||
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
|
@ -936,21 +932,20 @@ START_TEST(evas_textblock_split_cursor)
|
|||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 16);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, &w, NULL);
|
||||
fail_if(cx != (x + w));
|
||||
ck_assert_int_eq(cx, (x + w));
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy != ly);
|
||||
ck_assert_int_eq(cy, ly);
|
||||
|
||||
evas_textblock_cursor_pos_set(cur, 23);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
fail_if(cx2 != x2);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy2 != ly);
|
||||
ck_assert_int_eq(cy2, ly);
|
||||
|
||||
/* Testing multiline, when only LTR item is in the line. */
|
||||
/* 012345678901234567890123 */
|
||||
evas_object_textblock_text_markup_set(tb, "<wrap=char>שלוםשלוםשלוםشسيبtestтест");
|
||||
evas_object_textblock_size_native_get(tb, &nw, &nh);
|
||||
nh = nh * 23;
|
||||
evas_object_resize(tb, nw, nh);
|
||||
|
||||
evas_textblock_cursor_pos_set(cur, 15);
|
||||
|
@ -964,18 +959,17 @@ START_TEST(evas_textblock_split_cursor)
|
|||
EVAS_TEXTBLOCK_CURSOR_BEFORE));
|
||||
evas_textblock_cursor_pos_set(cur, 16);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x, NULL, NULL, NULL);
|
||||
fail_if(cx != x);
|
||||
ck_assert_int_eq(cx, x);
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy != ly);
|
||||
ck_assert_int_eq(cy, ly);
|
||||
|
||||
evas_textblock_cursor_pos_set(cur, 23);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, &w2, NULL);
|
||||
fail_if(cx2 != (x2 + w2));
|
||||
evas_textblock_cursor_line_char_last(cur);
|
||||
evas_textblock_cursor_pen_geometry_get(cur, &x2, NULL, NULL, NULL);
|
||||
ck_assert_int_eq(cx2, x2);
|
||||
evas_textblock_cursor_line_geometry_get(cur, NULL, &ly, NULL, NULL);
|
||||
fail_if(cy2 != ly);
|
||||
ck_assert_int_eq(cy2, ly);
|
||||
|
||||
END_TB_TEST();
|
||||
#endif
|
||||
}
|
||||
END_TEST
|
||||
#endif
|
||||
|
@ -1452,7 +1446,7 @@ START_TEST(evas_textblock_items)
|
|||
fail_if((w >= 93) || (h >= 152));
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &ih);
|
||||
fail_if((w > 90) || (h != ih));
|
||||
fail_if((w > 108) || (h != ih));
|
||||
|
||||
buf = "This is an <item relize=93x152 vsize=ascent></>.";
|
||||
evas_object_textblock_text_markup_set(tb, buf);
|
||||
|
@ -1460,7 +1454,7 @@ START_TEST(evas_textblock_items)
|
|||
fail_if((w >= 93) || (h >= 152));
|
||||
evas_textblock_cursor_pos_set(cur, 11);
|
||||
evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &ih);
|
||||
fail_if((w > 90) || (h <= ih));
|
||||
fail_if((w > 108) || (h <= ih));
|
||||
|
||||
/* Relsize and abs size in the same line, all should be the same size */
|
||||
buf = "<item relsize=64x64 vsize=ascent href=emoticon/knowing-grin></item><item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item><item relsize=64x64 vsize=ascent href=emoticon/knowing-grin></item>";
|
||||
|
@ -2435,7 +2429,7 @@ START_TEST(evas_textblock_style)
|
|||
newst = evas_textblock_style_new();
|
||||
fail_if(!newst);
|
||||
evas_textblock_style_set(newst,
|
||||
"DEFAULT='" TEST_FONT " font_size=20 color=#000 text_class=entry'"
|
||||
"DEFAULT='" TEST_FONT " font_size=50 color=#000 text_class=entry'"
|
||||
"br='\n'"
|
||||
"ps='ps'"
|
||||
"tab='\t'");
|
||||
|
@ -2657,8 +2651,7 @@ void evas_test_textblock(TCase *tc)
|
|||
{
|
||||
tcase_add_test(tc, evas_textblock_simple);
|
||||
tcase_add_test(tc, evas_textblock_cursor);
|
||||
/* FIXME: Disabled because fails on jenkins */
|
||||
#if 0
|
||||
#ifdef HAVE_FRIBIDI
|
||||
tcase_add_test(tc, evas_textblock_split_cursor);
|
||||
#endif
|
||||
tcase_add_test(tc, evas_textblock_size);
|
||||
|
|
Loading…
Reference in New Issue