aboutsummaryrefslogtreecommitdiffstats
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)
downloadefl-039b3da078c578837cf40aab4edefdad05247e7b.tar.gz
efl-039b3da078c578837cf40aab4edefdad05247e7b.tar.xz
efl-039b3da078c578837cf40aab4edefdad05247e7b.zip
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 dc72a592f..861849f9d 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)
}
END_TEST
+START_TEST(evas_text_ellipsis)
+{
+ START_TEXT_TEST();
+ const char *buf = "נסיון בלה בלה בלה בלה";
+ const char *font = TEST_FONT_NAME;
+ Evas_Font_Size size = 14;
+
+ evas_object_text_ellipsis_set(to, 0.0);
+ evas_object_move(to, 0, 0);
+ evas_object_resize(to, 500, 500);
+ evas_object_text_font_set(to, font, size);
+ evas_object_text_text_set(to, buf);
+
+ /* Make it smaller to force ellipsis and check the resulting size. */
+ {
+ Evas_Coord w, h;
+ evas_object_geometry_get(to, NULL, NULL, NULL, &h);
+ evas_object_resize(to, 140, h);
+
+ /* Because of the way text object behaves, this will actually force
+ * a resize. */
+ evas_object_geometry_get(to, NULL, NULL, &w, NULL);
+ /* If it's gotten way too small, it means we have an issue. */
+ fail_if(w < 100);
+ }
+
+
+ END_TEXT_TEST();
+}
+END_TEST
+
/* Tests for functions that are in evas_object_text.c but
* don't really have anything to do with it. */
START_TEST(evas_text_unrelated)
@@ -497,6 +528,7 @@ void evas_test_text(TCase *tc)
tcase_add_test(tc, evas_text_set_get);
tcase_add_test(tc, evas_text_geometries);
tcase_add_test(tc, evas_text_evas);
+ tcase_add_test(tc, evas_text_ellipsis);
#ifdef HAVE_FRIBIDI
tcase_add_test(tc, evas_text_bidi);
#endif