diff options
Diffstat (limited to 'libraries/evas/src/tests/evas_test_textblock.c')
-rw-r--r-- | libraries/evas/src/tests/evas_test_textblock.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libraries/evas/src/tests/evas_test_textblock.c b/libraries/evas/src/tests/evas_test_textblock.c index cf6a78b..983a2fc 100644 --- a/libraries/evas/src/tests/evas_test_textblock.c +++ b/libraries/evas/src/tests/evas_test_textblock.c | |||
@@ -1283,6 +1283,15 @@ START_TEST(evas_textblock_various) | |||
1283 | evas_object_textblock_text_markup_set(tb, "a<ps/>a<ps/>a"); | 1283 | evas_object_textblock_text_markup_set(tb, "a<ps/>a<ps/>a"); |
1284 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1284 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1285 | 1285 | ||
1286 | /* These shouldn't crash (although the desired outcome is not yet defined) */ | ||
1287 | evas_object_textblock_text_markup_set(tb, ""); | ||
1288 | evas_textblock_cursor_pos_set(cur, 0); | ||
1289 | evas_textblock_cursor_char_delete(cur); | ||
1290 | |||
1291 | evas_object_textblock_text_markup_set(tb, "\xEF\xBF\xBC"); | ||
1292 | evas_textblock_cursor_pos_set(cur, 0); | ||
1293 | evas_textblock_cursor_char_delete(cur); | ||
1294 | |||
1286 | END_TB_TEST(); | 1295 | END_TB_TEST(); |
1287 | } | 1296 | } |
1288 | END_TEST | 1297 | END_TEST |
@@ -2090,6 +2099,29 @@ START_TEST(evas_textblock_size) | |||
2090 | fail_if((w != nw) || (h != nh)); | 2099 | fail_if((w != nw) || (h != nh)); |
2091 | fail_if(w <= 0); | 2100 | fail_if(w <= 0); |
2092 | 2101 | ||
2102 | /* This time with margins. */ | ||
2103 | { | ||
2104 | Evas_Textblock_Style *newst; | ||
2105 | Evas_Coord oldw, oldh, oldnw, oldnh; | ||
2106 | |||
2107 | evas_object_textblock_text_markup_set(tb, buf); | ||
2108 | evas_object_textblock_size_formatted_get(tb, &oldw, &oldh); | ||
2109 | evas_object_textblock_size_native_get(tb, &oldnw, &oldnh); | ||
2110 | |||
2111 | |||
2112 | newst = evas_textblock_style_new(); | ||
2113 | fail_if(!newst); | ||
2114 | evas_textblock_style_set(newst, | ||
2115 | "DEFAULT='left_margin=4 right_margin=4'"); | ||
2116 | evas_object_textblock_style_user_push(tb, newst); | ||
2117 | |||
2118 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
2119 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
2120 | |||
2121 | fail_if((w != oldw + 8) || (h != oldh) || | ||
2122 | (nw != oldnw + 8) || (nh != oldnh)); | ||
2123 | } | ||
2124 | |||
2093 | /* FIXME: There is a lot more to be done. */ | 2125 | /* FIXME: There is a lot more to be done. */ |
2094 | END_TB_TEST(); | 2126 | END_TB_TEST(); |
2095 | } | 2127 | } |