PACK() macro

This commit is contained in:
2022-08-14 13:23:39 +06:00
parent 4e162bd474
commit 7ba7201d3a
13 changed files with 51 additions and 25 deletions

View File

@@ -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);,_);

View File

@@ -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(){

View File

@@ -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