chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
04045d8
)
test-strv.c: ported test_specifier_printf() to _cleanup_free_ + assert_se + cleanup
author
Daniel Buch
<boogiewasthere@gmail.com>
Sun, 17 Feb 2013 19:15:52 +0000
(20:15 +0100)
committer
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Mon, 18 Feb 2013 22:57:56 +0000
(23:57 +0100)
src/test/test-strv.c
patch
|
blob
|
history
diff --git
a/src/test/test-strv.c
b/src/test/test-strv.c
index 7f475a6f4cb3f71b282e4fe08dcd7b48d9676a71..504415ac0ce0530ca8dc61fac3b9cb37d368f550 100644
(file)
--- a/
src/test/test-strv.c
+++ b/
src/test/test-strv.c
@@
-27,7
+27,7
@@
#include "strv.h"
static void test_specifier_printf(void) {
#include "strv.h"
static void test_specifier_printf(void) {
-
char *w
;
+
_cleanup_free_ char *w = NULL
;
const Specifier table[] = {
{ 'a', specifier_string, (char*) "AAAA" },
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);
};
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) {
}
static void test_strv_find(void) {