summaryrefslogtreecommitdiff
path: root/ecp/test/basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/test/basic.c')
-rw-r--r--ecp/test/basic.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/ecp/test/basic.c b/ecp/test/basic.c
index 2e6bfd0..68cc604 100644
--- a/ecp/test/basic.c
+++ b/ecp/test/basic.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
@@ -53,52 +54,52 @@ int main(int argc, char *argv[]) {
/* server */
rv = ecp_init(&ctx_s);
- printf("ecp_init RV:%d\n", rv);
+ LOG("ecp_init", rv);
ecp_conn_handler_init(&handler_s, NULL, NULL, handle_msg_s, NULL);
ecp_ctx_set_handler(&ctx_s, CTYPE_TEST, &handler_s);
rv = ecp_dhkey_gen(&key_perma_s);
- printf("ecp_dhkey_gen RV:%d\n", rv);
+ LOG("ecp_dhkey_gen", rv);
rv = ecp_sock_create(&sock_s, &ctx_s, &key_perma_s);
- printf("ecp_sock_create RV:%d\n", rv);
+ LOG("ecp_sock_create", rv);
rv = ecp_addr_init(&addr, "0.0.0.0:3000");
- printf("ecp_addr_init RV:%d\n", rv);
+ LOG("ecp_addr_init", rv);
rv = ecp_sock_open(&sock_s, &addr);
- printf("ecp_sock_open RV:%d\n", rv);
+ LOG("ecp_sock_open", rv);
rv = ecp_start_receiver(&sock_s);
- printf("ecp_start_receiver RV:%d\n", rv);
+ LOG("ecp_start_receiver", rv);
/* client */
rv = ecp_init(&ctx_c);
- printf("ecp_init RV:%d\n", rv);
+ LOG("ecp_init", rv);
ecp_conn_handler_init(&handler_c, handle_open_c, NULL, handle_msg_c, NULL);
ecp_ctx_set_handler(&ctx_c, CTYPE_TEST, &handler_c);
rv = ecp_dhkey_gen(&key_perma_c);
- printf("ecp_dhkey_gen RV:%d\n", rv);
+ LOG("ecp_dhkey_gen", rv);
rv = ecp_sock_create(&sock_c, &ctx_c, &key_perma_c);
- printf("ecp_sock_create RV:%d\n", rv);
+ LOG("ecp_sock_create", rv);
rv = ecp_sock_open(&sock_c, NULL);
- printf("ecp_sock_open RV:%d\n", rv);
+ LOG("ecp_sock_open", rv);
rv = ecp_start_receiver(&sock_c);
- printf("ecp_start_receiver RV:%d\n", rv);
+ LOG("ecp_start_receiver", rv);
ecp_node_init(&node, &key_perma_s.public, NULL);
rv = ecp_node_set_addr(&node, "127.0.0.1:3000");
- printf("ecp_node_set_addr RV:%d\n", rv);
+ LOG("ecp_node_set_addr", rv);
ecp_conn_init(&conn, &sock_c, CTYPE_TEST);
rv = ecp_conn_open(&conn, &node);
- printf("ecp_conn_open RV:%d\n", rv);
+ LOG("ecp_conn_open", rv);
while (1) sleep(1);
}