[pango/tests-and-fixes: 3/7] tests: Add more glyph item iter tests




commit a83a9a76cf42a8fc7ada3d38cf214f0929c00ec8
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 7 00:09:01 2021 -0400

    tests: Add more glyph item iter tests

 tests/testiter.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/tests/testiter.c b/tests/testiter.c
index 653c4bec..c948c29f 100644
--- a/tests/testiter.c
+++ b/tests/testiter.c
@@ -278,7 +278,7 @@ test_glyphitem_iter (void)
     {
       PangoGlyphItemIter iter;
       gboolean have_cluster;
-
+      PangoGlyphItemIter *iter2;
 
       for (have_cluster = direction ?
             pango_glyph_item_iter_init_start (&iter, run, text) :
@@ -289,9 +289,18 @@ test_glyphitem_iter (void)
             pango_glyph_item_iter_prev_cluster (&iter))
       {
         verbose ("start index %d end index %d\n", iter.start_index, iter.end_index);
-        g_assert (iter.start_index < iter.end_index);
-        g_assert (iter.start_index + 2 >= iter.end_index);
-        g_assert (iter.start_char + 1 == iter.end_char);
+        g_assert_true (iter.start_index < iter.end_index);
+        g_assert_true (iter.start_index + 2 >= iter.end_index);
+        g_assert_true (iter.start_char + 1 == iter.end_char);
+
+        iter2 = pango_glyph_item_iter_copy (&iter);
+        g_assert_true (iter2->start_glyph == iter.start_glyph);
+        g_assert_true (iter2->start_index == iter.start_index);
+        g_assert_true (iter2->start_char == iter.start_char);
+        g_assert_true (iter2->end_glyph == iter.end_glyph);
+        g_assert_true (iter2->end_index == iter.end_index);
+        g_assert_true (iter2->end_char == iter.end_char);
+        pango_glyph_item_iter_free (iter2);
       }
     }
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]