[pango/wip/baedert/for-master2] testattributes: Test iter on empty attr list



commit cc3d06b60c507ee1c75cd9c3677377cd30df0e44
Author: Timm Bäder <mail baedert org>
Date:   Fri Apr 17 19:37:23 2020 +0200

    testattributes: Test iter on empty attr list

 tests/testattributes.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/tests/testattributes.c b/tests/testattributes.c
index eaca6663..6b5e849b 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -358,6 +358,15 @@ test_iter (void)
   PangoAttrIterator *copy;
   gint start, end;
 
+  /* Empty list */
+  list = pango_attr_list_new ();
+  iter = pango_attr_list_get_iterator (list);
+
+  g_assert_false (pango_attr_iterator_next (iter));
+  g_assert_null (pango_attr_iterator_get_attrs (iter));
+  pango_attr_iterator_destroy (iter);
+  pango_attr_list_unref (list);
+
   list = pango_attr_list_new ();
   attr = pango_attr_size_new (10);
   pango_attr_list_insert (list, attr);


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