Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/tests/test_NetMessage.h
Show All 20 Lines | |||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
class TestNetMessage : public CxxTest::TestSuite | class TestNetMessage : public CxxTest::TestSuite | ||||
{ | { | ||||
public: | public: | ||||
void test_sim() | void test_sim() | ||||
{ | { | ||||
ScriptInterface script("Test", "Test", g_ScriptRuntime); | ScriptInterface script("Test", "Test", g_ScriptContext); | ||||
ScriptInterface::Request rq(script); | ScriptInterface::Request rq(script); | ||||
JS::RootedValue val(rq.cx); | JS::RootedValue val(rq.cx); | ||||
ScriptInterface::CreateArray(rq, &val); | ScriptInterface::CreateArray(rq, &val); | ||||
script.SetPropertyInt(val, 0, 4); | script.SetPropertyInt(val, 0, 4); | ||||
CSimulationMessage msg(script, 1, 2, 3, val); | CSimulationMessage msg(script, 1, 2, 3, val); | ||||
TS_ASSERT_STR_EQUALS(msg.ToString(), "CSimulationMessage { m_Client: 1, m_Player: 2, m_Turn: 3, m_Data: [4] }"); | TS_ASSERT_STR_EQUALS(msg.ToString(), "CSimulationMessage { m_Client: 1, m_Player: 2, m_Turn: 3, m_Data: [4] }"); | ||||
Show All 14 Lines |
Wildfire Games · Phabricator