diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-14 09:12:12 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | ec8402b80170cdfdaab0698a9eff00a6a9c357ed (patch) | |
tree | 994fd00f51d3540a958c6f48aa7eb25d7ee81088 /src/test | |
parent | 8bb71d26a90460ed8e138140c16a71e0f560e0cd (diff) |
tree-wide: do not wrap assert_se in extra parentheses
We were inconsitently using them in some cases, but in majority not.
Using assignment in assert_se is very common, not an exception like in
'if', so let's drop the extra parens everywhere.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-copy.c | 12 | ||||
-rw-r--r-- | src/test/test-dlopen.c | 2 | ||||
-rw-r--r-- | src/test/test-hexdecoct.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/test/test-copy.c b/src/test/test-copy.c index 7337a8ae6..21cfceac2 100644 --- a/src/test/test-copy.c +++ b/src/test/test-copy.c @@ -96,7 +96,7 @@ static void test_copy_tree(void) { STRV_FOREACH(p, files) { _cleanup_free_ char *f; - assert_se((f = strappend(original_dir, *p))); + assert_se(f = strappend(original_dir, *p)); assert_se(mkdir_parents(f, 0755) >= 0); assert_se(write_string_file(f, "file", WRITE_STRING_FILE_CREATE) == 0); @@ -105,8 +105,8 @@ static void test_copy_tree(void) { STRV_FOREACH_PAIR(link, p, links) { _cleanup_free_ char *f, *l; - assert_se((f = strappend(original_dir, *p))); - assert_se((l = strappend(original_dir, *link))); + assert_se(f = strappend(original_dir, *p)); + assert_se(l = strappend(original_dir, *link)); assert_se(mkdir_parents(l, 0755) >= 0); assert_se(symlink(f, l) == 0); @@ -121,7 +121,7 @@ static void test_copy_tree(void) { _cleanup_free_ char *buf = NULL, *f; size_t sz = 0; - assert_se((f = strappend(copy_dir, *p))); + assert_se(f = strappend(copy_dir, *p)); assert_se(access(f, F_OK) == 0); assert_se(read_full_file(f, &buf, &sz) == 0); @@ -131,8 +131,8 @@ static void test_copy_tree(void) { STRV_FOREACH_PAIR(link, p, links) { _cleanup_free_ char *target = NULL, *f, *l; - assert_se((f = strjoin(original_dir, *p))); - assert_se((l = strjoin(copy_dir, *link))); + assert_se(f = strjoin(original_dir, *p)); + assert_se(l = strjoin(copy_dir, *link)); assert_se(chase_symlinks(l, NULL, 0, &target) == 1); assert_se(path_equal(f, target)); diff --git a/src/test/test-dlopen.c b/src/test/test-dlopen.c index 151d2d72b..febfc60e0 100644 --- a/src/test/test-dlopen.c +++ b/src/test/test-dlopen.c @@ -13,7 +13,7 @@ int main(int argc, char **argv) { void *handle; - assert_se((handle = dlopen(argv[1], RTLD_NOW))); + assert_se(handle = dlopen(argv[1], RTLD_NOW)); assert_se(dlclose(handle) == 0); return EXIT_SUCCESS; diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c index 6546be5c6..13b1fb7e3 100644 --- a/src/test/test-hexdecoct.c +++ b/src/test/test-hexdecoct.c @@ -88,10 +88,10 @@ static void test_unhexmem_one(const char *s, size_t l, int retval) { if (retval == 0) { char *answer; - if (l == (size_t) - 1) + if (l == (size_t) -1) l = strlen(s); - assert_se((hex = hexmem(mem, len))); + assert_se(hex = hexmem(mem, len)); answer = strndupa(s, l); assert_se(streq(delete_chars(answer, WHITESPACE), hex)); } |