MCPcopy Create free account
hub / github.com/ddnet/ddnet / TEST_F

Function TEST_F

src/test/gameworld_test.cpp:137–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135};
136
137TEST_F(CTestGameWorld, ClosestCharacter)
138{
139 CNetObj_PlayerInput Input = {};
140 CCharacter *pChr1 = new(0) CCharacter(&GameServer()->m_World, Input);
141 pChr1->m_Pos = vec2(0, 0);
142 GameServer()->m_World.InsertEntity(pChr1);
143
144 CCharacter *pChr2 = new(1) CCharacter(&GameServer()->m_World, Input);
145 pChr2->m_Pos = vec2(10, 10);
146 GameServer()->m_World.InsertEntity(pChr2);
147
148 CCharacter *pClosest = GameServer()->m_World.ClosestCharacter(vec2(1, 1), 20, nullptr);
149 EXPECT_EQ(pClosest, pChr1);
150}
151
152TEST_F(CTestGameWorld, IntersectEntity)
153{

Callers

nothing calls this directly

Calls 15

ClosestCharacterMethod · 0.80
GetAutoTeamMethod · 0.80
CreatePlayerMethod · 0.80
OnTickMethod · 0.80
ForceSpawnMethod · 0.80
GetCharacterMethod · 0.80
SetAfkMethod · 0.80
DetermineEyeEmoteMethod · 0.80
SetJetpackMethod · 0.80
SetEmoteMethod · 0.80
TickSpeedMethod · 0.80
InsertEntityMethod · 0.45

Tested by

no test coverage detected