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:
5a33334
)
test-strv.c: test STRV_FOREACH_PAIR macro
author
Daniel Buch
<boogiewasthere@gmail.com>
Sat, 16 Mar 2013 09:00:03 +0000
(10:00 +0100)
committer
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Mon, 18 Mar 2013 20:09:02 +0000
(21:09 +0100)
src/test/test-strv.c
patch
|
blob
|
history
diff --git
a/src/test/test-strv.c
b/src/test/test-strv.c
index 504415ac0ce0530ca8dc61fac3b9cb37d368f550..2a1c0057cebce84b169a157b2d309b7b15cbe930 100644
(file)
--- a/
src/test/test-strv.c
+++ b/
src/test/test-strv.c
@@
-233,8
+233,23
@@
static void test_strv_append(void) {
assert_se(streq(c[0], "test3"));
}
+static void test_strv_foreach_pair(void) {
+ _cleanup_strv_free_ char **a = NULL;
+ char **x, **y;
+
+ a = strv_new("pair_one", "pair_one",
+ "pair_two", "pair_two",
+ "pair_three", "pair_three",
+ NULL);
+
+ STRV_FOREACH_PAIR(x, y, a) {
+ assert_se(streq(*x, *y));
+ }
+}
+
int main(int argc, char *argv[]) {
test_specifier_printf();
+ test_strv_foreach_pair();
test_strv_find();
test_strv_find_prefix();
test_strv_join();