summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-30 15:04:56 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-30 15:04:56 +0100
commitdcabda41558bf80724992d3973388af6974af5eb (patch)
tree24fed07b4bfdb41c66c029fb21e6f4e262ca147c /src/shared
parent132bdb0cf8eff3eba3092962b6d36e6c3e75da14 (diff)
parentc542f805ddc3ae28007c15827ef2e8a8247452bc (diff)
Merge pull request #2469 from keszybz/resolved-2
Resolved 2
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/test-tables.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/shared/test-tables.h b/src/shared/test-tables.h
index 74f1716fe0..228e510104 100644
--- a/src/shared/test-tables.h
+++ b/src/shared/test-tables.h
@@ -28,18 +28,25 @@ static inline void _test_table(const char *name,
reverse_t reverse,
int size,
bool sparse) {
- int i;
+ int i, boring = 0;
for (i = -1; i < size + 1; i++) {
const char* val = lookup(i);
int rev;
- if (val)
+ if (val) {
rev = reverse(val);
- else
+ boring = 0;
+ } else {
rev = reverse("--no-such--value----");
+ boring += i >= 0;
+ }
+
+ if (boring < 1 || i == size)
+ printf("%s: %d → %s → %d\n", name, i, val, rev);
+ else if (boring == 1)
+ printf("%*s ...\n", (int) strlen(name), "");
- printf("%s: %d → %s → %d\n", name, i, val, rev);
assert_se(!(i >= 0 && i < size ?
sparse ? rev != i && rev != -1 : val == NULL || rev != i :
val != NULL || rev != -1));