Crossfire Server, Trunk
check_item.cpp File Reference
#include <global.h>
#include <stdlib.h>
#include <check.h>
#include <loader.h>
#include <toolkit_common.h>
#include "assets.h"
#include "AssetsManager.h"
+ Include dependency graph for check_item.cpp:

Go to the source code of this file.

Macros

#define DESCRIBE_ABILITY_SAFE(retbuf, variable, name, len, maxlen)
 
#define DESCRIBE_PATH_SAFE(retbuf, variable, name, len, maxlen)
 

Functions

static END_TEST Suite * item_suite (void)
 
int main (void)
 
static void old_describe_monster (const object *op, char *retbuf, size_t size)
 
static void setup (void)
 
 START_TEST (test_describe_item)
 
 START_TEST (test_describe_monster_rewrite)
 
static void teardown (void)
 

Macro Definition Documentation

◆ DESCRIBE_ABILITY_SAFE

#define DESCRIBE_ABILITY_SAFE (   retbuf,
  variable,
  name,
  len,
  maxlen 
)
Value:
if (variable) { \
int i, j = 0; \
safe_strcat(retbuf, "(" name ": ", len, maxlen); \
for (i = 0; i < NROFATTACKS; i++) \
if (variable&(1<<i)) { \
if (j) \
safe_strcat(retbuf, ", ", len, maxlen); \
else \
j = 1; \
safe_strcat(retbuf, attacks[i], len, maxlen); \
} \
safe_strcat(retbuf, ")", len, maxlen); \
}

Definition at line 223 of file check_item.cpp.

◆ DESCRIBE_PATH_SAFE

#define DESCRIBE_PATH_SAFE (   retbuf,
  variable,
  name,
  len,
  maxlen 
)
Value:
if (variable) { \
int i, j = 0; \
safe_strcat(retbuf, "(" name ": ", len, maxlen); \
for (i = 0; i < NRSPELLPATHS; i++) \
if (variable&(1<<i)) { \
if (j) \
safe_strcat(retbuf, ", ", len, maxlen); \
else \
j = 1; \
safe_strcat(retbuf, spellpathnames[i], len, maxlen); \
} \
safe_strcat(retbuf, ")", len, maxlen); \
}

Definition at line 208 of file check_item.cpp.

Function Documentation

◆ item_suite()

static END_TEST Suite* item_suite ( void  )
static

Definition at line 401 of file check_item.cpp.

References setup(), and teardown().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( void  )

Definition at line 415 of file check_item.cpp.

References item_suite().

+ Here is the call graph for this function:

◆ old_describe_monster()

static void old_describe_monster ( const object op,
char *  retbuf,
size_t  size 
)
static

◆ setup()

static void setup ( void  )
static

Definition at line 41 of file check_item.cpp.

References cctk_init_std_archetypes(), cctk_setdatadir(), cctk_setlog(), and init_gods().

Referenced by item_suite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ START_TEST() [1/2]

◆ START_TEST() [2/2]

◆ teardown()

static void teardown ( void  )
static

Definition at line 48 of file check_item.cpp.

Referenced by item_suite().

+ Here is the caller graph for this function:
spellpathnames
const char *const spellpathnames[NRSPELLPATHS]
Definition: init.cpp:240
NROFATTACKS
#define NROFATTACKS
Definition: attack.h:17
attacks
const char *const attacks[NROFATTACKS]
Definition: living.cpp:129
NRSPELLPATHS
#define NRSPELLPATHS
Definition: spells.h:40
give.name
name
Definition: give.py:27