summaryrefslogtreecommitdiff
path: root/testing/Messenger_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/Messenger_test.c')
-rw-r--r--testing/Messenger_test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c
index 668f046a..84508621 100644
--- a/testing/Messenger_test.c
+++ b/testing/Messenger_test.c
@@ -56,18 +56,18 @@
56 56
57#endif 57#endif
58 58
59void print_message(Messenger *m, uint32_t friendnumber, unsigned int type, const uint8_t *string, size_t length, 59static void print_message(Messenger *m, uint32_t friendnumber, unsigned int type, const uint8_t *string, size_t length,
60 void *userdata) 60 void *userdata)
61{ 61{
62 printf("Message with length %lu received from %u: %s \n", length, friendnumber, string); 62 printf("Message with length %lu received from %u: %s \n", length, friendnumber, string);
63 m_send_message_generic(m, friendnumber, type, (uint8_t *)"Test1", 6, 0); 63 m_send_message_generic(m, friendnumber, type, (const uint8_t *)"Test1", 6, 0);
64} 64}
65 65
66/* FIXME needed as print_request has to match the interface expected by 66/* FIXME needed as print_request has to match the interface expected by
67 * networking_requesthandler and so cannot take a Messenger * */ 67 * networking_requesthandler and so cannot take a Messenger * */
68static Messenger *m; 68static Messenger *m;
69 69
70void print_request(Messenger *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata) 70static void print_request(Messenger *m, const uint8_t *public_key, const uint8_t *data, size_t length, void *userdata)
71{ 71{
72 printf("Friend request received from: \n"); 72 printf("Friend request received from: \n");
73 printf("ClientID: "); 73 printf("ClientID: ");
@@ -164,7 +164,7 @@ int main(int argc, char *argv[])
164 printf("%hhX", address[i]); 164 printf("%hhX", address[i]);
165 } 165 }
166 166
167 setname(m, (uint8_t *)"Anon", 5); 167 setname(m, (const uint8_t *)"Anon", 5);
168 168
169 char temp_hex_id[128]; 169 char temp_hex_id[128];
170 printf("\nEnter the address of the friend you wish to add (38 bytes HEX format):\n"); 170 printf("\nEnter the address of the friend you wish to add (38 bytes HEX format):\n");
@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
178 } 178 }
179 179
180 uint8_t *bin_id = hex_string_to_bin(temp_hex_id); 180 uint8_t *bin_id = hex_string_to_bin(temp_hex_id);
181 int num = m_addfriend(m, bin_id, (uint8_t *)"Install Gentoo", sizeof("Install Gentoo")); 181 int num = m_addfriend(m, bin_id, (const uint8_t *)"Install Gentoo", sizeof("Install Gentoo"));
182 free(bin_id); 182 free(bin_id);
183 183
184 perror("Initialization"); 184 perror("Initialization");
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
188 getname(m, num, name); 188 getname(m, num, name);
189 printf("%s\n", name); 189 printf("%s\n", name);
190 190
191 m_send_message_generic(m, num, MESSAGE_NORMAL, (uint8_t *)"Test", 5, 0); 191 m_send_message_generic(m, num, MESSAGE_NORMAL, (const uint8_t *)"Test", 5, 0);
192 do_messenger(m, NULL); 192 do_messenger(m, NULL);
193 c_sleep(30); 193 c_sleep(30);
194 FILE *file = fopen("Save.bak", "wb"); 194 FILE *file = fopen("Save.bak", "wb");