summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorChristian Brueffer <christian@brueffer.de>2013-08-09 13:57:05 +0200
committerChristian Brueffer <christian@brueffer.de>2013-08-09 14:01:35 +0200
commit0b8fa729146c8033be161540289baa2244c94042 (patch)
treea3ed7b95ed09342402f37892ba2246436897e9d9 /testing
parent29264b58fc58c5c22f301b9c2ed1a03eab78b310 (diff)
Fix a recurring typo in code and comments.
Diffstat (limited to 'testing')
-rw-r--r--testing/DHT_cryptosendfiletest.c4
-rw-r--r--testing/Lossless_UDP_testclient.c2
-rw-r--r--testing/Lossless_UDP_testserver.c10
-rw-r--r--testing/Messenger_test.c6
-rw-r--r--testing/rect.py6
5 files changed, 14 insertions, 14 deletions
diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c
index 888dac0f..7ebb72bf 100644
--- a/testing/DHT_cryptosendfiletest.c
+++ b/testing/DHT_cryptosendfiletest.c
@@ -1,6 +1,6 @@
1/* DHT cryptosendfiletest 1/* DHT cryptosendfiletest
2 * 2 *
3 * This program sends or recieves a friend request. 3 * This program sends or receives a friend request.
4 * 4 *
5 * it also sends the encrypted data from a file to another client. 5 * it also sends the encrypted data from a file to another client.
6 * Receives the file data that that client sends us. 6 * Receives the file data that that client sends us.
@@ -165,7 +165,7 @@ int main(int argc, char *argv[])
165 } 165 }
166 } 166 }
167 if(handle_friendrequest(acceptedfriend_public_key, request_data) > 1) { 167 if(handle_friendrequest(acceptedfriend_public_key, request_data) > 1) {
168 printf("RECIEVED FRIEND REQUEST: %s\n", request_data); 168 printf("RECEIVED FRIEND REQUEST: %s\n", request_data);
169 } 169 }
170 170
171 /* if someone connected to us write what he sends to a file 171 /* if someone connected to us write what he sends to a file
diff --git a/testing/Lossless_UDP_testclient.c b/testing/Lossless_UDP_testclient.c
index 7093afec..78aff1a3 100644
--- a/testing/Lossless_UDP_testclient.c
+++ b/testing/Lossless_UDP_testclient.c
@@ -116,7 +116,7 @@ void printconnection(int connection_id)
116} 116}
117*/ 117*/
118 118
119/*( recieve packets and send them to the packethandler */ 119/*( receive packets and send them to the packethandler */
120/*run doLossless_UDP(); */ 120/*run doLossless_UDP(); */
121void Lossless_UDP() 121void Lossless_UDP()
122{ 122{
diff --git a/testing/Lossless_UDP_testserver.c b/testing/Lossless_UDP_testserver.c
index 84a64b38..f4b144b4 100644
--- a/testing/Lossless_UDP_testserver.c
+++ b/testing/Lossless_UDP_testserver.c
@@ -1,12 +1,12 @@
1/* Lossless_UDP testserver 1/* Lossless_UDP testserver
2 * A program that waits for a lossless UDP connection and then saves all the data recieved to a file. 2 * A program that waits for a lossless UDP connection and then saves all the data received to a file.
3 * NOTE: this program simulates a 33% packet loss. 3 * NOTE: this program simulates a 33% packet loss.
4 * 4 *
5 * Best used in combination with Lossless_UDP_testclient 5 * Best used in combination with Lossless_UDP_testclient
6 * 6 *
7 * Compile with: gcc -O2 -Wall -lsodium -o testserver ../core/network.c ../core/Lossless_UDP.c Lossless_UDP_testserver.c 7 * Compile with: gcc -O2 -Wall -lsodium -o testserver ../core/network.c ../core/Lossless_UDP.c Lossless_UDP_testserver.c
8 * 8 *
9 * Command line argument is the name of the file to save what we recieve to. 9 * Command line argument is the name of the file to save what we receive to.
10 * EX: ./testserver filename1.txt 10 * EX: ./testserver filename1.txt
11 * 11 *
12 * Copyright (C) 2013 Tox project All Rights Reserved. 12 * Copyright (C) 2013 Tox project All Rights Reserved.
@@ -113,7 +113,7 @@ void printconnection(int connection_id)
113} 113}
114*/ 114*/
115 115
116/* recieve packets and send them to the packethandler 116/* receive packets and send them to the packethandler
117 * run doLossless_UDP(); */ 117 * run doLossless_UDP(); */
118void Lossless_UDP() 118void Lossless_UDP()
119{ 119{
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
167 connection = incoming_connection(); 167 connection = incoming_connection();
168 if(connection != -1) { 168 if(connection != -1) {
169 if(is_connected(connection) == 2) { 169 if(is_connected(connection) == 2) {
170 printf("Recieved the connection.\n"); 170 printf("Received the connection.\n");
171 171
172 } 172 }
173 break; 173 break;
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
184 kill_connection_in(connection, 3000000); 184 kill_connection_in(connection, 3000000);
185 read = read_packet(connection, buffer); 185 read = read_packet(connection, buffer);
186 if (read != 0) { 186 if (read != 0) {
187 // printf("Recieved data.\n"); 187 // printf("Received data.\n");
188 if (!fwrite(buffer, read, 1, file)) 188 if (!fwrite(buffer, read, 1, file))
189 printf("file write error\n"); 189 printf("file write error\n");
190 } 190 }
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c
index 24a78abb..a11d374b 100644
--- a/testing/Messenger_test.c
+++ b/testing/Messenger_test.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * It tries sending a message to the added friend. 5 * It tries sending a message to the added friend.
6 * 6 *
7 * If it recieves a message from a friend it replies back. 7 * If it receives a message from a friend it replies back.
8 * 8 *
9 * 9 *
10 * This is how I compile it: gcc -O2 -Wall -D VANILLA_NACL -o test ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c ../nacl/build/${HOSTNAME%.*}/lib/amd64/{cpucycles.o,libnacl.a,randombytes.o} Messenger_test.c 10 * This is how I compile it: gcc -O2 -Wall -D VANILLA_NACL -o test ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c ../nacl/build/${HOSTNAME%.*}/lib/amd64/{cpucycles.o,libnacl.a,randombytes.o} Messenger_test.c
@@ -53,7 +53,7 @@
53 53
54void print_request(uint8_t * public_key, uint8_t * data, uint16_t length) 54void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
55{ 55{
56 printf("Friend request recieved from: \n"); 56 printf("Friend request received from: \n");
57 printf("ClientID: "); 57 printf("ClientID: ");
58 uint32_t j; 58 uint32_t j;
59 for(j = 0; j < 32; j++) 59 for(j = 0; j < 32; j++)
@@ -78,7 +78,7 @@ void print_request(uint8_t * public_key, uint8_t * data, uint16_t length)
78 78
79void print_message(int friendnumber, uint8_t * string, uint16_t length) 79void print_message(int friendnumber, uint8_t * string, uint16_t length)
80{ 80{
81 printf("Message with length %u recieved from %u: %s \n", length, friendnumber, string); 81 printf("Message with length %u received from %u: %s \n", length, friendnumber, string);
82 m_sendmessage(friendnumber, (uint8_t*)"Test1", 6); 82 m_sendmessage(friendnumber, (uint8_t*)"Test1", 6);
83} 83}
84 84
diff --git a/testing/rect.py b/testing/rect.py
index 59d6c158..85e70810 100644
--- a/testing/rect.py
+++ b/testing/rect.py
@@ -18,17 +18,17 @@ a = 1;
18#send ping request to our DHT on localhost. 18#send ping request to our DHT on localhost.
19sock.sendto("0012345678".decode("hex") + client_id, ('127.0.0.1', 33445)) 19sock.sendto("0012345678".decode("hex") + client_id, ('127.0.0.1', 33445))
20 20
21#print all packets recieved and respond to ping requests properly 21#print all packets received and respond to ping requests properly
22while True: 22while True:
23 data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes 23 data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
24 print "received message:", data.encode('hex'), " From:", addr 24 print "received message:", data.encode('hex'), " From:", addr
25 #if we recieve a ping request. 25 #if we receive a ping request.
26 print data[0].encode('hex') 26 print data[0].encode('hex')
27 if data[0] == "00".decode('hex'): 27 if data[0] == "00".decode('hex'):
28 print "Sending ping resp" 28 print "Sending ping resp"
29 sock.sendto("01".decode('hex') + data[1:5] + client_id, addr) 29 sock.sendto("01".decode('hex') + data[1:5] + client_id, addr)
30 30
31 #if we recieve a get_nodes request. 31 #if we receive a get_nodes request.
32 if data[0] == "02".decode('hex'): 32 if data[0] == "02".decode('hex'):
33 print "Sending getn resp" 33 print "Sending getn resp"
34 #send send nodes packet with a couple 127.0.0.1 ips and ports. 34 #send send nodes packet with a couple 127.0.0.1 ips and ports.