From 491929c3c2daf13859fc45775ba064edbd01027e Mon Sep 17 00:00:00 2001 From: Timerix22 <87668556+Timerix22@users.noreply.github.com> Date: Wed, 24 Aug 2022 13:49:26 +0600 Subject: [PATCH] Delete test_network.c --- tests/test_network.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 tests/test_network.c diff --git a/tests/test_network.c b/tests/test_network.c deleted file mode 100644 index 8df3f07..0000000 --- a/tests/test_network.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "tests.h" -#include "../src/Network/network.h" - -void __test_knIPV4Address_fromStr(char* addrStr, uint8 a, uint8 b, uint8 c, uint8 d){ - tryLast(knIPV4Address_fromStr(addrStr), maybeAddr){ - knIPV4Address addr; - addr.address=(uint32)maybeAddr.value.UInt64; - printf("\e[94mknIPV4Address_fromStr(\e[96m%s\e[94m) -> ", addrStr); - if(maybeAddr.value.UInt64!=knIPV4Address_fromBytes(a,b,c,d).address){ - printf("\e[91m%u.%u.%u.%u\n", - (uint8)addr.bytes[0], (uint8)addr.bytes[1], (uint8)addr.bytes[2], (uint8)addr.bytes[3]); - throw("knIPV4Address_fromStr returned wrong value"); - } - else printf("\e[92m%u.%u.%u.%u\n", - (uint8)addr.bytes[0], (uint8)addr.bytes[1], (uint8)addr.bytes[2], (uint8)addr.bytes[3]); - } -} -#define test_knIPV4Address_fromStr(a,b,c,d) __test_knIPV4Address_fromStr(#a"."#b"."#c"."#d, a,b,c,d) - -void test_network(){ - optime(__func__,1,({ - printf("\e[96m------------[test_network]------------\n"); - - PRINT_SIZEOF(knIPV4Address); - PRINT_SIZEOF(knPort); - PRINT_SIZEOF(knIPV4Endpoint); - PRINT_SIZEOF(knPackage); - PRINT_SIZEOF(knChannel); - PRINT_SIZEOF(knSocket); - - test_knIPV4Address_fromStr(127,0,0,1); - test_knIPV4Address_fromStr(34,255,45,0); - test_knIPV4Address_fromStr(3,3,3,128); - - knSocket* s; - tryLast(knSocket_open(knSocketType_TCP), maybeS) - s=maybeS.value.VoidPtr; - printf("\e[92mTCP socket created\n"); - tryLast(knSocket_close(s);,_); - printf("\e[92mTCP socket closed\n"); - })); -} \ No newline at end of file