Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/tests/test_RangeManager.h
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | void test_basic() | ||||
test.AddMock(100, IID_Vision, vision); | test.AddMock(100, IID_Vision, vision); | ||||
MockPosition position; | MockPosition position; | ||||
test.AddMock(100, IID_Position, position); | test.AddMock(100, IID_Position, position); | ||||
// This tests that the incremental computation produces the correct result | // This tests that the incremental computation produces the correct result | ||||
// in various edge cases | // in various edge cases | ||||
cmp->SetBounds(entity_pos_t::FromInt(0), entity_pos_t::FromInt(0), entity_pos_t::FromInt(512), entity_pos_t::FromInt(512), 512/TERRAIN_TILE_SIZE + 1); | cmp->SetBounds(entity_pos_t::FromInt(0), entity_pos_t::FromInt(0), entity_pos_t::FromInt(512), entity_pos_t::FromInt(512)); | ||||
cmp->Verify(); | cmp->Verify(); | ||||
{ CMessageCreate msg(100); cmp->HandleMessage(msg, false); } | { CMessageCreate msg(100); cmp->HandleMessage(msg, false); } | ||||
cmp->Verify(); | cmp->Verify(); | ||||
{ CMessageOwnershipChanged msg(100, -1, 1); cmp->HandleMessage(msg, false); } | { CMessageOwnershipChanged msg(100, -1, 1); cmp->HandleMessage(msg, false); } | ||||
cmp->Verify(); | cmp->Verify(); | ||||
{ CMessagePositionChanged msg(100, true, entity_pos_t::FromInt(247), entity_pos_t::FromDouble(257.95), entity_angle_t::Zero()); cmp->HandleMessage(msg, false); } | { CMessagePositionChanged msg(100, true, entity_pos_t::FromInt(247), entity_pos_t::FromDouble(257.95), entity_angle_t::Zero()); cmp->HandleMessage(msg, false); } | ||||
cmp->Verify(); | cmp->Verify(); | ||||
{ CMessagePositionChanged msg(100, true, entity_pos_t::FromInt(247), entity_pos_t::FromInt(253), entity_angle_t::Zero()); cmp->HandleMessage(msg, false); } | { CMessagePositionChanged msg(100, true, entity_pos_t::FromInt(247), entity_pos_t::FromInt(253), entity_angle_t::Zero()); cmp->HandleMessage(msg, false); } | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator