Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/tests/test_LOSTexture.h
Show All 21 Lines | |||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
class TestLOSTexture : public CxxTest::TestSuite | class TestLOSTexture : public CxxTest::TestSuite | ||||
{ | { | ||||
public: | public: | ||||
void test_basic() | void test_basic() | ||||
{ | { | ||||
CSimulation2 sim(NULL, g_ScriptRuntime, NULL); | CSimulation2 sim(nullptr, g_ScriptRuntime, nullptr); | ||||
CLOSTexture tex(sim); | CLOSTexture tex(sim); | ||||
const ssize_t size = 8; | const ssize_t size = 8; | ||||
u32 inputData[size*size] = { | u32 inputData[size*size] = { | ||||
2, 2, 2, 0, 0, 0, 0, 0, | 2, 2, 2, 0, 0, 0, 0, 0, | ||||
2, 2, 2, 0, 0, 0, 0, 0, | 2, 2, 2, 0, 0, 0, 0, 0, | ||||
2, 2, 2, 0, 0, 0, 0, 0, | 2, 2, 2, 0, 0, 0, 0, 0, | ||||
0, 0, 0, 0, 0, 0, 0, 0, | 0, 0, 0, 0, 0, 0, 0, 0, | ||||
Show All 18 Lines | |||||
// for (size_t i = 0; i < losData.size(); ++i) | // for (size_t i = 0; i < losData.size(); ++i) | ||||
// printf("%s %3d", i % (size_t)sqrt(losData.size()) ? "" : "\n", losData[i]); | // printf("%s %3d", i % (size_t)sqrt(losData.size()) ? "" : "\n", losData[i]); | ||||
TS_ASSERT_EQUALS(losData[0], 104); | TS_ASSERT_EQUALS(losData[0], 104); | ||||
} | } | ||||
void test_perf_DISABLED() | void test_perf_DISABLED() | ||||
{ | { | ||||
CSimulation2 sim(NULL, g_ScriptRuntime, NULL); | CSimulation2 sim(nullptr, g_ScriptRuntime, nullptr); | ||||
CLOSTexture tex(sim); | CLOSTexture tex(sim); | ||||
const ssize_t size = 257; | const ssize_t size = 257; | ||||
std::vector<u32> inputDataVec; | std::vector<u32> inputDataVec; | ||||
inputDataVec.resize(size*size); | inputDataVec.resize(size*size); | ||||
// LOS_MASK should be cmpRanageManager->GetSharedLosMask(1), | // LOS_MASK should be cmpRanageManager->GetSharedLosMask(1), | ||||
// but that would mean adding a huge mock component for this and it | // but that would mean adding a huge mock component for this and it | ||||
Show All 17 Lines |
Wildfire Games · Phabricator