summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/DHT_cryptosendfiletest.c17
-rw-r--r--testing/DHT_test.c17
-rw-r--r--testing/Messenger_test.c17
-rw-r--r--testing/nTox.c16
4 files changed, 4 insertions, 63 deletions
diff --git a/testing/DHT_cryptosendfiletest.c b/testing/DHT_cryptosendfiletest.c
index 5c3a0256..23423497 100644
--- a/testing/DHT_cryptosendfiletest.c
+++ b/testing/DHT_cryptosendfiletest.c
@@ -38,6 +38,7 @@
38#include "../core/network.h" 38#include "../core/network.h"
39#include "../core/DHT.h" 39#include "../core/DHT.h"
40#include "../core/net_crypto.h" 40#include "../core/net_crypto.h"
41#include "../core/misc_tools.h"
41 42
42#include <string.h> 43#include <string.h>
43 44
@@ -60,22 +61,6 @@ void printip(IP_Port ip_port)
60 printf("\nIP: %u.%u.%u.%u Port: %u\n",ip_port.ip.c[0],ip_port.ip.c[1],ip_port.ip.c[2],ip_port.ip.c[3],ntohs(ip_port.port)); 61 printf("\nIP: %u.%u.%u.%u Port: %u\n",ip_port.ip.c[0],ip_port.ip.c[1],ip_port.ip.c[2],ip_port.ip.c[3],ntohs(ip_port.port));
61} 62}
62 63
63//TODO: rewrite
64unsigned char * hex_string_to_bin(char hex_string[])
65{
66 size_t len = strlen(hex_string);
67 unsigned char * val = malloc(len);
68 char * pos = hex_string;
69 int i=0;
70 while(i < len)
71 {
72 sscanf(pos,"%2hhx",&val[i]);
73 pos+=2;
74 i++;
75 }
76 return val;
77}
78
79uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; 64uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
80 65
81int main(int argc, char *argv[]) 66int main(int argc, char *argv[])
diff --git a/testing/DHT_test.c b/testing/DHT_test.c
index d14e1577..92845b7e 100644
--- a/testing/DHT_test.c
+++ b/testing/DHT_test.c
@@ -30,6 +30,7 @@
30//#include "../core/network.h" 30//#include "../core/network.h"
31#include "../core/DHT.c" 31#include "../core/DHT.c"
32#include "../core/friend_requests.c" 32#include "../core/friend_requests.c"
33#include "../core/misc_tools.h"
33 34
34#include <string.h> 35#include <string.h>
35 36
@@ -114,22 +115,6 @@ void printpacket(uint8_t * data, uint32_t length, IP_Port ip_port)
114 printf("\n--------------------END-----------------------------\n\n\n"); 115 printf("\n--------------------END-----------------------------\n\n\n");
115} 116}
116 117
117//TODO: rewrite
118unsigned char * hex_string_to_bin(char hex_string[])
119{
120 size_t len = strlen(hex_string);
121 unsigned char * val = malloc(len);
122 char * pos = hex_string;
123 int i=0;
124 while(i < len)
125 {
126 sscanf(pos,"%2hhx",&val[i]);
127 pos+=2;
128 i++;
129 }
130 return val;
131}
132
133int main(int argc, char *argv[]) 118int main(int argc, char *argv[])
134{ 119{
135 //memcpy(self_client_id, "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", 32); 120 //memcpy(self_client_id, "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", 32);
diff --git a/testing/Messenger_test.c b/testing/Messenger_test.c
index f38eb962..6ad5c7dd 100644
--- a/testing/Messenger_test.c
+++ b/testing/Messenger_test.c
@@ -38,6 +38,7 @@
38 */ 38 */
39 39
40#include "../core/Messenger.h" 40#include "../core/Messenger.h"
41#include "../core/misc_tools.h"
41 42
42#ifdef WIN32 43#ifdef WIN32
43 44
@@ -50,22 +51,6 @@
50 51
51#endif 52#endif
52 53
53//TODO: rewrite
54unsigned char * hex_string_to_bin(char hex_string[])
55{
56 size_t len = strlen(hex_string);
57 unsigned char * val = malloc(len);
58 char * pos = hex_string;
59 int i=0;
60 while(i < len)
61 {
62 sscanf(pos,"%2hhx",&val[i]);
63 pos+=2;
64 i++;
65 }
66 return val;
67}
68
69void 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)
70{ 55{
71 printf("Friend request recieved from: \n"); 56 printf("Friend request recieved from: \n");
diff --git a/testing/nTox.c b/testing/nTox.c
index 27654191..e202a697 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24#include "nTox.h" 24#include "nTox.h"
25#include "../core/misc_tools.h"
25#include <stdio.h> 26#include <stdio.h>
26#include <time.h> 27#include <time.h>
27#ifdef WIN32 28#ifdef WIN32
@@ -46,21 +47,6 @@ void new_lines(char *line)
46 do_refresh(); 47 do_refresh();
47} 48}
48 49
49//TODO: rewrite
50unsigned char * hex_string_to_bin(char hex_string[])
51{
52 size_t len = strlen(hex_string);
53 unsigned char * val = malloc(len);
54 char * pos = hex_string;
55 int i=0;
56 while(i < len) {
57 sscanf(pos,"%2hhx",&val[i]);
58 pos+=2;
59 i++;
60 }
61 return val;
62}
63
64void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) 50void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
65{ 51{
66 if (line[0] == '/') { 52 if (line[0] == '/') {