aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Longo <matthieu.longo@arm.com>2025-08-04 11:04:13 +0100
committerMatthieu Longo <matthieu.longo@arm.com>2025-08-06 15:25:22 +0100
commit0d0837df6973e00c143a04fe652d74e4df856a2e (patch)
tree5625d498bd950ed3c16b17032b488725c14b576b
parent54edbeeaac6eb4865fab37374fbdff3a9a2f2e12 (diff)
downloadgcc-0d0837df6973e00c143a04fe652d74e4df856a2e.zip
gcc-0d0837df6973e00c143a04fe652d74e4df856a2e.tar.gz
gcc-0d0837df6973e00c143a04fe652d74e4df856a2e.tar.bz2
libiberty: disable logging of list content for doubly-linked list tests
When the doubly-linked list tests were introduced, the tests were printing the content of the list forward and backward. However, this printing is not needed outside of debugging, and confuses people because the output is not only composed of PASS: lines. This patch disables the printing of the list content by default. If one wants to re-enable it for debugging, he can set the macro DUMP_LIST to 1. libiberty/ChangeLog: * testsuite/test-doubly-linked-list.c: disable debug logging on stdout.
-rw-r--r--libiberty/testsuite/test-doubly-linked-list.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libiberty/testsuite/test-doubly-linked-list.c b/libiberty/testsuite/test-doubly-linked-list.c
index 1e1fc63..93fe19a 100644
--- a/libiberty/testsuite/test-doubly-linked-list.c
+++ b/libiberty/testsuite/test-doubly-linked-list.c
@@ -155,19 +155,26 @@ bool check(const char *op,
bool success = true;
bool res;
- l_print (wrapper->first);
+#define DUMP_LIST 0
+
+ if (DUMP_LIST)
+ l_print (wrapper->first);
+
res = run_test (expect, wrapper, false);
printf ("%s: test-linked-list::%s: check forward conformity\n",
res ? "PASS": "FAIL", op);
success &= res;
- l_reverse_print (wrapper->last);
+ if (DUMP_LIST)
+ l_reverse_print (wrapper->last);
+
res = run_test (expect, wrapper, true);
printf ("%s: test-linked-list::%s: check backward conformity\n",
res ? "PASS": "FAIL", op);
success &= res;
- printf("\n");
+ if (DUMP_LIST)
+ printf("\n");
return success;
}