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

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 221 of file check_item.c.

◆ 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 206 of file check_item.c.

Function Documentation

◆ item_suite()

static END_TEST Suite* item_suite ( void  )
static

Definition at line 400 of file check_item.c.

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 414 of file check_item.c.

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 39 of file check_item.c.

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 46 of file check_item.c.

Referenced by item_suite().

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