diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-06-09 15:19:23 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-06-09 15:19:23 +0000 |
| commit | 5633812ca77f35e52db62e7b432761e0e59253fe (patch) | |
| tree | 2985071a7a26ae482e9e6e468f7175bf124aa1f8 /testfiles | |
| parent | Splitted tests to separate executables (diff) | |
| download | inkscape-5633812ca77f35e52db62e7b432761e0e59253fe.tar.gz inkscape-5633812ca77f35e52db62e7b432761e0e59253fe.zip | |
Removed Object class and temporary test dependencies
(bzr r14954.1.4)
Diffstat (limited to 'testfiles')
| -rw-r--r-- | testfiles/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | testfiles/src/object-set-test.cpp | 15 | ||||
| -rw-r--r-- | testfiles/src/object-test.cpp | 56 | ||||
| -rw-r--r-- | testfiles/unittest.cpp | 13 |
4 files changed, 4 insertions, 81 deletions
diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 5bb7ed1e0..e764220bc 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -17,7 +17,6 @@ set(TEST_SOURCES attributes-test color-profile-test dir-util-test - object-test object-set-test) set (_optional_unittest_libs ) diff --git a/testfiles/src/object-set-test.cpp b/testfiles/src/object-set-test.cpp index ff341b162..b0d236128 100644 --- a/testfiles/src/object-set-test.cpp +++ b/testfiles/src/object-set-test.cpp @@ -9,11 +9,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ #include <gtest/gtest.h> +#include <doc-per-case-test.h> #include "object-set.h" -#include "document.h" -#include "xml/simple-document.h" -class ObjectSetTest: public testing::Test { +class ObjectSetTest: public DocPerCaseTest { public: ObjectSetTest() { A = new SPObject(); @@ -71,10 +70,7 @@ TEST_F(ObjectSetTest, Basics) { TEST_F(ObjectSetTest, Autoremoving) { SPObject* Q = new SPObject(); - // TODO temporary - SPDocument *document = new SPDocument(); - Inkscape::XML::Node *rroot = new Inkscape::XML::SimpleDocument(); - Q->invoke_build(document, rroot, 0); + Q->invoke_build(_doc, _doc->rroot, 1); set.add(Q); EXPECT_TRUE(set.contains(Q)); EXPECT_EQ(1, set.size()); @@ -172,10 +168,7 @@ TEST_F(ObjectSetTest, Removing) { TEST_F(ObjectSetTest, TwoSets) { SPObject* Q = new SPObject(); - // TODO temporary - SPDocument *document = new SPDocument(); - Inkscape::XML::Node *rroot = new Inkscape::XML::SimpleDocument(); - Q->invoke_build(document, rroot, 0); + Q->invoke_build(_doc, _doc->rroot, 1); A->attach(B, nullptr); A->attach(Q, nullptr); set.add(A); diff --git a/testfiles/src/object-test.cpp b/testfiles/src/object-test.cpp deleted file mode 100644 index 83e90b2ec..000000000 --- a/testfiles/src/object-test.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "gtest/gtest.h" -#include "object.h" - -class ObjectTest: public testing::Test { -public: - ObjectTest() { - object = new Object("parent"); - childOfChild = new Object("childOfChild"); - child = new Object("child"); - child2 = new Object("child2"); - object2 = new Object("object2"); - child3 = new Object("child3"); - } - ~ObjectTest() { - delete child3; - delete child2; - delete childOfChild; - delete child; - delete object2; - delete object; - } - Object* object; - Object* object2; - Object* child; - Object* childOfChild; - Object* child2; - Object* child3; -}; - -TEST_F(ObjectTest, AddChild) { - EXPECT_EQ(0, object->getChildren().size()); - object->addChild(child); - EXPECT_EQ(1, object->getChildren().size()); - EXPECT_EQ(child, &(object->getChildren().front())); - EXPECT_EQ(object, child->getParent()); -} - -TEST_F(ObjectTest, IsDescendantOf) { - object->addChild(child); - child->addChild(childOfChild); - object->addChild(child2); - object2->addChild(child3); - EXPECT_TRUE(child->isDescendantOf(object)); - EXPECT_TRUE(childOfChild->isDescendantOf(child)); - EXPECT_TRUE(childOfChild->isDescendantOf(object)); - EXPECT_TRUE(child2->isDescendantOf(object)); - EXPECT_TRUE(child3->isDescendantOf(object2)); - EXPECT_FALSE(child->isDescendantOf(child2)); - EXPECT_FALSE(child2->isDescendantOf(child)); - EXPECT_FALSE(object->isDescendantOf(childOfChild)); - EXPECT_FALSE(object->isDescendantOf(child)); - EXPECT_FALSE(object->isDescendantOf(object2)); - EXPECT_FALSE(object2->isDescendantOf(object)); - EXPECT_FALSE(child2->isDescendantOf(child3)); - EXPECT_FALSE(child3->isDescendantOf(child2)); -} diff --git a/testfiles/unittest.cpp b/testfiles/unittest.cpp index 0ec8f0383..e33b4cb43 100644 --- a/testfiles/unittest.cpp +++ b/testfiles/unittest.cpp @@ -16,19 +16,6 @@ #include "inkgc/gc-core.h" #include "inkscape.h" -namespace { - -// Ensure that a known positive test works -TEST(PreTest, WorldIsSane) -{ - EXPECT_EQ(4, 2 + 2); -} - -// Example of type casting to avoid compile warnings. - - -} // namespace - int main(int argc, char **argv) { // setup general environment |
