Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/tests/test_Pathfinder.h
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 13 Lines | |||||
#include "graphics/MapReader.h" | #include "graphics/MapReader.h" | ||||
#include "graphics/Terrain.h" | #include "graphics/Terrain.h" | ||||
#include "graphics/TerrainTextureManager.h" | #include "graphics/TerrainTextureManager.h" | ||||
#include "lib/timer.h" | #include "lib/timer.h" | ||||
#include "lib/tex/tex.h" | #include "lib/tex/tex.h" | ||||
#include "ps/Loader.h" | #include "ps/Loader.h" | ||||
#include "ps/Pyrogenesis.h" | #include "ps/Pyrogenesis.h" | ||||
#include "scriptinterface/ScriptContext.h" | |||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
class TestCmpPathfinder : public CxxTest::TestSuite | class TestCmpPathfinder : public CxxTest::TestSuite | ||||
{ | { | ||||
public: | public: | ||||
void setUp() | void setUp() | ||||
{ | { | ||||
g_VFS = CreateVfs(); | g_VFS = CreateVfs(); | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | void test_performance_DISABLED() | ||||
CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
std::unique_ptr<CMapReader> mapReader(new CMapReader()); | std::unique_ptr<CMapReader> mapReader(new CMapReader()); | ||||
LDR_BeginRegistering(); | LDR_BeginRegistering(); | ||||
mapReader->LoadMap(L"maps/skirmishes/Median Oasis (2).pmp", | mapReader->LoadMap(L"maps/skirmishes/Median Oasis (2).pmp", | ||||
sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | *sim2.GetScriptInterface().GetContext(), JS::UndefinedHandleValue, | ||||
&terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||||
&sim2, &sim2.GetSimContext(), -1, false); | &sim2, &sim2.GetSimContext(), -1, false); | ||||
LDR_EndRegistering(); | LDR_EndRegistering(); | ||||
TS_ASSERT_OK(LDR_NonprogressiveLoad()); | TS_ASSERT_OK(LDR_NonprogressiveLoad()); | ||||
sim2.PreInitGame(); | sim2.PreInitGame(); | ||||
sim2.InitGame(); | sim2.InitGame(); | ||||
sim2.Update(0); | sim2.Update(0); | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | void test_perf2_DISABLED() | ||||
CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
std::unique_ptr<CMapReader> mapReader(new CMapReader()); | std::unique_ptr<CMapReader> mapReader(new CMapReader()); | ||||
LDR_BeginRegistering(); | LDR_BeginRegistering(); | ||||
mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | ||||
sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | *sim2.GetScriptInterface().GetContext(), JS::UndefinedHandleValue, | ||||
&terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||||
&sim2, &sim2.GetSimContext(), -1, false); | &sim2, &sim2.GetSimContext(), -1, false); | ||||
LDR_EndRegistering(); | LDR_EndRegistering(); | ||||
TS_ASSERT_OK(LDR_NonprogressiveLoad()); | TS_ASSERT_OK(LDR_NonprogressiveLoad()); | ||||
sim2.PreInitGame(); | sim2.PreInitGame(); | ||||
sim2.InitGame(); | sim2.InitGame(); | ||||
sim2.Update(0); | sim2.Update(0); | ||||
Show All 40 Lines | void test_perf3_DISABLED() | ||||
CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | CSimulation2 sim2(NULL, g_ScriptContext, &terrain); | ||||
sim2.LoadDefaultScripts(); | sim2.LoadDefaultScripts(); | ||||
sim2.ResetState(); | sim2.ResetState(); | ||||
std::unique_ptr<CMapReader> mapReader(new CMapReader()); | std::unique_ptr<CMapReader> mapReader(new CMapReader()); | ||||
LDR_BeginRegistering(); | LDR_BeginRegistering(); | ||||
mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | mapReader->LoadMap(L"maps/scenarios/Peloponnese.pmp", | ||||
sim2.GetScriptInterface().GetJSRuntime(), JS::UndefinedHandleValue, | *sim2.GetScriptInterface().GetContext(), JS::UndefinedHandleValue, | ||||
&terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||||
&sim2, &sim2.GetSimContext(), -1, false); | &sim2, &sim2.GetSimContext(), -1, false); | ||||
LDR_EndRegistering(); | LDR_EndRegistering(); | ||||
TS_ASSERT_OK(LDR_NonprogressiveLoad()); | TS_ASSERT_OK(LDR_NonprogressiveLoad()); | ||||
sim2.PreInitGame(); | sim2.PreInitGame(); | ||||
sim2.InitGame(); | sim2.InitGame(); | ||||
sim2.Update(0); | sim2.Update(0); | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator