diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-26 15:30:22 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-26 15:49:54 -0500 |
commit | f78e6385dc4cee0a1f399c4c89ebf823c108d447 (patch) | |
tree | e1baf230750ddd221b8bdd71ac4d62f5b3472968 /src/test/test-unit-name.c | |
parent | e3e0314b56012f7febc279d268f2cadc1fcc0f25 (diff) |
Use enums to make it obvious what boolean params mean
Suggested-by: Russ Allbery <rra@debian.org>
Diffstat (limited to 'src/test/test-unit-name.c')
-rw-r--r-- | src/test/test-unit-name.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c index ad664bc545..c10ec608af 100644 --- a/src/test/test-unit-name.c +++ b/src/test/test-unit-name.c @@ -63,7 +63,7 @@ static void test_replacements(void) { puts(t); \ k = unit_name_to_path(t); \ puts(k); \ - assert(streq(k, expected ? expected : path)); \ + assert(streq(k, expected ? expected : path)); \ } expect("/waldo", ".mount", NULL); @@ -74,12 +74,12 @@ static void test_replacements(void) { puts("-------------------------------------------------"); #undef expect -#define expect(pattern, path, suffix, expected) \ - { \ - _cleanup_free_ char *t = \ +#define expect(pattern, path, suffix, expected) \ + { \ + _cleanup_free_ char *t = \ unit_name_from_path_instance(pattern, path, suffix); \ - puts(t); \ - assert(streq(t, expected)); \ + puts(t); \ + assert(streq(t, expected)); \ } expect("waldo", "/waldo", ".mount", "waldo@waldo.mount"); @@ -89,13 +89,13 @@ static void test_replacements(void) { puts("-------------------------------------------------"); #undef expect -#define expect(pattern) \ - { \ - _cleanup_free_ char *k, *t; \ - assert_se(t = unit_name_mangle(pattern, false)); \ - assert_se(k = unit_name_mangle(t, false)); \ - puts(t); \ - assert_se(streq(t, k)); \ +#define expect(pattern) \ + { \ + _cleanup_free_ char *k, *t; \ + assert_se(t = unit_name_mangle(pattern, MANGLE_NOGLOB)); \ + assert_se(k = unit_name_mangle(t, MANGLE_NOGLOB)); \ + puts(t); \ + assert_se(streq(t, k)); \ } expect("/home"); |