diff --git a/tests/test_bench_pull.cpp b/tests/test_bench_pull.cpp index 872f5527..e2593972 100644 --- a/tests/test_bench_pull.cpp +++ b/tests/test_bench_pull.cpp @@ -167,14 +167,14 @@ int main(int argc, char *argv[]) { //休眠一秒打印 sleep(1); - int alive_player = 0; + size_t alive_player = 0; { lock_guard lck(mtx); alive_player = player_map.size(); } InfoL << "在线播放器个数:" << alive_player; - int re_try = player_count - alive_player; - while (re_try--) { + size_t re_try = player_count - alive_player; + while (!exit_flag && re_try--) { //有些播放器播放失败了,那么我们重试添加 add_player(); } diff --git a/tests/test_bench_push.cpp b/tests/test_bench_push.cpp index 619b5bc8..389e4653 100644 --- a/tests/test_bench_push.cpp +++ b/tests/test_bench_push.cpp @@ -199,14 +199,14 @@ int main(int argc, char *argv[]) { //休眠一秒打印 sleep(1); - int alive_pusher = 0; + size_t alive_pusher = 0; { lock_guard lck(mtx); alive_pusher = pusher_map.size(); } InfoL << "在线推流器个数:" << alive_pusher; auto src = get_src(); - for(auto i = 0; i < pusher_count - alive_pusher && src && !exit_flag; ++i){ + for(size_t i = 0; i < pusher_count - alive_pusher && src && !exit_flag; ++i){ //有些推流器失败了,那么我们重试添加 add_pusher(get_src(), makeRandStr(8), i); }