58 const char* extensions[] = {
"png",
"tga",
"jpg",
nullptr};
64 while (extensions[
i]) {
75 const char* extensions[] = {
"md2",
"md3",
"obj",
nullptr};
80 while (extensions[
i]) {
91 const char* extensions[] = {
"wav",
"ogg",
nullptr};
97 while (extensions[
i]) {
117 for (
int i = 0;
i <
csi.numTeamDefs;
i++) {
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 <<
")";
136 for (
int i = 0;
i <
csi.numTeamDefs;
i++) {
141 for (
int j = 0; j <
csi.numODs; j++) {
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]);
167 ASSERT_TRUE(
TEST_CheckModel(
va(
"%s/%s",
m.path,
m.body))) <<
m.body <<
" does not exist in models/" <<
m.path <<
" (teamDef: " << teamDef->
id <<
")";
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 <<
")";
170 ASSERT_TRUE(
TEST_CheckModel(
va(
"%s/%s",
m.path,
m.head))) <<
m.head <<
" does not exist in models/" <<
m.path <<
" (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 <<
")";
182 for (
int j = 0; j <
csi.numODs; j++) {
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);
249 ASSERT_NE(
i,
csi.numMDs);
253 ASSERT_TRUE(
nullptr != md);
254 ASSERT_STRNE(md->
id,
"training_a");
255 ASSERT_STRNE(md->
id,
"training_b");
258 ASSERT_TRUE(
nullptr == md);
bool CHRSH_IsArmourUseableForTeam(const objDef_t *od, const teamDef_t *teamDef)
void CL_InitLua(void)
Initializes the ui-lua interfacing environment.
memPool_t * vid_imagePool
memPool_t * cl_genericPool
ptlDef_t * CL_ParticleGet(const char *name)
#define MapDef_ForeachSingleplayerCampaign(var)
static void TearDownTestCase()
static void SetUpTestCase()
Primary header for client.
#define AIR_Foreach(var)
iterates trough all aircraft
Header file for single player campaign control.
#define NAT_Foreach(var)
iterates trough nations
int FS_CheckFile(const char *fmt,...)
Just returns the filelength and -1 if the file wasn't found.
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
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.
void LIST_Delete(linkedList_t **list)
bool LIST_IsEmpty(const linkedList_t *list)
Checks whether the given list is empty.
const linkedList_t * LIST_ContainsString(const linkedList_t *list, const char *string)
Searches for the first occurrence of a given string.
#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 ...
#define Mem_CreatePool(name)
#define MapDef_ForeachCondition(var, condition)
#define MapDef_Foreach(var)
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.
void Com_ParseScripts(bool onlyServer)
bool Q_strnull(const char *string)
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...
this is a fire definition for our weapons/ammo
const char * hitBodySound
Defines all attributes of objects used in the inventory.
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
linkedList_t * sounds[SND_MAX][NAME_LAST]
linkedList_t * models[NAME_LAST]
static bool TEST_CheckParticle(const char *particleID)
static bool TEST_CheckSound(const char *path)
static bool TEST_CheckImage(const char *path)
TEST_F(ScriptTest, TeamDefs)
static bool TEST_CheckModel(const char *path)