]> git.proxmox.com Git - mirror_frr.git/blob - tests/lib/test_frrscript.c
Merge pull request #8919 from mobash-rasool/ospfv3-fixes
[mirror_frr.git] / tests / lib / test_frrscript.c
1 /*
2 * frrscript unit tests
3 * Copyright (C) 2021 Donald Lee
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include <zebra.h>
21
22 #include "lib/frrscript.h"
23
24 int main(int argc, char **argv)
25 {
26 frrscript_init("./lib");
27
28 struct frrscript *fs = frrscript_load("script1", NULL);
29 long long a = 100, b = 200;
30 int result = frrscript_call(fs, ("a", &a), ("b", &b));
31
32 assert(result == 0);
33 assert(a == 300);
34 assert(b == 200);
35
36 return 0;
37 }