[pango/font-face-fixes: 1/2] tests: Don't assert too much




commit 7e799b36560e7cc548c3cc61f9704e7832b8a656
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 23 12:19:53 2021 -0500

    tests: Don't assert too much
    
    We can't guarantee uniqueness of face names, so we
    don't know that getting a face by name will return
    the same face we got the name from (which is true if
    faces are unique). So, just assert that we get a
    face with the same name.
    
    Fixes: #494

 tests/test-font.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-font.c b/tests/test-font.c
index d02c7932..963f05f0 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -197,7 +197,7 @@ test_enumerate (void)
   int n_families;
   int i;
   PangoFontFace **faces;
-  PangoFontFace *face;
+  PangoFontFace *face, *face2;
   int n_faces;
   PangoFontDescription *desc;
   PangoFont *font;
@@ -220,7 +220,7 @@ test_enumerate (void)
   for (i = 0; i < n_faces; i++)
     {
       face = pango_font_family_get_face (families[0], pango_font_face_get_face_name (faces[i]));
-      g_assert_true (face == faces[i]);
+      g_assert_cmpstr (pango_font_face_get_face_name (face), ==, pango_font_face_get_face_name (faces[i]));
     }
 
   desc = pango_font_description_new ();


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