summaryrefslogtreecommitdiff
path: root/src/test/test-unit-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-unit-file.c')
-rw-r--r--src/test/test-unit-file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
index dc6bc55244..0413ae2117 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -302,17 +302,18 @@ static void test_install_printf(void) {
_cleanup_free_ char *mid, *bid, *host;
- assert_se((mid = specifier_machine_id('m', NULL, NULL)));
- assert_se((bid = specifier_boot_id('b', NULL, NULL)));
+ assert_se(specifier_machine_id('m', NULL, NULL, &mid) >= 0 && mid);
+ assert_se(specifier_boot_id('b', NULL, NULL, &bid) >= 0 && bid);
assert_se((host = gethostname_malloc()));
#define expect(src, pattern, result) \
do { \
- _cleanup_free_ char *t = install_full_printf(&src, pattern); \
+ _cleanup_free_ char *t = NULL; \
_cleanup_free_ char \
*d1 = strdup(i.name), \
*d2 = strdup(i.path), \
*d3 = strdup(i.user); \
+ assert_se(install_full_printf(&src, pattern, &t) >= 0 || !result); \
memzero(i.name, strlen(i.name)); \
memzero(i.path, strlen(i.path)); \
memzero(i.user, strlen(i.user)); \