diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-26 00:31:11 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-26 08:02:13 -0400 |
commit | 3c834b4297f0d1840e52ff84e023fa0f6de51189 (patch) | |
tree | d8385d24657eff18935454abadd5e83c8ae03447 /tests/test-break.c | |
parent | 653e27a8dc6cb25042d811be7f6d962d50233dbe (diff) | |
download | pango-3c834b4297f0d1840e52ff84e023fa0f6de51189.tar.gz |
Add code to validate log attrs
This is just used in tests for now. If we decide
to make an external log attr api, we can make this
public.
Diffstat (limited to 'tests/test-break.c')
-rw-r--r-- | tests/test-break.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-break.c b/tests/test-break.c index f7fcf6ec..fecca168 100644 --- a/tests/test-break.c +++ b/tests/test-break.c @@ -30,6 +30,7 @@ #include "config.h" #include <pango/pangocairo.h> #include "test-common.h" +#include "validate-log-attrs.h" static PangoContext *context; @@ -95,6 +96,11 @@ test_file (const gchar *filename, GString *string) g_assert_cmpint (len, ==, len2); g_assert_true (memcmp (attrs, attrs2, sizeof (PangoLogAttr) * len) == 0); + if (!pango_validate_log_attrs (text, length, attrs, len, &error)) + { + g_warning ("%s: Log attrs invalid: %s", filename, error->message); + g_assert_not_reached (); + } layout2 = pango_layout_copy (layout); attrs2 = pango_layout_get_log_attrs_readonly (layout2, &len2); |