summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/random_testing.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/testing/random_testing.cc b/testing/random_testing.cc
index 4e64c1b4..5ea0bc9d 100644
--- a/testing/random_testing.cc
+++ b/testing/random_testing.cc
@@ -299,10 +299,12 @@ int main() {
299 return tox_conference_get_chatlist_size(state.tox()) != 0; 299 return tox_conference_get_chatlist_size(state.tox()) != 0;
300 }, 300 },
301 [](Local_State *state, Random *rnd, std::mt19937 *rng) { 301 [](Local_State *state, Random *rnd, std::mt19937 *rng) {
302 size_t chat_count = tox_conference_get_chatlist_size(state->tox());
303 assert(chat_count != 0); // Condition above.
302 TOX_ERR_CONFERENCE_INVITE err; 304 TOX_ERR_CONFERENCE_INVITE err;
303 tox_conference_invite( 305 tox_conference_invite(
304 state->tox(), rnd->friend_selector(*rng), 306 state->tox(), rnd->friend_selector(*rng),
305 state->next_invite % tox_conference_get_chatlist_size(state->tox()), &err); 307 state->next_invite % chat_count, &err);
306 state->next_invite++; 308 state->next_invite++;
307 assert(err == TOX_ERR_CONFERENCE_INVITE_OK); 309 assert(err == TOX_ERR_CONFERENCE_INVITE_OK);
308 }, 310 },