summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-04-28 20:03:56 +0200
committerLennart Poettering <lennart@poettering.net>2020-04-28 22:47:21 +0200
commit268f5a54630ef997d85f29a3ffc2b951f7a996c7 (patch)
treed5e9542deb01e2308ae95c75cb05945682aa64ef /src/test
parentupdate TODO (diff)
downloadsystemd-268f5a54630ef997d85f29a3ffc2b951f7a996c7.tar.xz
systemd-268f5a54630ef997d85f29a3ffc2b951f7a996c7.zip
tree-wide: support a bunch of additional specifiers
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-strv.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/test/test-strv.c b/src/test/test-strv.c
index ae128dd7e5..cba5441d4b 100644
--- a/src/test/test-strv.c
+++ b/src/test/test-strv.c
@@ -9,12 +9,17 @@
static void test_specifier_printf(void) {
static const Specifier table[] = {
- { 'a', specifier_string, (char*) "AAAA" },
- { 'b', specifier_string, (char*) "BBBB" },
- { 'm', specifier_machine_id, NULL },
- { 'B', specifier_boot_id, NULL },
- { 'H', specifier_host_name, NULL },
+ { 'X', specifier_string, (char*) "AAAA" },
+ { 'Y', specifier_string, (char*) "BBBB" },
+ { 'm', specifier_machine_id, NULL },
+ { 'b', specifier_boot_id, NULL },
+ { 'H', specifier_host_name, NULL },
{ 'v', specifier_kernel_release, NULL },
+ { 'a', specifier_architecture, NULL },
+ { 'o', specifier_os_id, NULL },
+ { 'w', specifier_os_version_id, NULL },
+ { 'B', specifier_os_build_id, NULL },
+ { 'W', specifier_os_variant_id, NULL },
{}
};
@@ -23,7 +28,7 @@ static void test_specifier_printf(void) {
log_info("/* %s */", __func__);
- r = specifier_printf("xxx a=%a b=%b yyy", table, NULL, &w);
+ r = specifier_printf("xxx a=%X b=%Y yyy", table, NULL, &w);
assert_se(r >= 0);
assert_se(w);
@@ -31,10 +36,15 @@ static void test_specifier_printf(void) {
assert_se(streq(w, "xxx a=AAAA b=BBBB yyy"));
free(w);
- r = specifier_printf("machine=%m, boot=%B, host=%H, version=%v", table, NULL, &w);
+ r = specifier_printf("machine=%m, boot=%b, host=%H, version=%v, arch=%a", table, NULL, &w);
assert_se(r >= 0);
assert_se(w);
puts(w);
+
+ w = mfree(w);
+ specifier_printf("os=%o, os-version=%w, build=%B, variant=%W", table, NULL, &w);
+ if (w)
+ puts(w);
}
static void test_str_in_set(void) {