[pango/line-breaking-fixes: 19/21] testrandom: Use --verbose
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/line-breaking-fixes: 19/21] testrandom: Use --verbose
- Date: Sat, 13 Nov 2021 02:42:16 +0000 (UTC)
commit cd030f5f56724576d747a1cf4126cb08df6c6876
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Nov 12 21:02:59 2021 -0500
testrandom: Use --verbose
Only spew test data if --verbose is given.
tests/testrandom.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/tests/testrandom.c b/tests/testrandom.c
index ce4d343d..a7716b1b 100644
--- a/tests/testrandom.c
+++ b/tests/testrandom.c
@@ -115,7 +115,8 @@ test_wrap_char (gconstpointer data)
{
sentence = create_random_sentence (dir);
pango_layout_set_text (layout, sentence, -1);
- g_print ("%s\n", sentence);
+ if (g_test_verbose ())
+ g_print ("%s\n", sentence);
g_free (sentence);
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
@@ -143,7 +144,17 @@ test_wrap_char (gconstpointer data)
continue;
g_assert_cmpint (sizes[i-1].set_width, <=, sizes[i].set_width);
+
g_assert_cmpint (sizes[i].width, <=, sizes[i].set_width);
+
+ if (g_test_verbose ())
+ {
+ if (sizes[i-1].width > sizes[i].width)
+ {
+ g_print ("min %d\n", min.width);
+ g_print ("%d %d\n", sizes[i-1].set_width, sizes[i].set_width);
+ }
+ }
g_assert_cmpint (sizes[i-1].width, <=, sizes[i].width);
g_assert_cmpint (sizes[i-1].height, >=, sizes[i].height);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]