mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 15:18:06 +00:00
tests: Add test consecutive frrscript_call
Signed-off-by: Donald Lee <dlqs@gmx.com>
This commit is contained in:
parent
c123e9df54
commit
80bfe93670
@ -62,6 +62,14 @@ int main(int argc, char **argv)
|
|||||||
long long *ansptr =
|
long long *ansptr =
|
||||||
frrscript_get_result(fs, "fact", "ans", lua_tointegerp);
|
frrscript_get_result(fs, "fact", "ans", lua_tointegerp);
|
||||||
assert(*ansptr == 120);
|
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);
|
XFREE(MTYPE_SCRIPT_RES, ansptr);
|
||||||
|
|
||||||
/* Negative testing */
|
/* Negative testing */
|
||||||
|
Loading…
Reference in New Issue
Block a user