Evas textblock tests: Fix a broken test and add another test.

The test was running without a text being set.
The added test runs with an empty textblock.
This commit is contained in:
Tom Hacohen 2013-08-19 17:57:37 +01:00
parent ec573948b0
commit 92a6d2e2d2
1 changed files with 10 additions and 2 deletions

View File

@ -2608,15 +2608,23 @@ START_TEST(evas_textblock_size)
START_TB_TEST();
Evas_Coord w, h, h2, nw, nh;
const char *buf = "This is a <br/> test.<br/>גם בעברית";
/* When wrapping is off, native size should be the same as formatted
* size */
/* Empty textblock */
evas_object_textblock_size_formatted_get(tb, &w, &h);
evas_object_textblock_size_native_get(tb, &nw, &nh);
ck_assert_int_eq(w, nw);
ck_assert_int_eq(h, nh);
fail_if(w != 0);
/* When wrapping is off, native size should be the same as formatted
* size */
evas_object_textblock_text_markup_set(tb, buf);
evas_object_textblock_size_formatted_get(tb, &w, &h);
evas_object_textblock_size_native_get(tb, &nw, &nh);
ck_assert_int_eq(w, nw);
ck_assert_int_eq(h, nh);
evas_object_textblock_text_markup_set(tb, "a<br/>a");
evas_object_textblock_size_formatted_get(tb, &w, &h2);
evas_object_textblock_size_native_get(tb, &nw, &nh);