diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-07-28 17:44:48 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2020-07-30 21:02:03 +0000 |
commit | a184701108c2aaf188dbb3d306575abceda55bd9 (patch) | |
tree | 38b37716e25308da92138432995049a9fefbdc08 /tests | |
parent | 9fdc8715323a5ed621050c5541b9d7bd254c93c1 (diff) |
vty: Don't match negative values on purely positive ranges
Without this patch, for instance having a range 0-ULONG_MAX would match
if someones types value -3, which would be converted to unsigned but
that's clearly what is expected here from user point of view.
Change-Id: Ia95f6314a2dd3f94d21fc219cf69bb8d39b8e7f0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vty/vty_test.c | 2 | ||||
-rw-r--r-- | tests/vty/vty_test.ok | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index a7aef11a..b2d34ad8 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -508,7 +508,7 @@ void test_numeric_range() OSMO_ASSERT(do_vty_command(vty, "numeric-range 0") == CMD_SUCCESS); OSMO_ASSERT(do_vty_command(vty, "numeric-range 40000") == CMD_SUCCESS); - OSMO_ASSERT(do_vty_command(vty, "numeric-range -400000") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "numeric-range -400000") == CMD_ERR_NO_MATCH); destroy_test_vty(&test, vty); } diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index bac083d6..5f509f65 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -319,6 +319,5 @@ Going to execute 'numeric-range 40000' Called: 'return-success' Returned: 0, Current node: 1 '%s> ' Going to execute 'numeric-range -400000' -Called: 'return-success' -Returned: 0, Current node: 1 '%s> ' +Returned: 2, Current node: 1 '%s> ' All tests passed |