mirror of https://github.com/mosra/magnum.git
7 changed files with 99 additions and 6 deletions
@ -1,2 +1,3 @@
|
||||
magnum_add_test(ObjectTest ObjectTest.h ObjectTest.cpp Magnum) |
||||
magnum_add_test(CameraTest CameraTest.h CameraTest.cpp Magnum) |
||||
magnum_add_test(SceneTest SceneTest.h SceneTest.cpp Magnum) |
||||
|
||||
@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright © 2010 Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
This file is part of Magnum. |
||||
|
||||
Magnum is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU Lesser General Public License version 3 |
||||
only, as published by the Free Software Foundation. |
||||
|
||||
Magnum is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU Lesser General Public License version 3 for more details. |
||||
*/ |
||||
|
||||
#include "SceneTest.h" |
||||
|
||||
#include <QtTest/QTest> |
||||
|
||||
#include "Scene.h" |
||||
|
||||
QTEST_APPLESS_MAIN(Magnum::Test::SceneTest) |
||||
|
||||
namespace Magnum { namespace Test { |
||||
|
||||
void SceneTest::parent() { |
||||
Scene scene; |
||||
|
||||
QVERIFY(scene.parent() == &scene); |
||||
|
||||
/* Scene parent cannot be changed */ |
||||
Object* scenePointer = &scene; |
||||
Object* object = new Object; |
||||
scenePointer->setParent(object); |
||||
QVERIFY(scene.parent() == &scene); |
||||
} |
||||
|
||||
}} |
||||
@ -0,0 +1,33 @@
|
||||
#ifndef Magnum_Test_SceneTest_h |
||||
#define Magnum_Test_SceneTest_h |
||||
/*
|
||||
Copyright © 2010 Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
This file is part of Magnum. |
||||
|
||||
Magnum is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU Lesser General Public License version 3 |
||||
only, as published by the Free Software Foundation. |
||||
|
||||
Magnum is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU Lesser General Public License version 3 for more details. |
||||
*/ |
||||
|
||||
#include <QtCore/QObject> |
||||
|
||||
#include "Object.h" |
||||
|
||||
namespace Magnum { namespace Test { |
||||
|
||||
class SceneTest: public QObject { |
||||
Q_OBJECT |
||||
|
||||
private slots: |
||||
void parent(); |
||||
}; |
||||
|
||||
}} |
||||
|
||||
#endif |
||||
Loading…
Reference in new issue