1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

test-strv.c: test STRV_FOREACH_PAIR macro

This commit is contained in:
Daniel Buch 2013-03-16 10:00:03 +01:00 committed by Thomas Hindoe Paaboel Andersen
parent 5a33334b8a
commit 4c325b2efe

View File

@ -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();