Evas textblock: fixing tests to work w/ or w/o harfbuzz
authorYakov Goldberg <yakov.g@samsung.com>
Wed, 10 Apr 2013 06:48:55 +0000 (09:48 +0300)
committerYakov Goldberg <yakov.g@samsung.com>
Wed, 10 Apr 2013 11:43:35 +0000 (14:43 +0300)
    In this test harfbuzz creates ligatures,
    so need to handle cases w/ or w/o harfbuzz

Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
src/tests/evas/evas_test_textblock.c

index 2e99cc7..ed16077 100644 (file)
@@ -608,6 +608,7 @@ START_TEST(evas_textblock_cursor)
      {
         evas_object_textblock_text_markup_set(tb, "fi<br/>fii");
 
+#ifdef HAVE_HARFBUZZ
         for (i = 0 ; i < 2 ; i++)
           {
              evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
@@ -623,6 +624,24 @@ START_TEST(evas_textblock_cursor)
              ck_assert_int_eq(w, 3);
              evas_textblock_cursor_char_next(cur);
           }
+#else
+        evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
+        ck_assert_int_eq(w, 4);
+        evas_textblock_cursor_char_next(cur);
+        evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
+        ck_assert_int_eq(w, 3);
+
+        evas_textblock_cursor_pos_set(cur, 3);
+        evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
+        ck_assert_int_eq(w, 4);
+
+        for (i = 0 ; i < 2 ; i++)
+          {
+             evas_textblock_cursor_char_next(cur);
+             evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
+             ck_assert_int_eq(w, 3);
+          }
+#endif
      }
 
    END_TB_TEST();