PACK() macro
This commit is contained in:
@@ -20,15 +20,20 @@ void __test_knIPV4Address_fromStr(char* addrStr, uint8 a, uint8 b, uint8 c, uint
|
||||
void test_network(){
|
||||
optime(__func__,1,({
|
||||
printf("\e[96m------------[test_network]------------\n");
|
||||
if(sizeof(knIPV4Endpoint)!=sizeof(knPort)+sizeof(knIPV4Address))
|
||||
throw(ERR_WRONGTYPE);
|
||||
|
||||
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(knSockType_TCP), maybeS)
|
||||
tryLast(knSocket_open(knSocketType_TCP), maybeS)
|
||||
s=maybeS.value.VoidPtr;
|
||||
printf("\e[92mTCP socket created\n");
|
||||
tryLast(knSocket_close(s);,_);
|
||||
|
||||
@@ -7,7 +7,7 @@ void printstnode(STNode* node){
|
||||
"\n address: %p\n value: ",sizeof(STNode),node);
|
||||
printuni(node->value);
|
||||
// prints pointers to all existing branches
|
||||
printf("\n branches: %p\n", node->branches);
|
||||
/* printf("\n branches: %p\n", node->branches);
|
||||
if(node->branches) for(uint8 i=0;i<8;i++){
|
||||
printf(" \e[90m[%u]=%p\n",i,node->branches[i]);
|
||||
if(node->branches[i])
|
||||
@@ -18,7 +18,7 @@ void printstnode(STNode* node){
|
||||
printf(" \e[90m[%u]=%p\n",iii,node->branches[i][ii][iii]);
|
||||
}
|
||||
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
void test_searchtree(){
|
||||
|
||||
@@ -15,6 +15,8 @@ void test_hashtable();
|
||||
void test_dtsod();
|
||||
void test_network();
|
||||
|
||||
#define PRINT_SIZEOF(T) printf("\e[94m" #T " size: \e[96m" IFWIN("%llu", "%lu") "\n", sizeof(T))
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user