summaryrefslogtreecommitdiffstats
path: root/sigmod/test/TestMapWarp.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-02-24 15:53:15 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-02-24 15:53:15 -0500
commitdde935e48d44ca1b2b8ce993ae5bc187a8ca30fd (patch)
treef317e6de1e2f2a187221a3f4586a2d00ab174237 /sigmod/test/TestMapWarp.cpp
parentb3082840638dc89d48e621a0bf88f7887163ee08 (diff)
downloadsigen-dde935e48d44ca1b2b8ce993ae5bc187a8ca30fd.tar.gz
sigen-dde935e48d44ca1b2b8ce993ae5bc187a8ca30fd.tar.xz
sigen-dde935e48d44ca1b2b8ce993ae5bc187a8ca30fd.zip
Fixed sigmod tests to also use namespace Sigmod
Diffstat (limited to 'sigmod/test/TestMapWarp.cpp')
-rw-r--r--sigmod/test/TestMapWarp.cpp51
1 files changed, 27 insertions, 24 deletions
diff --git a/sigmod/test/TestMapWarp.cpp b/sigmod/test/TestMapWarp.cpp
index 4aac1443..4b3fdef7 100644
--- a/sigmod/test/TestMapWarp.cpp
+++ b/sigmod/test/TestMapWarp.cpp
@@ -19,19 +19,22 @@
#include "TestMapWarp.h"
// Sigmod includes
+#include "../Game.h"
#include "../Map.h"
#include "../MapWarp.h"
-#include "../Sigmod.h"
// Qt includes
#include <QtCore/QFile>
#include <QtTest/QTest>
+using namespace Sigcore;
+using namespace Sigmod;
+
void TestMapWarp::initTestCase()
{
TestSigmodObject::initTestCase();
- Sigmod::Map* map = m_sigmod->newMap();
+ Map* map = m_game->newMap();
m_warp1 = map->newWarp();
m_warp2 = map->newWarp();
@@ -74,8 +77,8 @@ void TestMapWarp::validation()
QCOMPARE(m_warnings.size(), 0);
QCOMPARE(m_errors.size(), 7);
- m_sigmod->map(0)->setWidth(20);
- m_sigmod->map(0)->setHeight(20);
+ m_game->map(0)->setWidth(20);
+ m_game->map(0)->setHeight(20);
m_warp1->setArea(QRect(0, 0, 5, 5));
m_warp1->validate();
@@ -83,16 +86,16 @@ void TestMapWarp::validation()
QCOMPARE(m_warnings.size(), 0);
QCOMPARE(m_errors.size(), 9);
- m_sigmod->map(0)->setWidth(3);
- m_sigmod->map(0)->setHeight(3);
+ m_game->map(0)->setWidth(3);
+ m_game->map(0)->setHeight(3);
m_warp1->validate();
QCOMPARE(m_warnings.size(), 0);
QCOMPARE(m_errors.size(), 12);
- m_sigmod->map(0)->setWidth(20);
- m_sigmod->map(0)->setHeight(20);
+ m_game->map(0)->setWidth(20);
+ m_game->map(0)->setHeight(20);
m_warp1->validate();
@@ -114,7 +117,7 @@ void TestMapWarp::validation()
void TestMapWarp::saving()
{
- QDomDocument xml = Sigmod::Object::xml(m_warp1);
+ QDomDocument xml = Object::xml(m_warp1);
QFile file("mapWarp.xml");
QVERIFY(file.open(QIODevice::WriteOnly));
@@ -127,14 +130,14 @@ void TestMapWarp::loading()
QDomDocument xml;
QFile file("mapWarp.xml");
- m_sigmod->newMap()->newWarp();
+ m_game->newMap()->newWarp();
m_warp1->setName("Bar");
m_warp1->setArea(QRect(1, 1, 3, 3));
- m_warp1->setType(Sigmod::MapWarp::Warp);
+ m_warp1->setType(MapWarp::Warp);
m_warp1->setToMap(1);
m_warp1->setToWarp(0);
- m_warp1->setScript(Sigcore::Script("python", "import os"));
+ m_warp1->setScript(Script("python", "import os"));
QVERIFY(file.open(QIODevice::ReadOnly));
QVERIFY(xml.setContent(&file));
@@ -142,10 +145,10 @@ void TestMapWarp::loading()
QCOMPARE(m_warp1->name(), QString("Foo"));
QCOMPARE(m_warp1->area(), QRect(0, 0, 5, 5));
- QCOMPARE(m_warp1->type(), Sigmod::MapWarp::Door);
+ QCOMPARE(m_warp1->type(), MapWarp::Door);
QCOMPARE(m_warp1->toMap(), 0);
QCOMPARE(m_warp1->toWarp(), 2);
- QCOMPARE(m_warp1->script(), Sigcore::Script());
+ QCOMPARE(m_warp1->script(), Script());
}
void TestMapWarp::setName()
@@ -196,10 +199,10 @@ void TestMapWarp::setArea()
void TestMapWarp::setType()
{
- m_warp2->setType(Sigmod::MapWarp::Warp);
- m_warp2->setType(Sigmod::MapWarp::Warp);
+ m_warp2->setType(MapWarp::Warp);
+ m_warp2->setType(MapWarp::Warp);
- QCOMPARE(m_warp2->type(), Sigmod::MapWarp::Warp);
+ QCOMPARE(m_warp2->type(), MapWarp::Warp);
QCOMPARE(m_changedCount, 1);
@@ -214,7 +217,7 @@ void TestMapWarp::setToMap()
QCOMPARE(m_warnings.size(), 0);
QCOMPARE(m_errors.size(), 1);
- m_sigmod->newMap();
+ m_game->newMap();
m_warp2->setToMap(2);
m_warp2->setToMap(2);
@@ -234,7 +237,7 @@ void TestMapWarp::setToWarp()
QCOMPARE(m_warnings.size(), 0);
QCOMPARE(m_errors.size(), 1);
- m_sigmod->map(2)->newWarp();
+ m_game->map(2)->newWarp();
m_warp2->setToWarp(0);
m_warp2->setToWarp(0);
@@ -249,10 +252,10 @@ void TestMapWarp::setToWarp()
void TestMapWarp::setScript()
{
- m_warp2->setScript(Sigcore::Script("python", "import os"));
- m_warp2->setScript(Sigcore::Script("python", "import os"));
+ m_warp2->setScript(Script("python", "import os"));
+ m_warp2->setScript(Script("python", "import os"));
- QCOMPARE(m_warp2->script(), Sigcore::Script("python", "import os"));
+ QCOMPARE(m_warp2->script(), Script("python", "import os"));
QCOMPARE(m_changedCount, 1);
@@ -266,10 +269,10 @@ void TestMapWarp::assignment()
QCOMPARE(m_warp3->name(), QString("Foo"));
QCOMPARE(m_warp3->area(), QRect(0, 0, 5, 5));
- QCOMPARE(m_warp3->type(), Sigmod::MapWarp::Warp);
+ QCOMPARE(m_warp3->type(), MapWarp::Warp);
QCOMPARE(m_warp3->toMap(), 2);
QCOMPARE(m_warp3->toWarp(), 0);
- QCOMPARE(m_warp3->script(), Sigcore::Script("python", "import os"));
+ QCOMPARE(m_warp3->script(), Script("python", "import os"));
}
QTEST_APPLESS_MAIN(TestMapWarp)