mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
test-strv.c: ported test_specifier_printf() to _cleanup_free_ + assert_se + cleanup
This commit is contained in:
parent
04045d8426
commit
9f31636648
@ -27,7 +27,7 @@
|
||||
#include "strv.h"
|
||||
|
||||
static void test_specifier_printf(void) {
|
||||
char *w;
|
||||
_cleanup_free_ char *w = NULL;
|
||||
|
||||
const Specifier table[] = {
|
||||
{ 'a', specifier_string, (char*) "AAAA" },
|
||||
@ -36,8 +36,10 @@ static void test_specifier_printf(void) {
|
||||
};
|
||||
|
||||
w = specifier_printf("xxx a=%a b=%b yyy", table, NULL);
|
||||
printf("<%s>\n", w);
|
||||
free(w);
|
||||
puts(w);
|
||||
|
||||
assert_se(w);
|
||||
assert_se(streq(w, "xxx a=AAAA b=BBBB yyy"));
|
||||
}
|
||||
|
||||
static void test_strv_find(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user