diff options
author | Daniel Buch <boogiewasthere@gmail.com> | 2013-03-16 10:00:03 +0100 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2013-03-18 21:09:02 +0100 |
commit | 4c325b2efe529379115ca853854062b29b669d11 (patch) | |
tree | a4852f9a72b60a68fb04f0481b165357a085f579 /src/test | |
parent | 5a33334b8ad49798510a2ce29e451194c6ecb618 (diff) |
test-strv.c: test STRV_FOREACH_PAIR macro
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-strv.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/test-strv.c b/src/test/test-strv.c index 504415ac0c..2a1c0057ce 100644 --- 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(); |