From 9d3eeabfe1541a1c497dabdebaad7bbee04dce6f Mon Sep 17 00:00:00 2001 From: xethyrion Date: Thu, 1 Dec 2016 21:27:18 +0200 Subject: [PATCH] Create testit.c_PREVIEW_DO_NOT_USE --- include/ipfs/node/testit.c_PREVIEW_DO_NOT_USE | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 include/ipfs/node/testit.c_PREVIEW_DO_NOT_USE diff --git a/include/ipfs/node/testit.c_PREVIEW_DO_NOT_USE b/include/ipfs/node/testit.c_PREVIEW_DO_NOT_USE new file mode 100644 index 0000000..120ed7f --- /dev/null +++ b/include/ipfs/node/testit.c_PREVIEW_DO_NOT_USE @@ -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; +}