1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Move test filesystem creation to global fixture

This commit is contained in:
AlexVinS 2015-11-16 14:43:44 +03:00
parent 126a821960
commit 6977fc3a14
3 changed files with 10 additions and 7 deletions

View File

@ -365,6 +365,7 @@ void CGObjectInstance::writeJsonOptions(JsonNode & json) const
{
json.setType(JsonNode::DATA_STRUCT);
//todo: move up to descendants
if(tempOwner != PlayerColor::UNFLAGGABLE)
{
PlayerColor p (tempOwner);

View File

@ -12,11 +12,9 @@
#include "StdInc.h"
#include <boost/test/unit_test.hpp>
#include "../lib/filesystem/ResourceID.h"
#include "../lib/mapping/CMapService.h"
#include "../lib/mapping/CMap.h"
#include "../lib/filesystem/Filesystem.h"
#include "../lib/filesystem/CFilesystemLoader.h"
#include "../lib/filesystem/AdapterLoaders.h"
#include "../lib/JsonNode.h"
#include "../lib/mapping/CMapEditManager.h"
#include "../lib/int3.h"
@ -117,10 +115,6 @@ BOOST_AUTO_TEST_CASE(CMapEditManager_DrawTerrain_View)
try
{
// Load maps and json config
const std::string TEST_DATA_DIR = "test/";
auto loader = new CFilesystemLoader("test/", TEST_DATA_DIR);
dynamic_cast<CFilesystemList*>(CResourceHandler::get())->addLoader(loader, false);
const auto originalMap = CMapService::loadMap("test/TerrainViewTest");
auto map = CMapService::loadMap("test/TerrainViewTest");
logGlobal->infoStream() << "Loaded test map successfully.";

View File

@ -18,6 +18,9 @@
#include "../lib/VCMI_Lib.h"
#include "../lib/logging/CLogger.h"
#include "../lib/CConfigHandler.h"
#include "../lib/filesystem/Filesystem.h"
#include "../lib/filesystem/CFilesystemLoader.h"
#include "../lib/filesystem/AdapterLoaders.h"
CVcmiTestConfig::CVcmiTestConfig()
{
@ -29,6 +32,11 @@ CVcmiTestConfig::CVcmiTestConfig()
logConfig.configure();
loadDLLClasses();
logGlobal->infoStream() << "Initialized global test setup.";
const std::string TEST_DATA_DIR = "test/";
auto loader = new CFilesystemLoader("test/", TEST_DATA_DIR);
dynamic_cast<CFilesystemList*>(CResourceHandler::get())->addLoader(loader, false);
}
CVcmiTestConfig::~CVcmiTestConfig()