1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
/**
* This is only for testing
* Uncomment after testing
*/
int main (int argc, char **argv) {
dag* globalDag = new dag();
//*****************************************
//* TEST OF DAGNODE
//*****************************************
fprintf(stderr, "\n\n******************************* \n");
fprintf(stderr, "Test in dagnode\n");
dagnode rootAncestors[] = {}; //Both null -> root
dagnode* root = new dagnode(1, rootAncestors);
fprintf(stderr, "root got id: %d \n", root->getId());
dagnode n1Ancestors[] = {*root};
dagnode* n1 = new dagnode(2, n1Ancestors);
fprintf(stderr, "n1 got id: %d\n", n1->getId());
//**************************************
//* TEST OF DAG CLASS
//**************************************
globalDag->makeVersion({root}, 1);
dagnode *c1 = &root->getChilds()[0];
fprintf(stderr, "Roots child is %d\n", c1->getId());
globalDag->makeVersion({root}, 1);
dagnode *ca1 = &root->getChilds()[0];
dagnode *ca2 = &root->getChilds()[1];
fprintf(stderr, "Roots child is %d and %d\n", ca1->getId(), ca2->getId());
dagnode *search = globalDag->getVersionNode(1);
fprintf(stderr, "Search result: %d", search->getId());
//***************************************
//* TESTING LOCAL VERSION TREE
//***************************************
fprintf(stderr, "\n\n*************************************\n");
fprintf(stderr, "TEST IN LocalVersionNode\n");
LocalVersionNode *lvn = new LocalVersionNode(1,{});
fprintf(stderr, "Done\n\n");
fprintf(stderr, "TEST IN LocalVersionTree\n");
LocalVersionTree *lvt = new LocalVersionTree(1);
fprintf(stderr, "Done\n");
}
|