summaryrefslogtreecommitdiff
path: root/test/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c
new file mode 100644
index 0000000..ef7f739
--- /dev/null
+++ b/test/test.c
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <unistd.h>
+
+
+#include <tnt.h>
+
+int main()
+{
+ int sd;
+ int res;
+ struct sockaddr_in sock;
+
+ sd = tnt_socket(AF_INET,SOCK_STREAM,0);
+
+ if(sd == -1)
+ {
+ perror("tnt_socket");
+ return EXIT_FAILURE;
+ }
+
+ bzero(&sock,sizeof(sock));
+ sock.sin_family = AF_INET;
+ sock.sin_port = htons(1234);
+ sock.sin_addr.s_addr = htonl(INADDR_ANY);
+
+ res = tnt_bind(sd, &sock, sizeof(sock));
+
+ if(res > 0)
+ {
+ printf("Correct!");
+ }
+
+}