diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-11-11 22:07:11 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-11-11 22:07:11 +0000 |
| commit | 84d91e1c53584458c783820f7e8e341b8617e4cb (patch) | |
| tree | ed5b45f9ed9513e99e7e331351085aed4d78aace /src | |
| parent | Add totally unfinished XML/SPObject test suite (diff) | |
| download | inkscape-84d91e1c53584458c783820f7e8e341b8617e4cb.tar.gz inkscape-84d91e1c53584458c783820f7e8e341b8617e4cb.zip | |
Add a few more tests
(bzr r13703)
Diffstat (limited to 'src')
| -rw-r--r-- | src/object-test.h | 24 |
1 files changed, 24 insertions, 0 deletions
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<SPGroup *>(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) |
