Evas tests: Added last_up_to_pos tests to text object.

SVN revision: 61326
This commit is contained in:
Tom Hacohen 2011-07-13 08:54:17 +00:00
parent 5d21b6699b
commit 9f2e58e6f0
1 changed files with 16 additions and 1 deletions

View File

@ -364,7 +364,22 @@ START_TEST(evas_text_bidi)
y + (h / 2), &x, &y, &w, &h));
}
/* FIXME: Add tests that check visual position */
/* And some last up to pos tests */
Evas_Coord adv;
int pos, prev_pos;
adv = evas_object_text_horiz_advance_get(to);
evas_object_text_text_set(to, "Test - נסיון...");
pos = prev_pos = 0;
for (x = 0 ; x <= (adv - 1) ; x++)
{
pos = evas_object_text_last_up_to_pos(to, x, 0);
fail_if(pos < prev_pos);
prev_pos = pos;
}
pos = evas_object_text_last_up_to_pos(to, x, 0);
fail_if(pos != -1);
pos = evas_object_text_last_up_to_pos(to, -50, 0);
fail_if(pos != -1);
END_TEXT_TEST();
}