mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-21 01:01:02 +00:00
Fix an off by one error that caused a unit test to occasionally crash.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -241,7 +241,7 @@ AST_TEST_DEFINE(heap_test_3)
|
|||||||
|
|
||||||
i = test_size / 10;
|
i = test_size / 10;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
random_index = ast_random() % test_size - 1;
|
random_index = ast_random() % test_size;
|
||||||
node = ast_heap_remove(h, &nodes[random_index]);
|
node = ast_heap_remove(h, &nodes[random_index]);
|
||||||
if (nodes[random_index].val != node->val){
|
if (nodes[random_index].val != node->val){
|
||||||
ast_test_status_update(test, "Failed to remove what we expected to\n");
|
ast_test_status_update(test, "Failed to remove what we expected to\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user