summaryrefslogtreecommitdiff
path: root/tests/testiter.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-07 00:09:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-07 00:09:01 -0400
commita83a9a76cf42a8fc7ada3d38cf214f0929c00ec8 (patch)
tree8a8d2412d3dc831de79315de1d70558c6c3aa73a /tests/testiter.c
parent4ab74a2914b19c5f202c221c391ec64d0254633c (diff)
downloadpango-a83a9a76cf42a8fc7ada3d38cf214f0929c00ec8.tar.gz
tests: Add more glyph item iter tests
Diffstat (limited to 'tests/testiter.c')
-rw-r--r--tests/testiter.c17
1 files 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);
}
}
}