mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Move test filesystem creation to global fixture
This commit is contained in:
@@ -365,6 +365,7 @@ void CGObjectInstance::writeJsonOptions(JsonNode & json) const
|
|||||||
{
|
{
|
||||||
json.setType(JsonNode::DATA_STRUCT);
|
json.setType(JsonNode::DATA_STRUCT);
|
||||||
|
|
||||||
|
//todo: move up to descendants
|
||||||
if(tempOwner != PlayerColor::UNFLAGGABLE)
|
if(tempOwner != PlayerColor::UNFLAGGABLE)
|
||||||
{
|
{
|
||||||
PlayerColor p (tempOwner);
|
PlayerColor p (tempOwner);
|
||||||
|
@@ -12,11 +12,9 @@
|
|||||||
#include "StdInc.h"
|
#include "StdInc.h"
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
|
#include "../lib/filesystem/ResourceID.h"
|
||||||
#include "../lib/mapping/CMapService.h"
|
#include "../lib/mapping/CMapService.h"
|
||||||
#include "../lib/mapping/CMap.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/JsonNode.h"
|
||||||
#include "../lib/mapping/CMapEditManager.h"
|
#include "../lib/mapping/CMapEditManager.h"
|
||||||
#include "../lib/int3.h"
|
#include "../lib/int3.h"
|
||||||
@@ -117,10 +115,6 @@ BOOST_AUTO_TEST_CASE(CMapEditManager_DrawTerrain_View)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Load maps and json config
|
// 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");
|
const auto originalMap = CMapService::loadMap("test/TerrainViewTest");
|
||||||
auto map = CMapService::loadMap("test/TerrainViewTest");
|
auto map = CMapService::loadMap("test/TerrainViewTest");
|
||||||
logGlobal->infoStream() << "Loaded test map successfully.";
|
logGlobal->infoStream() << "Loaded test map successfully.";
|
||||||
|
@@ -18,6 +18,9 @@
|
|||||||
#include "../lib/VCMI_Lib.h"
|
#include "../lib/VCMI_Lib.h"
|
||||||
#include "../lib/logging/CLogger.h"
|
#include "../lib/logging/CLogger.h"
|
||||||
#include "../lib/CConfigHandler.h"
|
#include "../lib/CConfigHandler.h"
|
||||||
|
#include "../lib/filesystem/Filesystem.h"
|
||||||
|
#include "../lib/filesystem/CFilesystemLoader.h"
|
||||||
|
#include "../lib/filesystem/AdapterLoaders.h"
|
||||||
|
|
||||||
CVcmiTestConfig::CVcmiTestConfig()
|
CVcmiTestConfig::CVcmiTestConfig()
|
||||||
{
|
{
|
||||||
@@ -29,6 +32,11 @@ CVcmiTestConfig::CVcmiTestConfig()
|
|||||||
logConfig.configure();
|
logConfig.configure();
|
||||||
loadDLLClasses();
|
loadDLLClasses();
|
||||||
logGlobal->infoStream() << "Initialized global test setup.";
|
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()
|
CVcmiTestConfig::~CVcmiTestConfig()
|
||||||
|
Reference in New Issue
Block a user