void HTTPNodeTestObject::test<4>() { // automatic creation of parent nodes and not overriding existing nodes LLHTTPNode* alphaNode = new LLHTTPNode; LLHTTPNode* betaNode = new LLHTTPNode; LLHTTPNode* gammaNode = new LLHTTPNode; LLHTTPNode* gamma2Node = new LLHTTPNode; mRoot.addNode("greek/alpha", alphaNode); mRoot.addNode("greek/beta", betaNode); mRoot.addNode("greek/gamma", gammaNode); mRoot.addNode("greek/gamma", gamma2Node); LLHTTPNode* alephNode = new LLHTTPNode; mRoot.addNode("hebrew/aleph", alephNode); ensureRootTraversal("greek/alpha", alphaNode, ""); ensureRootTraversal("greek/beta", betaNode, ""); ensureRootTraversal("greek/delta", NULL, "delta"); ensureRootTraversal("greek/gamma", gammaNode, ""); ensureRootTraversal("hebrew/aleph", alephNode, ""); ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot); ensure_equals("root of beta", betaNode->rootNode(), &mRoot); ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot); ensure_equals("root of aleph", alephNode->rootNode(), &mRoot); }
void HTTPNodeTestObject::test<3>() { // traversal of mutli-branched tree LLHTTPNode* greekNode = new LLHTTPNode; LLHTTPNode* alphaNode = new LLHTTPNode; LLHTTPNode* betaNode = new LLHTTPNode; LLHTTPNode* gammaNode = new LLHTTPNode; greekNode->addNode("alpha", alphaNode); greekNode->addNode("beta", betaNode); greekNode->addNode("gamma", gammaNode); mRoot.addNode("greek", greekNode); LLHTTPNode* hebrewNode = new LLHTTPNode; LLHTTPNode* alephNode = new LLHTTPNode; hebrewNode->addNode("aleph", alephNode); mRoot.addNode("hebrew", hebrewNode); ensureRootTraversal("greek/alpha", alphaNode, ""); ensureRootTraversal("greek/beta", betaNode, ""); ensureRootTraversal("greek/delta", NULL, "delta"); ensureRootTraversal("greek/gamma", gammaNode, ""); ensureRootTraversal("hebrew/aleph", alephNode, ""); ensure_equals("root of greek", greekNode->rootNode(), &mRoot); ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot); ensure_equals("root of beta", betaNode->rootNode(), &mRoot); ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot); ensure_equals("root of hebrew", hebrewNode->rootNode(), &mRoot); ensure_equals("root of aleph", alephNode->rootNode(), &mRoot); }
void HTTPNodeTestObject::test<2>() { // simple traversal of a single node LLHTTPNode* helloNode = new LLHTTPNode; mRoot.addNode("hello", helloNode); ensureRootTraversal("hello", helloNode, ""); ensureRootTraversal("/hello", helloNode, ""); ensureRootTraversal("hello/", helloNode, ""); ensureRootTraversal("/hello/", helloNode, ""); ensureRootTraversal("hello/there", NULL, "there"); ensure_equals("root of hello", helloNode->rootNode(), &mRoot); }