summaryrefslogtreecommitdiff
path: root/src/shared/test-tables.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-01-18 17:31:32 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-10 14:43:10 +0100
commit3c3cd61e75edf4e324c1d342842cab88dd7330cc (patch)
treee11a67f71fc963124b2ccf9e3c3419a7f100cfc4 /src/shared/test-tables.h
parentb357fe57b2b35f62572f99515a0666954281b49f (diff)
downloadsystemd-3c3cd61e75edf4e324c1d342842cab88dd7330cc.tar.gz
test-tables: make the assert more readable
Doing it all in one line and with negation in front seemed like a good idea at some point, but I think it is vastly easier to understand when it is split out a bit.
Diffstat (limited to 'src/shared/test-tables.h')
-rw-r--r--src/shared/test-tables.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/shared/test-tables.h b/src/shared/test-tables.h
index 120dc7f2e9..e68ec60497 100644
--- a/src/shared/test-tables.h
+++ b/src/shared/test-tables.h
@@ -31,9 +31,13 @@ static inline void _test_table(const char *name,
else if (boring == 1)
printf("%*s ...\n", (int) strlen(name), "");
- assert_se(!(i >= 0 && i < size ?
- sparse ? rev != i && rev != -1 : val == NULL || rev != i :
- val != NULL || rev != -1));
+ if (i >= 0 && i < size) {
+ if (sparse)
+ assert_se(rev == i || rev == -1);
+ else
+ assert_se(val != NULL && rev == i);
+ } else
+ assert_se(val == NULL && rev == -1);
}
}