summaryrefslogtreecommitdiffstats
path: root/sigmod/test/TestMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmod/test/TestMap.cpp')
-rw-r--r--sigmod/test/TestMap.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/sigmod/test/TestMap.cpp b/sigmod/test/TestMap.cpp
index b96fd371..95cbae13 100644
--- a/sigmod/test/TestMap.cpp
+++ b/sigmod/test/TestMap.cpp
@@ -19,25 +19,27 @@
#include "TestMap.h"
// Sigmod includes
+#include "../Game.h"
#include "../Map.h"
#include "../MapEffect.h"
#include "../MapTile.h"
#include "../MapTrainer.h"
#include "../MapWarp.h"
#include "../MapWildList.h"
-#include "../Sigmod.h"
// Qt includes
#include <QtCore/QFile>
#include <QtTest/QTest>
+using namespace Sigmod;
+
void TestMap::initTestCase()
{
TestSigmodObject::initTestCase();
- m_map1 = m_sigmod->newMap();
- m_map2 = m_sigmod->newMap();
- m_map3 = m_sigmod->newMap();
+ m_map1 = m_game->newMap();
+ m_map2 = m_game->newMap();
+ m_map3 = m_game->newMap();
}
void TestMap::cleanupTestCase()
@@ -114,7 +116,7 @@ void TestMap::validation()
void TestMap::saving()
{
- QDomDocument xml = Sigmod::Object::xml(m_map1);
+ QDomDocument xml = Object::xml(m_map1);
QFile file("map.xml");
QVERIFY(file.open(QIODevice::WriteOnly));
@@ -134,7 +136,7 @@ void TestMap::loading()
m_map1->newWildList();
m_map1->setName("Bar");
- m_map1->setType(Sigmod::Map::Dungeon);
+ m_map1->setType(Map::Dungeon);
m_map1->setWidth(5);
m_map1->setHeight(5);
@@ -143,7 +145,7 @@ void TestMap::loading()
m_map1->load(xml.firstChildElement("Map"));
QCOMPARE(m_map1->name(), QString("Foo"));
- QCOMPARE(m_map1->type(), Sigmod::Map::Outdoor);
+ QCOMPARE(m_map1->type(), Map::Outdoor);
QCOMPARE(m_map1->width(), 1);
QCOMPARE(m_map1->height(), 1);
QCOMPARE(m_map1->effectCount(), 1);
@@ -168,10 +170,10 @@ void TestMap::setName()
void TestMap::setType()
{
- m_map2->setType(Sigmod::Map::Dungeon);
- m_map2->setType(Sigmod::Map::Dungeon);
+ m_map2->setType(Map::Dungeon);
+ m_map2->setType(Map::Dungeon);
- QCOMPARE(m_map2->type(), Sigmod::Map::Dungeon);
+ QCOMPARE(m_map2->type(), Map::Dungeon);
QCOMPARE(m_changedCount, 1);
@@ -340,7 +342,7 @@ void TestMap::assignment()
*m_map3 = *m_map2;
QCOMPARE(m_map3->name(), QString("Foo"));
- QCOMPARE(m_map3->type(), Sigmod::Map::Dungeon);
+ QCOMPARE(m_map3->type(), Map::Dungeon);
QCOMPARE(m_map3->width(), 5);
QCOMPARE(m_map3->height(), 5);
QCOMPARE(m_map3->effectCount(), 2);