summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-02-25 15:22:04 +0000
committerTom Hacohen <tom@stosb.com>2013-02-25 15:22:04 +0000
commit039b3da078c578837cf40aab4edefdad05247e7b (patch)
tree334e2efb4ee80738c5ff62178a074ace73875a63
parent9696f44a67bba5a00b244d3e1070f27ce8676069 (diff)
Evas text: Added a test that shows how broken ellipsis is.
-rw-r--r--src/tests/evas/evas_test_text.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c
index dc72a592f6..861849f9d5 100644
--- a/src/tests/evas/evas_test_text.c
+++ b/src/tests/evas/evas_test_text.c
@@ -166,6 +166,37 @@ START_TEST(evas_text_evas)
166} 166}
167END_TEST 167END_TEST
168 168
169START_TEST(evas_text_ellipsis)
170{
171 START_TEXT_TEST();
172 const char *buf = "נסיון בלה בלה בלה בלה";
173 const char *font = TEST_FONT_NAME;
174 Evas_Font_Size size = 14;
175
176 evas_object_text_ellipsis_set(to, 0.0);
177 evas_object_move(to, 0, 0);
178 evas_object_resize(to, 500, 500);
179 evas_object_text_font_set(to, font, size);
180 evas_object_text_text_set(to, buf);
181
182 /* Make it smaller to force ellipsis and check the resulting size. */
183 {
184 Evas_Coord w, h;
185 evas_object_geometry_get(to, NULL, NULL, NULL, &h);
186 evas_object_resize(to, 140, h);
187
188 /* Because of the way text object behaves, this will actually force
189 * a resize. */
190 evas_object_geometry_get(to, NULL, NULL, &w, NULL);
191 /* If it's gotten way too small, it means we have an issue. */
192 fail_if(w < 100);
193 }
194
195
196 END_TEXT_TEST();
197}
198END_TEST
199
169/* Tests for functions that are in evas_object_text.c but 200/* Tests for functions that are in evas_object_text.c but
170 * don't really have anything to do with it. */ 201 * don't really have anything to do with it. */
171START_TEST(evas_text_unrelated) 202START_TEST(evas_text_unrelated)
@@ -497,6 +528,7 @@ void evas_test_text(TCase *tc)
497 tcase_add_test(tc, evas_text_set_get); 528 tcase_add_test(tc, evas_text_set_get);
498 tcase_add_test(tc, evas_text_geometries); 529 tcase_add_test(tc, evas_text_geometries);
499 tcase_add_test(tc, evas_text_evas); 530 tcase_add_test(tc, evas_text_evas);
531 tcase_add_test(tc, evas_text_ellipsis);
500#ifdef HAVE_FRIBIDI 532#ifdef HAVE_FRIBIDI
501 tcase_add_test(tc, evas_text_bidi); 533 tcase_add_test(tc, evas_text_bidi);
502#endif 534#endif