summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-08 19:48:26 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-08 19:48:26 +0300
commit196cc38da19b867eaa9419343dd6ecd8212af354 (patch)
treeafb2d39f88c213702a339cae6fa08f8248b5c1af /src/test
parenta80a1c69f8a5f4db88ade16e3b9d53f7b648be47 (diff)
downloadmv-196cc38da19b867eaa9419343dd6ecd8212af354.tar.gz
mv-196cc38da19b867eaa9419343dd6ecd8212af354.tar.bz2
mv-196cc38da19b867eaa9419343dd6ecd8212af354.tar.xz
mv-196cc38da19b867eaa9419343dd6ecd8212af354.zip
Fix compilation errors and warnings in different modes.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/testlauncher.cpp3
-rw-r--r--src/test/testlauncher.h5
-rw-r--r--src/test/testmain.cpp17
-rw-r--r--src/test/testmain.h4
4 files changed, 16 insertions, 13 deletions
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index 609198a97..6d79f2e8e 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -20,6 +20,8 @@
#include "test/testlauncher.h"
+#ifdef USE_OPENGL
+
#include "client.h"
#include "configuration.h"
#include "graphics.h"
@@ -248,3 +250,4 @@ int TestLauncher::calcFps(const timeval *const start, const timeval *const end,
return static_cast<long>(calls) * 1000 / mtime;
}
+#endif
diff --git a/src/test/testlauncher.h b/src/test/testlauncher.h
index af5c53578..baa20c921 100644
--- a/src/test/testlauncher.h
+++ b/src/test/testlauncher.h
@@ -21,6 +21,10 @@
#ifndef TEST_TESTLAUNCHER_H
#define TEST_TESTLAUNCHER_H
+#include "main.h"
+
+#ifdef USE_OPENGL
+
#include <fstream>
#include <string>
#include <sys/time.h>
@@ -57,4 +61,5 @@ class TestLauncher
std::ofstream file;
};
+#endif
#endif // TEST_TESTLAUNCHER_H
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp
index 535cfebc4..dec7b3248 100644
--- a/src/test/testmain.cpp
+++ b/src/test/testmain.cpp
@@ -18,8 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include "test/testmain.h"
+#ifdef USE_OPENGL
#include "utils/gettext.h"
#include "client.h"
@@ -205,7 +207,7 @@ int TestMain::exec(const bool testAudio)
void TestMain::writeConfig(const int openGLMode, const int rescale,
const int sound, const std::string &info,
- const int batchSize, const int detectMode)
+ const int batchSize A_UNUSED, const int detectMode)
{
mConfig.init(Client::getConfigDirectory() + "/config.xml");
@@ -297,39 +299,28 @@ int TestMain::invokeSoftwareRenderTest(std::string test)
int TestMain::invokeFastOpenGLRenderTest(std::string test)
{
-#if defined USE_OPENGL
mConfig.setValue("opengl", 1);
mConfig.write();
const int ret = execFileWait(fileName, fileName, "-t", test, 30);
log->log("%s: %d", test.c_str(), ret);
return ret;
-#else
- return -1;
-#endif
}
int TestMain::invokeFastOpenBatchTest(std::string test)
{
-#if defined USE_OPENGL
mConfig.setValue("opengl", 1);
mConfig.write();
const int ret = execFileWait(fileName, fileName, "-t", test, 30);
// log->log("%s: %d", test.c_str(), ret);
return ret;
-#else
- return -1;
-#endif
}
int TestMain::invokeSafeOpenGLRenderTest(std::string test)
{
-#if defined USE_OPENGL
mConfig.setValue("opengl", 2);
mConfig.write();
const int ret = execFileWait(fileName, fileName, "-t", test, 30);
log->log("%s: %d", test.c_str(), ret);
return ret;
-#else
- return -1;
-#endif
}
+#endif
diff --git a/src/test/testmain.h b/src/test/testmain.h
index 2367b7d1b..69d2b8f77 100644
--- a/src/test/testmain.h
+++ b/src/test/testmain.h
@@ -23,6 +23,9 @@
#include "configuration.h"
#include "logger.h"
+#include "main.h"
+
+#ifdef USE_OPENGL
#include <string>
@@ -70,4 +73,5 @@ class TestMain
Configuration mConfig;
};
+#endif
#endif // TEST_TESTMAIN_H