summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDonald Lee <dlqs@gmx.com>2021-08-10 00:29:19 +0200
committerDonald Lee <dlqs@gmx.com>2021-08-10 01:28:39 +0200
commit80bfe93670461bfc868c6252e2f15bd44586cd4e (patch)
tree519ee58966bd9296e2e20b46531fc9916fbfb60c /tests
parentMerge pull request #9299 from donaldsharp/zebra_should_continue (diff)
downloadfrr-80bfe93670461bfc868c6252e2f15bd44586cd4e.tar.xz
frr-80bfe93670461bfc868c6252e2f15bd44586cd4e.zip
tests: Add test consecutive frrscript_call
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/test_frrscript.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/test_frrscript.c b/tests/lib/test_frrscript.c
index 7b2304597..4c5d8d292 100644
--- a/tests/lib/test_frrscript.c
+++ b/tests/lib/test_frrscript.c
@@ -62,6 +62,14 @@ int main(int argc, char **argv)
long long *ansptr =
frrscript_get_result(fs, "fact", "ans", lua_tointegerp);
assert(*ansptr == 120);
+
+ /* check consecutive call + get_result without re-loading */
+ n = 4;
+ result = frrscript_call(fs, "fact", ("n", &n));
+ assert(result == 0);
+ ansptr = frrscript_get_result(fs, "fact", "ans", lua_tointegerp);
+ assert(*ansptr == 24);
+
XFREE(MTYPE_SCRIPT_RES, ansptr);
/* Negative testing */