From 9ff0a9b254dd9773d5f2f4aa67eb465c3d3262e7 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 16 Nov 2020 14:32:15 +0100 Subject: [PATCH] fix random array index picker --- srsenb/test/mac/scheduler_test_rand.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsenb/test/mac/scheduler_test_rand.cc b/srsenb/test/mac/scheduler_test_rand.cc index cce2bf9a5..3c02acf12 100644 --- a/srsenb/test/mac/scheduler_test_rand.cc +++ b/srsenb/test/mac/scheduler_test_rand.cc @@ -338,7 +338,7 @@ void test_scheduler_rand(sched_sim_events sim) template T pick_random_uniform(std::initializer_list v) { - return *(v.begin() + std::uniform_int_distribution{0, v.size()}(srsenb::get_rand_gen())); + return *(v.begin() + std::uniform_int_distribution{0, v.size() - 1}(srsenb::get_rand_gen())); } sched_sim_events rand_sim_params(uint32_t nof_ttis)