27 #include "../client/client.h"
28 #include "../client/cl_lua.h"
29 #include "../client/renderer/r_state.h"
30 #include "../client/ui/ui_main.h"
31 #include "../client/battlescape/cl_particle.h"
32 #include "../client/cgame/campaign/cp_campaign.h"
58 const char* extensions[] = {
"png",
"tga",
"jpg",
nullptr};
64 while (extensions[i]) {
65 if (
FS_CheckFile(
"pics/%s.%s", path, extensions[i]) != -1)
75 const char* extensions[] = {
"md2",
"md3",
"obj",
nullptr};
80 while (extensions[i]) {
81 if (
FS_CheckFile(
"models/%s.%s", path, extensions[i]) != -1)
91 const char* extensions[] = {
"wav",
"ogg",
nullptr};
97 while (extensions[i]) {
98 if (
FS_CheckFile(
"sound/%s.%s", path, extensions[i]) != -1)
120 ASSERT_TRUE(teamDef->
numTemplates > 0) << teamDef->
id <<
" has no character templates assigned";
122 for (
int k = 0; k <
SND_MAX; k++) {
125 ASSERT_TRUE(
TEST_CheckSound(soundFile)) <<
"sound " << soundFile <<
" does not exist (team " << teamDef->
id <<
")";
154 ASSERT_TRUE(!
LIST_IsEmpty(armourPaths)) <<
"no armour definitions found for team " << teamDef->
id <<
" - but armour is set to true";
162 ASSERT_TRUE(
nullptr != teamDef->
models[l]);
168 ASSERT_TRUE(
TEST_CheckModel(
va(
"%s%s/%s", m.
path, armourPath, m.
body))) << m.
body <<
" does not exist in models/" << m.
path << armourPath <<
" (teamDef: " << teamDef->
id <<
")";
171 ASSERT_TRUE(
TEST_CheckModel(
va(
"%s%s/%s", m.
path, armourPath, m.
head))) << m.
head <<
" does not exist in models/" << m.
path << armourPath <<
" (teamDef: " << teamDef->
id <<
")";
209 ASSERT_TRUE(
TEST_CheckImage(
va(
"nations/%s", nation->id))) <<
"nation " << nation->id <<
" has no image";
217 ASSERT_TRUE(
TEST_CheckModel(aircraft->model)) << aircraft->model <<
" does not exist (aircraft: " << aircraft->id <<
")";
218 ASSERT_TRUE(
TEST_CheckImage(aircraft->image)) << aircraft->image <<
" does not exist (aircraft: " << aircraft->id <<
")";
233 ASSERT_TRUE(
nullptr != md->
mapTheme);
238 ASSERT_TRUE(
nullptr == md);
239 ASSERT_EQ(i,
csi.
numMDs) <<
"only looped over " << i <<
" mapdefs, but expected " <<
csi.
numMDs;
245 ASSERT_TRUE(
nullptr != md);
248 ASSERT_TRUE(
nullptr == md);
253 ASSERT_TRUE(
nullptr != md);
254 ASSERT_STRNE(md->
id,
"training_a");
255 ASSERT_STRNE(md->
id,
"training_b");
258 ASSERT_TRUE(
nullptr == md);
static void TearDownTestCase()
bool Q_strnull(const char *string)
int FS_CheckFile(const char *fmt,...)
Just returns the filelength and -1 if the file wasn't found.
this is a fire definition for our weapons/ammo
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
static bool TEST_CheckModel(const char *path)
void Com_ParseScripts(bool onlyServer)
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
linkedList_t * models[NAME_LAST]
const char * hitBodySound
void LIST_Delete(linkedList_t **list)
Defines all attributes of objects used in the inventory.
gltexunit_t texunits[MAX_GL_TEXUNITS]
const teamDef_t * Com_GetTeamDefinitionByID(const char *team)
Returns the teamDef pointer for the searched team id - or nullptr if not found in the teamDef array...
memPool_t * cl_genericPool
gltexunit_t * active_texunit
#define NAT_Foreach(var)
iterates trough nations
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
void LIST_AddString(linkedList_t **listDest, const char *data)
Adds an string to a new or to an already existing linked list. The string is copied here...
#define MapDef_ForeachCondition(var, condition)
void CL_InitLua(void)
Initializes the ui-lua interfacing environment.
static void SetUpTestCase()
static bool TEST_CheckParticle(const char *particleID)
static bool TEST_CheckSound(const char *path)
#define Mem_CreatePool(name)
TEST_F(ScriptTest, TeamDefs)
ptlDef_t * CL_ParticleGet(const char *name)
teamDef_t teamDef[MAX_TEAMDEFS]
const linkedList_t * LIST_ContainsString(const linkedList_t *list, const char *string)
Searches for the first occurrence of a given string.
#define MapDef_ForeachSingleplayerCampaign(var)
linkedList_t * sounds[SND_MAX][NAME_LAST]
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
memPool_t * vid_imagePool
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
#define MapDef_Foreach(var)
#define AIR_Foreach(var)
iterates trough all aircraft
bool LIST_IsEmpty(const linkedList_t *list)
Checks whether the given list is empty.
bool CHRSH_IsArmourUseableForTeam(const objDef_t *od, const teamDef_t *teamDef)
static bool TEST_CheckImage(const char *path)