summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-29 12:56:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-29 12:56:16 +0300
commit1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f (patch)
tree3eea380919dae735fdbeacff314edf1ad06d26ab /src/test
parent0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5 (diff)
downloadmanaplus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.tar.gz
manaplus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.tar.bz2
manaplus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.tar.xz
manaplus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.zip
Move many variables from client into settings.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/testlauncher.cpp13
-rw-r--r--src/test/testmain.cpp12
2 files changed, 13 insertions, 12 deletions
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index 1bc51a7c7..cedc0c785 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -25,6 +25,7 @@
#include "client.h"
#include "graphicsmanager.h"
#include "graphicsvertexes.h"
+#include "settings.h"
#include "soundmanager.h"
#include "render/sdlgraphics.h"
@@ -58,8 +59,8 @@ TestLauncher::TestLauncher(std::string test) :
mTest(test),
file()
{
- file.open((client->getLocalDataDirectory()
- + std::string("/test.log")).c_str(), std::ios::out);
+ file.open((settings.localDataDir + std::string("/test.log")).c_str(),
+ std::ios::out);
}
TestLauncher::~TestLauncher()
@@ -340,9 +341,9 @@ int TestLauncher::testDye()
SurfaceImageHelper::combineSurface(image->mSDLSurface, nullptr,
surface, nullptr);
ImageWriter::writePNG(image->mSDLSurface,
- client->getTempDirectory() + "/testimage1.png");
+ settings.tempDir + "/testimage1.png");
ImageWriter::writePNG(surface,
- client->getTempDirectory() + "/testimage2.png");
+ settings.tempDir + "/testimage2.png");
}
rw = MPHYSFSRWOPS_openRead(
@@ -358,9 +359,9 @@ int TestLauncher::testDye()
SurfaceImageHelper::combineSurface(image->mSDLSurface,
nullptr, surface, nullptr);
ImageWriter::writePNG(image->mSDLSurface,
- client->getTempDirectory() + "/testimage3.png");
+ settings.tempDir + "/testimage3.png");
ImageWriter::writePNG(surface,
- client->getTempDirectory() + "/testimage4.png");
+ settings.tempDir + "/testimage4.png");
}
}
}
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp
index 894d40537..16d36dd35 100644
--- a/src/test/testmain.cpp
+++ b/src/test/testmain.cpp
@@ -24,6 +24,7 @@
#ifdef USE_OPENGL
#include "client.h"
+#include "settings.h"
#include "utils/delete2.h"
#include "utils/paths.h"
@@ -41,8 +42,7 @@ TestMain::TestMain() :
mConfig()
{
fileName = getSelfName();
- log->setLogFile(client->getLocalDataDirectory()
- + std::string("/manaplustest.log"));
+ log->setLogFile(settings.localDataDir + std::string("/manaplustest.log"));
}
TestMain::~TestMain()
@@ -52,7 +52,7 @@ TestMain::~TestMain()
void TestMain::initConfig()
{
- mConfig.init(client->getConfigDirectory() + "/test.xml");
+ mConfig.init(settings.configDir + "/test.xml");
// mConfig.setDefaultValues(getConfigDefaults());
mConfig.setValue("hwaccel", false);
@@ -246,7 +246,7 @@ void TestMain::writeConfig(const RenderType openGLMode,
const int textureSize,
const int detectMode)
{
- mConfig.init(client->getConfigDirectory() + "/config.xml");
+ mConfig.init(settings.configDir + "/config.xml");
log->log("set mode to %d", static_cast<int>(openGLMode));
@@ -290,8 +290,8 @@ int TestMain::readValue(const int ver, int def)
std::string tmp;
int var;
std::ifstream file;
- file.open((client->getLocalDataDirectory()
- + std::string("/test.log")).c_str(), std::ios::in);
+ file.open((settings.localDataDir + std::string("/test.log")).c_str(),
+ std::ios::in);
if (!getline(file, tmp))
{
file.close();