diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-10-02 18:23:38 +0700 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2020-10-04 20:55:39 +0000 |
commit | 024e1957cc4c39bb30144e2c023151e35df473e1 (patch) | |
tree | 3622d43fa66b8a44439bfa72c286cd3906fc6c7c /tests | |
parent | 68c2e7305ac462347af528ba142fae867d014999 (diff) |
vty: check for duplicate flags in application specific attributes
This would facilitate detecting duplicates on early development stages.
Change-Id: I4e27d6e89d3f851b5ea4f00da01e7093afa537b2
Related: SYS#4937
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vty/vty_test.c | 18 | ||||
-rw-r--r-- | tests/vty/vty_test.err | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index b2d34ad8..1608b830 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -513,11 +513,29 @@ void test_numeric_range() destroy_test_vty(&test, vty); } +/* Application specific attributes */ +enum vty_test_attr { + VTY_TEST_ATTR_FOO = 0, + VTY_TEST_ATTR_BAR, + VTY_TEST_ATTR_ZOO, + VTY_TEST_ATTR_FOO_DUP, + VTY_TEST_ATTR_ZOO_DUP, +}; + int main(int argc, char **argv) { struct vty_app_info vty_info = { .name = "VtyTest", .version = 0, + .usr_attr_letters = { + [VTY_TEST_ATTR_FOO] = 'f', + [VTY_TEST_ATTR_BAR] = 'b', + [VTY_TEST_ATTR_ZOO] = 'z', + + /* Duplicate detection check */ + [VTY_TEST_ATTR_FOO_DUP] = 'f', + [VTY_TEST_ATTR_ZOO_DUP] = 'z', + }, }; const struct log_info_cat default_categories[] = {}; diff --git a/tests/vty/vty_test.err b/tests/vty/vty_test.err index 8ad4fd97..25c94e62 100644 --- a/tests/vty/vty_test.err +++ b/tests/vty/vty_test.err @@ -1,3 +1,5 @@ +Found duplicate flag letter 'f' in application specific attributes (index 0 vs 3)! Please fix. +Found duplicate flag letter 'z' in application specific attributes (index 2 vs 4)! Please fix. Got VTY event: 2 Got VTY event: 2 Got VTY event: 2 |