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

Go to the source code of this file.

Functions

static END_TEST bool check_treasure_arch (object *op, const char **first, const char **last)
 
static END_TEST void check_treasure_inv (object *op, const char **items)
 
static END_TEST objectdo_artifact (const char *name)
 
static END_TEST void do_magic (int difficulty, uint8_t value, int8_t adjustment)
 
int main (void)
 
static void setup (void)
 
 START_TEST (test_add_treasure_in_list)
 
END_TEST START_TEST (test_artifact_invalid)
 
END_TEST START_TEST (test_artifact_not_existing)
 
 START_TEST (test_artifact_valid)
 
END_TEST START_TEST (test_create_treasure_all)
 
 START_TEST (test_create_treasure_one)
 
END_TEST START_TEST (test_magic_adjustment)
 
 START_TEST (test_magic_limit)
 
 START_TEST (test_magic_set)
 
END_TEST START_TEST (test_treasure_remove_item)
 
static void teardown (void)
 
static END_TEST Suite * treasure_suite (void)
 

Variables

const char * allTraps []
 
const char * empty [] = {NULL}
 

Function Documentation

◆ check_treasure_arch()

static END_TEST bool check_treasure_arch ( object op,
const char **  first,
const char **  last 
)
static

Definition at line 144 of file check_treasure.cpp.

References commongive::inv, and give::op.

Referenced by do_magic(), and START_TEST().

+ Here is the caller graph for this function:

◆ check_treasure_inv()

static END_TEST void check_treasure_inv ( object op,
const char **  items 
)
static

Definition at line 90 of file check_treasure.cpp.

References commongive::inv, and give::op.

Referenced by START_TEST().

+ Here is the caller graph for this function:

◆ do_artifact()

static END_TEST object* do_artifact ( const char *  name)
static

Definition at line 251 of file check_treasure.cpp.

References add_string(), create_archetype(), create_treasure(), treasureliststruct::items, give::name, Floor::t, treasureliststruct::total_chance, and try_find_archetype().

Referenced by START_TEST().

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

◆ do_magic()

static END_TEST void do_magic ( int  difficulty,
uint8_t  value,
int8_t  adjustment 
)
static

Definition at line 210 of file check_treasure.cpp.

References add_string(), allTraps, cf_srandom(), check_treasure_arch(), create_archetype(), create_treasure(), find_treasurelist(), GT_INVISIBLE, obj::inv, treasureliststruct::items, guildoracle::list, Floor::t, treasureliststruct::total_chance, and autojail::value.

Referenced by START_TEST().

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

◆ main()

int main ( void  )

Definition at line 309 of file check_treasure.cpp.

References treasure_suite().

+ Here is the call graph for this function:

◆ setup()

static void setup ( void  )
static

Definition at line 38 of file check_treasure.cpp.

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

Referenced by treasure_suite().

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

◆ START_TEST() [1/10]

START_TEST ( test_add_treasure_in_list  )

Definition at line 48 of file check_treasure.cpp.

References guildoracle::list, treasurestruct::next, and treasure_insert().

+ Here is the call graph for this function:

◆ START_TEST() [2/10]

END_TEST START_TEST ( test_artifact_invalid  )

Definition at line 275 of file check_treasure.cpp.

References do_artifact(), and obj::inv.

+ Here is the call graph for this function:

◆ START_TEST() [3/10]

END_TEST START_TEST ( test_artifact_not_existing  )

Definition at line 281 of file check_treasure.cpp.

References do_artifact(), and obj::inv.

+ Here is the call graph for this function:

◆ START_TEST() [4/10]

START_TEST ( test_artifact_valid  )

Definition at line 267 of file check_treasure.cpp.

References add_string(), obj::artifact, do_artifact(), obj::inv, and sstring.

+ Here is the call graph for this function:

◆ START_TEST() [5/10]

END_TEST START_TEST ( test_create_treasure_all  )

Definition at line 122 of file check_treasure.cpp.

References cf_srandom(), check_treasure_inv(), create_archetype(), create_treasure(), empty, find_treasurelist(), and guildoracle::list.

+ Here is the call graph for this function:

◆ START_TEST() [6/10]

START_TEST ( test_create_treasure_one  )

Definition at line 109 of file check_treasure.cpp.

References cf_srandom(), check_treasure_inv(), create_archetype(), create_treasure(), empty, find_treasurelist(), and guildoracle::list.

+ Here is the call graph for this function:

◆ START_TEST() [7/10]

END_TEST START_TEST ( test_magic_adjustment  )

Definition at line 246 of file check_treasure.cpp.

References do_magic().

+ Here is the call graph for this function:

◆ START_TEST() [8/10]

START_TEST ( test_magic_limit  )

◆ START_TEST() [9/10]

START_TEST ( test_magic_set  )

Definition at line 241 of file check_treasure.cpp.

References do_magic().

+ Here is the call graph for this function:

◆ START_TEST() [10/10]

END_TEST START_TEST ( test_treasure_remove_item  )

Definition at line 72 of file check_treasure.cpp.

References guildoracle::list, treasurestruct::next, treasure_insert(), and treasure_remove_item().

+ Here is the call graph for this function:

◆ teardown()

static void teardown ( void  )
static

Definition at line 44 of file check_treasure.cpp.

Referenced by treasure_suite().

+ Here is the caller graph for this function:

◆ treasure_suite()

static END_TEST Suite* treasure_suite ( void  )
static

Definition at line 287 of file check_treasure.cpp.

References setup(), and teardown().

Referenced by main().

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

Variable Documentation

◆ allTraps

const char* allTraps[]
Initial value:
= {
"rune_medium_fireball",
"rune_burning_hands",
"rune_poison_cloud",
"rune_create_bomb",
"rune_paralysis",
"rune_shock",
"rune_confusion",
"rune_icestorm",
"rune_drain_magic",
"rune_blast",
"rune_fire",
"rune_frost",
"rune_summon_air_elemental",
"rune_dragonbreath",
"rune_large_icestorm",
"rune_large_fireball",
"rune_ball_lightning",
"rune_summon_devil",
"rune_summon_earth_elemental",
"rune_summon_fire_elemental",
"rune_summon_water_elemental",
"rune_death",
NULL}

Definition at line 157 of file check_treasure.cpp.

Referenced by do_magic(), and START_TEST().

◆ empty

const char* empty[] = {NULL}