[pango/more-test-coverage2: 14/15] tests: Add some more script iter tests




commit 3bdec75f8c3291f7888cf7814551826e82927127
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 6 17:59:57 2021 -0400

    tests: Add some more script iter tests

 tests/testscript.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/tests/testscript.c b/tests/testscript.c
index 33e8ad2e..7260dbbe 100644
--- a/tests/testscript.c
+++ b/tests/testscript.c
@@ -143,6 +143,7 @@ test_script_iter (void)
   };
 
   PangoScriptIter *iter;
+  PangoScriptIter *iter2;
   GString *all = g_string_new (FALSE);
   char *pos;
   const char *start;
@@ -158,6 +159,8 @@ test_script_iter (void)
 
   iter = pango_script_iter_new (all->str, -1);
 
+  iter2 = g_boxed_copy (pango_script_iter_get_type (), iter);
+
   g_test_message ("Total length: %" G_GSIZE_FORMAT "\n", all->len);
 
   pos = all->str;
@@ -183,6 +186,13 @@ test_script_iter (void)
       pos = next_pos;
     }
 
+  /* Check that copying the iter worked */
+  pango_script_iter_get_range (iter2, &start, &end, &script);
+  g_assert_true (start == all->str);
+  g_assert_true (end == all->str + strlen (test_data[0].run_text));
+  g_assert_true (script == test_data[0].run_code);
+  pango_script_iter_free (iter2);
+
   pango_script_iter_free (iter);
 
   /*


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