Create testit.c_PREVIEW_DO_NOT_USE

This commit is contained in:
xethyrion 2016-12-01 21:27:18 +02:00 committed by GitHub
parent b55dc4d96e
commit 9d3eeabfe1

View file

@ -0,0 +1,37 @@
testit.c
int main(int argc, char** argv)
{
printf("XETH TESTS\n");
//Variables of link:
char * name = "Alex";
char * ahash = "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG";
struct Link mylink;
mylink = Create_Link(name,ahash);
printf("===================================\n" \
"Node Link:\n" \
" -Name: %s\n" \
" -Size: %lu\n" \
"\n Cid Details:\n\n" \
" -Version: %d\n" \
" -Codec: %c\n" \
" -Hash: %s\n" \
" -Hash Length: %lu\n" \
"====================================\n" \
, mylink.name, mylink.size, mylink.Lcid->version,mylink.Lcid->codec,mylink.Lcid->hash,mylink.Lcid->hash_length);
//Link Two for testing purposes
char * name2 = "Simo";
char * ahash2 = "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnSimo";
struct Link mylink2;
mylink2 = Create_Link(name2,ahash2);
//
struct Node * mynode = N_Create_From_Link(mylink.Lcid, sizeof(mylink.Lcid));
mynode = N_Add_Link(&mynode, mylink2.Lcid, sizeof(mylink2.Lcid));
printf("Result pls: %s\n",mynode->links[0]->hash);
printf("LINKS: %d\n", mynode->link_ammount);
printf("Result pls2: %s\n",mynode->links[1]->hash);
Node_Free(mynode);
Free_Link(mylink);
Free_Link(mylink2);
unsigned char * data;
return 0;
}