UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
test_particles.cpp
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18
See the GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
*/
24
25
#include "
test_shared.h
"
26
#include "
../client/client.h
"
27
#include "
../client/cl_lua.h
"
28
#include "
../client/battlescape/cl_particle.h
"
29
#include "
../client/renderer/r_state.h
"
30
#include "
../client/ui/ui_main.h
"
31
32
class
ParticleTest
:
public
::testing::Test {
33
protected
:
34
static
void
SetUpTestCase
() {
35
TEST_Init
();
36
PTL_InitStartup
();
37
vid_imagePool
=
Mem_CreatePool
(
"Vid: Image system"
);
38
39
cl_genericPool
=
Mem_CreatePool
(
"Client: Generic"
);
40
41
r_state
.active_texunit = &
r_state
.texunits[0];
42
R_FontInit
();
43
CL_InitLua
();
44
UI_Init
();
45
46
OBJZERO
(
cls
);
47
Com_ParseScripts
(
false
);
48
}
49
50
static
void
TearDownTestCase
() {
51
TEST_Shutdown
();
52
}
53
};
54
55
TEST_F
(
ParticleTest
, FloodParticles)
56
{
57
for
(
int
i
= 0;
i
<
MAX_PTLS
;
i
++) {
58
ASSERT_TRUE(
nullptr
!=
CL_ParticleSpawn
(
"fire"
, 0xFF,
vec3_origin
));
59
}
60
CL_ParticleRun
();
61
ASSERT_TRUE(
nullptr
==
CL_ParticleSpawn
(
"fire"
, 0xFF,
vec3_origin
));
62
}
63
64
TEST_F
(
ParticleTest
, NeededParticles)
65
{
66
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"fadeTracer"
));
67
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"longRangeTracer"
));
68
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"inRangeTracer"
));
69
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"crawlTracer"
));
70
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"moveTracer"
));
71
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"stunnedactor"
));
72
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"circle"
));
73
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"cross"
));
74
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"cross_no"
));
75
ASSERT_TRUE(
nullptr
!=
CL_ParticleGet
(
"lightTracerDebug"
));
76
}
CL_InitLua
void CL_InitLua(void)
Initializes the ui-lua interfacing environment.
Definition
cl_lua.cpp:130
cl_lua.h
vid_imagePool
memPool_t * vid_imagePool
Definition
cl_main.cpp:88
cls
client_static_t cls
Definition
cl_main.cpp:83
cl_genericPool
memPool_t * cl_genericPool
Definition
cl_main.cpp:86
PTL_InitStartup
void PTL_InitStartup(void)
Clears particle data.
Definition
cl_particle.cpp:1475
CL_ParticleGet
ptlDef_t * CL_ParticleGet(const char *name)
Definition
cl_particle.cpp:678
CL_ParticleSpawn
ptl_t * CL_ParticleSpawn(const char *name, int levelFlags, const vec3_t s, const vec3_t v, const vec3_t a)
Spawn a new particle to the map.
Definition
cl_particle.cpp:705
CL_ParticleRun
void CL_ParticleRun(void)
General system for particle running during the game.
Definition
cl_particle.cpp:1148
cl_particle.h
R_FontInit
void R_FontInit(void)
Definition
r_font.cpp:716
MAX_PTLS
#define MAX_PTLS
Definition
cl_renderer.h:44
ParticleTest
Definition
test_particles.cpp:32
ParticleTest::SetUpTestCase
static void SetUpTestCase()
Definition
test_particles.cpp:34
ParticleTest::TearDownTestCase
static void TearDownTestCase()
Definition
test_particles.cpp:50
client.h
Primary header for client.
vec3_origin
const vec3_t vec3_origin
Definition
mathlib.cpp:35
Mem_CreatePool
#define Mem_CreatePool(name)
Definition
mem.h:32
i
QGL_EXTERN GLint i
Definition
r_gl.h:113
r_state
rstate_t r_state
Definition
r_main.cpp:48
r_state.h
Com_ParseScripts
void Com_ParseScripts(bool onlyServer)
Definition
scripts.cpp:3619
OBJZERO
#define OBJZERO(obj)
Definition
shared.h:178
TEST_F
TEST_F(ParticleTest, FloodParticles)
Definition
test_particles.cpp:55
TEST_Shutdown
void TEST_Shutdown(void)
Definition
test_shared.cpp:34
TEST_Init
void TEST_Init(void)
Definition
test_shared.cpp:72
test_shared.h
UI_Init
void UI_Init(void)
Definition
ui_main.cpp:278
ui_main.h
src
tests
test_particles.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0