[pango] tests: Cover new tab alignments



commit 650eb63d4191b1149c1365a1f167437a6a974f4f
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 10 18:15:51 2021 -0500

    tests: Cover new tab alignments

 tests/testtabs.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/tests/testtabs.c b/tests/testtabs.c
index 2a62f1d6..fb16cf7f 100644
--- a/tests/testtabs.c
+++ b/tests/testtabs.c
@@ -78,18 +78,26 @@ test_tabs_resize (void)
 
   pango_tab_array_set_tab (tabs, 0, PANGO_TAB_LEFT, 10);
 
-  g_assert_true (pango_tab_array_get_size (tabs) == 1);
+  g_assert_cmpint (pango_tab_array_get_size (tabs), ==, 1);
 
   pango_tab_array_resize (tabs, 2);
-  g_assert_true (pango_tab_array_get_size (tabs) == 2);
+  g_assert_cmpint (pango_tab_array_get_size (tabs), ==, 2);
+
+  pango_tab_array_set_tab (tabs, 1, PANGO_TAB_RIGHT, 20);
+  pango_tab_array_set_tab (tabs, 2, PANGO_TAB_CENTER, 30);
+  pango_tab_array_set_tab (tabs, 3, PANGO_TAB_DECIMAL, 40);
 
-  pango_tab_array_set_tab (tabs, 1, PANGO_TAB_LEFT, 20);
+  g_assert_cmpint (pango_tab_array_get_size (tabs), ==, 4);
 
   pango_tab_array_get_tabs (tabs, &alignments, &locations);
-  g_assert_true (alignments[0] == PANGO_TAB_LEFT);
-  g_assert_true (alignments[1] == PANGO_TAB_LEFT);
-  g_assert_true (locations[0] == 10);
-  g_assert_true (locations[1] == 20);
+  g_assert_cmpint (alignments[0], ==, PANGO_TAB_LEFT);
+  g_assert_cmpint (alignments[1], ==, PANGO_TAB_RIGHT);
+  g_assert_cmpint (alignments[2], ==, PANGO_TAB_CENTER);
+  g_assert_cmpint (alignments[3], ==, PANGO_TAB_DECIMAL);
+  g_assert_cmpint (locations[0], ==, 10);
+  g_assert_cmpint (locations[1], ==, 20);
+  g_assert_cmpint (locations[2], ==, 30);
+  g_assert_cmpint (locations[3], ==, 40);
 
   g_free (alignments);
   g_free (locations);


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