diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-10 13:17:51 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-10 13:17:51 +0000 |
commit | 7b0ae9176b7d1a78b664d5c0d4a25a1e1b4e957f (patch) | |
tree | 7211881ae7912890a78a4d63f35359067592851d /tests | |
parent | 8f76dde74d256cc748d4ca12160ed724ba669a75 (diff) |
Fix an off by one error that caused a unit test to occasionally crash.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@269711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_heap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_heap.c b/tests/test_heap.c index cb0bcffcc..de48f0ae4 100644 --- a/tests/test_heap.c +++ b/tests/test_heap.c @@ -241,7 +241,7 @@ AST_TEST_DEFINE(heap_test_3) i = test_size / 10; while (i--) { - random_index = ast_random() % test_size - 1; + random_index = ast_random() % test_size; node = ast_heap_remove(h, &nodes[random_index]); if (nodes[random_index].val != node->val){ ast_test_status_update(test, "Failed to remove what we expected to\n"); |