summaryrefslogtreecommitdiff
path: root/auto_tests/conference_peer_nick_test.c
diff options
context:
space:
mode:
authorzugz (tox) <mbays+tox@sdf.org>2018-08-17 20:34:25 +0200
committerzugz (tox) <mbays+tox@sdf.org>2018-08-31 17:08:35 +0200
commit9764285ab156c25050b9e9e46a8e8bc0be701951 (patch)
treee4e608c75a36382fe84dcdfc03d8135f48aea655 /auto_tests/conference_peer_nick_test.c
parent2e4cae692e0895ce17e67fb2e1fd899c91fcb675 (diff)
Use test clock in run_auto_test tests and dht test
Diffstat (limited to 'auto_tests/conference_peer_nick_test.c')
-rw-r--r--auto_tests/conference_peer_nick_test.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/auto_tests/conference_peer_nick_test.c b/auto_tests/conference_peer_nick_test.c
index 14676b76..eb9bee71 100644
--- a/auto_tests/conference_peer_nick_test.c
+++ b/auto_tests/conference_peer_nick_test.c
@@ -7,6 +7,8 @@
7 7
8typedef struct State { 8typedef struct State {
9 uint32_t index; 9 uint32_t index;
10 uint64_t clock;
11
10 bool self_online; 12 bool self_online;
11 bool friend_online; 13 bool friend_online;
12 bool friend_in_group; 14 bool friend_in_group;
@@ -108,21 +110,16 @@ static void conference_peer_nick_test(Tox **toxes, State *state)
108 fprintf(stderr, "Waiting for invitation to arrive and peers to be in the group\n"); 110 fprintf(stderr, "Waiting for invitation to arrive and peers to be in the group\n");
109 111
110 do { 112 do {
111 tox_iterate(toxes[0], &state[0]); 113 iterate_all_wait(2, toxes, state, ITERATION_INTERVAL);
112 tox_iterate(toxes[1], &state[1]);
113
114 c_sleep(ITERATION_INTERVAL);
115 } while (!state[0].joined || !state[1].joined || !state[0].friend_in_group || !state[1].friend_in_group); 114 } while (!state[0].joined || !state[1].joined || !state[0].friend_in_group || !state[1].friend_in_group);
116 115
117 fprintf(stderr, "Running tox0, but not tox1, waiting for tox1 to drop out\n"); 116 fprintf(stderr, "Running tox0, but not tox1, waiting for tox1 to drop out\n");
118 117
119 do { 118 do {
120 tox_iterate(toxes[0], &state[0]); 119 iterate_all_wait(1, toxes, state, 1000);
121 120
122 // Rebuild peer list after every iteration. 121 // Rebuild peer list after every iteration.
123 rebuild_peer_list(toxes[0]); 122 rebuild_peer_list(toxes[0]);
124
125 c_sleep(ITERATION_INTERVAL);
126 } while (state[0].friend_in_group); 123 } while (state[0].friend_in_group);
127 124
128 fprintf(stderr, "Invitations accepted\n"); 125 fprintf(stderr, "Invitations accepted\n");