diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-01-25 04:14:07 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-02-10 15:40:38 +0100 |
| commit | fdc3d1ab837a81d27ab10d0bf65f349263870154 (patch) | |
| tree | 0e9df1a55a96e081f6f51421c76723ed5fc53ed8 /tests/lib/cli/test_cli.c | |
| parent | de8f7a39836a8f121370c1506cc00e3321f284a2 (diff) | |
tests: add uninstall_element in testcli
Test uninstall_element(). The commandline-specified counter allows
isolating memleaks more closely, differentiating one-off vs. repeated
leaks.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tests/lib/cli/test_cli.c')
| -rw-r--r-- | tests/lib/cli/test_cli.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/lib/cli/test_cli.c b/tests/lib/cli/test_cli.c index 1a316022e2..54b34bc799 100644 --- a/tests/lib/cli/test_cli.c +++ b/tests/lib/cli/test_cli.c @@ -38,8 +38,10 @@ DUMMY_DEFUN(cmd11, "alt a WORD"); DUMMY_DEFUN(cmd12, "alt a A.B.C.D"); DUMMY_DEFUN(cmd13, "alt a X:X::X:X"); -void test_init(void) +void test_init(int argc, char **argv) { + size_t repeat = argc > 1 ? strtoul(argv[1], NULL, 0) : 223; + install_element (ENABLE_NODE, &cmd0_cmd); install_element (ENABLE_NODE, &cmd1_cmd); install_element (ENABLE_NODE, &cmd2_cmd); @@ -53,4 +55,12 @@ void test_init(void) install_element (ENABLE_NODE, &cmd11_cmd); install_element (ENABLE_NODE, &cmd12_cmd); install_element (ENABLE_NODE, &cmd13_cmd); + for (size_t i = 0; i < repeat; i++) { + uninstall_element (ENABLE_NODE, &cmd5_cmd); + install_element (ENABLE_NODE, &cmd5_cmd); + } + for (size_t i = 0; i < repeat; i++) { + uninstall_element (ENABLE_NODE, &cmd13_cmd); + install_element (ENABLE_NODE, &cmd13_cmd); + } } |
