From 84d91e1c53584458c783820f7e8e341b8617e4cb Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Tue, 11 Nov 2014 17:07:11 -0500 Subject: Add a few more tests (bzr r13703) --- src/object-test.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/object-test.h b/src/object-test.h index 77e9afa86..d6a9dbbd3 100644 --- a/src/object-test.h +++ b/src/object-test.h @@ -95,6 +95,30 @@ public: SPGroup *group = dynamic_cast(doc->getObjectById("G")); testGrouping(group); + + // Test parent behavior + SPObject *child = root->firstChild(); + assert(child != NULL); + TS_ASSERT(child->parent == root); + TS_ASSERT(child->document == doc); + TS_ASSERT(root->isAncestorOf(child)); + + // Test list behavior + SPObject *next = child->getNext(); + SPObject *prev = next; + TS_ASSERT(next->getPrev() == child); + prev = next; + next = next->getNext(); + while (next != NULL) { + // Walk the list + TS_ASSERT(next->getPrev() == prev); + prev = next; + next = next->getNext(); + } + TS_ASSERT(child->lastChild() == next); + + // Test hrefcount + TS_ASSERT(path->isReferenced()); } void testClones(SPPath *path) -- cgit v1.2.3