diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-07-30 14:56:38 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2020-07-30 21:02:03 +0000 |
commit | 9fdc8715323a5ed621050c5541b9d7bd254c93c1 (patch) | |
tree | f309ce9f21f3ff6c71c87cd9c5fc24ab443f9501 /tests/vty | |
parent | d92be9ad13322268ec46073f4d271c4b34687dd7 (diff) |
vty: Allow 64 bit values in numeric ranges if system supports it
This fixes commands not being matched due to providing a range with more
than 10 digits.
The last case (passing -4000 matching 0-ULONG_MAX) shows a different bug
which will be fixed in next commit.
Change-Id: I0afa0caabffe36083c36b92ba90696ded00bb7be
Diffstat (limited to 'tests/vty')
-rw-r--r-- | tests/vty/vty_test.c | 6 | ||||
-rw-r--r-- | tests/vty/vty_test.ok | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index 7146a1db..a7aef11a 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -506,9 +506,9 @@ void test_numeric_range() printf("Going to test test_numeric_range()\n"); vty = create_test_vty(&test); - OSMO_ASSERT(do_vty_command(vty, "numeric-range 0") == CMD_ERR_NO_MATCH); - OSMO_ASSERT(do_vty_command(vty, "numeric-range 40000") == CMD_ERR_NO_MATCH); - OSMO_ASSERT(do_vty_command(vty, "numeric-range -400000") == CMD_ERR_NO_MATCH); + 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); destroy_test_vty(&test, vty); } diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index d81c6c72..bac083d6 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -313,9 +313,12 @@ Called: 'ambiguous_str ARG keyword' Returned: 0, Current node: 1 '%s> ' Going to test test_numeric_range() Going to execute 'numeric-range 0' -Returned: 2, Current node: 1 '%s> ' +Called: 'return-success' +Returned: 0, Current node: 1 '%s> ' Going to execute 'numeric-range 40000' -Returned: 2, Current node: 1 '%s> ' +Called: 'return-success' +Returned: 0, Current node: 1 '%s> ' Going to execute 'numeric-range -400000' -Returned: 2, Current node: 1 '%s> ' +Called: 'return-success' +Returned: 0, Current node: 1 '%s> ' All tests passed |