1 /* t-strlist.c - Regression tests for strist.c
2 * Copyright (C) 2015 g10 Code GmbH
4 * This file is part of GnuPG.
6 * GnuPG is free software; you can redistribute it and/or modify it
7 * under the terms of either
9 * - the GNU Lesser General Public License as published by the Free
10 * Software Foundation; either version 3 of the License, or (at
11 * your option) any later version.
15 * - the GNU General Public License as published by the Free
16 * Software Foundation; either version 2 of the License, or (at
17 * your option) any later version.
19 * or both in parallel, as here.
21 * GnuPG is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * General Public License for more details.
26 * You should have received a copies of the GNU General Public License
27 * and the GNU Lesser General Public License along with this program;
28 * if not, see <https://www.gnu.org/licenses/>.
36 #include "t-support.h"
39 test_strlist_rev (void)
43 /* Reversing an empty list should yield the empty list. */
44 if (! (strlist_rev (&s) == NULL))
47 add_to_strlist (&s, "1");
48 add_to_strlist (&s, "2");
49 add_to_strlist (&s, "3");
51 if (strcmp (s->d, "3") != 0)
53 if (strcmp (s->next->d, "2") != 0)
55 if (strcmp (s->next->next->d, "1") != 0)
57 if (s->next->next->next)
62 if (strcmp (s->d, "1") != 0)
64 if (strcmp (s->next->d, "2") != 0)
66 if (strcmp (s->next->next->d, "3") != 0)
68 if (s->next->next->next)
76 main (int argc, char **argv)