summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests')
-rwxr-xr-xauto_tests/friends_test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/auto_tests/friends_test.c b/auto_tests/friends_test.c
index 317714d6..3c15b35b 100755
--- a/auto_tests/friends_test.c
+++ b/auto_tests/friends_test.c
@@ -65,13 +65,13 @@ void do_tox(void)
65 doMessenger(m); 65 doMessenger(m);
66} 66}
67 67
68void parent_confirm_message(Messenger *m, int num, uint8_t *data, uint16_t length) 68void parent_confirm_message(Messenger *m, int num, uint8_t *data, uint16_t length, void* userdata)
69{ 69{
70 puts("OK"); 70 puts("OK");
71 request_flags |= SECOND_FLAG; 71 request_flags |= SECOND_FLAG;
72} 72}
73 73
74void parent_confirm_status(Messenger *m, int num, uint8_t *data, uint16_t length) 74void parent_confirm_status(Messenger *m, int num, uint8_t *data, uint16_t length, void* userdata)
75{ 75{
76 puts("OK"); 76 puts("OK");
77 request_flags |= FIRST_FLAG; 77 request_flags |= FIRST_FLAG;
@@ -108,7 +108,7 @@ int parent_friend_request(void)
108 return 0; 108 return 0;
109} 109}
110 110
111void child_got_request(uint8_t *public_key, uint8_t *data, uint16_t length) 111void child_got_request(uint8_t *public_key, uint8_t *data, uint16_t length, void* userdata)
112{ 112{
113 fputs("OK\nsending status to parent", stdout); 113 fputs("OK\nsending status to parent", stdout);
114 fflush(stdout); 114 fflush(stdout);
@@ -116,7 +116,7 @@ void child_got_request(uint8_t *public_key, uint8_t *data, uint16_t length)
116 request_flags |= FIRST_FLAG; 116 request_flags |= FIRST_FLAG;
117} 117}
118 118
119void child_got_statuschange(Messenger *m, int friend_num, uint8_t *string, uint16_t length) 119void child_got_statuschange(Messenger *m, int friend_num, uint8_t *string, uint16_t length, void* userdata)
120{ 120{
121 request_flags |= SECOND_FLAG; 121 request_flags |= SECOND_FLAG;
122} 122}
@@ -175,8 +175,8 @@ int main(int argc, char *argv[])
175 Messenger_save(m, child_id); 175 Messenger_save(m, child_id);
176 msync(child_id, crypto_box_PUBLICKEYBYTES, MS_SYNC); 176 msync(child_id, crypto_box_PUBLICKEYBYTES, MS_SYNC);
177 177
178 m_callback_friendrequest(m, child_got_request); 178 m_callback_friendrequest(m, child_got_request, NULL);
179 m_callback_statusmessage(m, child_got_statuschange); 179 m_callback_statusmessage(m, child_got_statuschange, NULL);
180 180
181 /* wait on the friend request */ 181 /* wait on the friend request */
182 while(!(request_flags & FIRST_FLAG)) 182 while(!(request_flags & FIRST_FLAG))
@@ -207,8 +207,8 @@ int main(int argc, char *argv[])
207 m = initMessenger(); 207 m = initMessenger();
208 208
209 msync(parent_id, crypto_box_PUBLICKEYBYTES, MS_SYNC); 209 msync(parent_id, crypto_box_PUBLICKEYBYTES, MS_SYNC);
210 m_callback_statusmessage(m, parent_confirm_status); 210 m_callback_statusmessage(m, parent_confirm_status, NULL);
211 m_callback_friendmessage(m, parent_confirm_message); 211 m_callback_friendmessage(m, parent_confirm_message, NULL);
212 212
213 /* hacky way to give the child time to set up */ 213 /* hacky way to give the child time to set up */
214 c_sleep(50); 214 c_sleep(50);