]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: Add test consecutive frrscript_call
authorDonald Lee <dlqs@gmx.com>
Mon, 9 Aug 2021 22:29:19 +0000 (06:29 +0800)
committerDonald Lee <dlqs@gmx.com>
Mon, 9 Aug 2021 23:28:39 +0000 (07:28 +0800)
Signed-off-by: Donald Lee <dlqs@gmx.com>
tests/lib/test_frrscript.c

index 7b23045978d91351c562212a9da051cd8bc31f39..4c5d8d29289e6df47720ae1f4284e0d1df63fe4f 100644 (file)
@@ -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 */