forked from cory/tildefriends
ssb: Test the one message generated from an invite so far.
This commit is contained in:
@ -1350,6 +1350,12 @@ void tf_ssb_test_invite(const tf_test_options_t* options)
|
||||
tf_ssb_release_db_writer(ssb0, writer);
|
||||
tf_printf("invite: %s\n", invite);
|
||||
|
||||
int count0 = 0;
|
||||
int count1 = 0;
|
||||
|
||||
tf_ssb_add_message_added_callback(ssb0, _message_added, NULL, &count0);
|
||||
tf_ssb_add_message_added_callback(ssb1, _message_added, NULL, &count1);
|
||||
|
||||
tf_ssb_connect_str(ssb1, invite, 0, NULL, NULL);
|
||||
|
||||
tf_printf("Waiting for connection.\n");
|
||||
@ -1362,22 +1368,26 @@ void tf_ssb_test_invite(const tf_test_options_t* options)
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
|
||||
tf_ssb_server_close(ssb0);
|
||||
tf_ssb_send_close(ssb1);
|
||||
|
||||
tf_printf("final run\n");
|
||||
tf_printf("waiting for messages\n");
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
while (count0 != 1 || count1 != 1)
|
||||
{
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
}
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
tf_printf("done\n");
|
||||
|
||||
tf_printf("destroy 0\n");
|
||||
tf_ssb_server_close(ssb0);
|
||||
tf_ssb_send_close(ssb1);
|
||||
|
||||
tf_ssb_destroy(ssb0);
|
||||
tf_printf("destroy 1\n");
|
||||
tf_ssb_destroy(ssb1);
|
||||
|
||||
tf_printf("final run\n");
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
|
||||
tf_printf("close\n");
|
||||
uv_loop_close(&loop);
|
||||
}
|
||||
|
Reference in New Issue
Block a user