Crossfire Server, Trunk
check_asset_load_write.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include <check.h>
#include "global.h"
#include <toolkit_common.h>
#include <math.h>
#include "Archetypes.h"
#include "Treasures.h"
#include "TreasureLoader.h"
#include "TreasureWriter.h"
#include "AnimationWriter.h"
#include "FaceLoader.h"
#include "FaceWriter.h"
#include "Faces.h"
#include "Animations.h"
#include "assets.h"
#include "Quests.h"
#include "QuestLoader.h"
#include "QuestWriter.h"
+ Include dependency graph for check_asset_load_write.cpp:

Go to the source code of this file.

Functions

void check_conditions (const quest_condition *lc, const quest_condition *rc)
 
void check_step (const quest_step_definition *ls, const quest_step_definition *rs)
 
void check_steps (const std::vector< quest_step_definition * > &ls, const std::vector< quest_step_definition * > &rs)
 
bool equal (const treasure *left, treasure *right)
 
bool equal (const treasurelist *left, const treasurelist *right)
 
static END_TEST Animationsgenerate_animation (Faces &faces)
 
END_TEST quest_conditiongenerate_condition ()
 
static END_TEST Facegenerate_face (Faces &faces)
 
char * generate_name (size_t max_length)
 
quest_definitiongenerate_quest (Quests &quests, Faces &faces)
 
treasurelistgenerate_random_list (Archetypes &arches)
 
treasuregenerate_random_treasure (Archetypes &arches, int depth, bool single)
 
quest_step_definitiongenerate_step ()
 
int main (void)
 
static void setup (void)
 
static END_TEST Suite * shstr_suite (void)
 
 START_TEST (test_animation)
 
 START_TEST (test_face)
 
 START_TEST (test_quest)
 
 START_TEST (test_treasure)
 
static void teardown (void)
 
template<class T >
static void write_load (T *asset, AssetWriter< T > &writer, AssetLoader &loader)
 

Function Documentation

◆ check_conditions()

void check_conditions ( const quest_condition lc,
const quest_condition rc 
)

Definition at line 278 of file check_asset_load_write.cpp.

References quest_condition::maxstep, quest_condition::minstep, and quest_condition::quest_code.

Referenced by check_step().

+ Here is the caller graph for this function:

◆ check_step()

void check_step ( const quest_step_definition ls,
const quest_step_definition rs 
)

Definition at line 289 of file check_asset_load_write.cpp.

References check_conditions(), quest_step_definition::conditions, quest_step_definition::is_completion_step, quest_step_definition::step, and quest_step_definition::step_description.

Referenced by check_steps().

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

◆ check_steps()

void check_steps ( const std::vector< quest_step_definition * > &  ls,
const std::vector< quest_step_definition * > &  rs 
)

Definition at line 311 of file check_asset_load_write.cpp.

References check_step().

Referenced by START_TEST().

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

◆ equal() [1/2]

bool equal ( const treasure left,
treasure right 
)

◆ equal() [2/2]

bool equal ( const treasurelist left,
const treasurelist right 
)

Definition at line 113 of file check_asset_load_write.cpp.

References equal(), FAIL_UNLESS, treasurelist::items, treasurelist::name, and treasurelist::total_chance.

+ Here is the call graph for this function:

◆ generate_animation()

static END_TEST Animations* generate_animation ( Faces faces)
static

Definition at line 145 of file check_asset_load_write.cpp.

References animate::anim, dragon_attune::faces, generate_name(), and rndm().

Referenced by START_TEST().

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

◆ generate_condition()

END_TEST quest_condition* generate_condition ( )

Definition at line 226 of file check_asset_load_write.cpp.

References c, generate_name(), and rndm().

Referenced by generate_step().

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

◆ generate_face()

static END_TEST Face* generate_face ( Faces faces)
static

Definition at line 182 of file check_asset_load_write.cpp.

References FACE_FLOOR, dragon_attune::faces, generate_name(), Face::magicmap, Face::name, rndm(), Face::smoothface, and Face::visibility.

Referenced by START_TEST().

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

◆ generate_name()

char* generate_name ( size_t  max_length)

Definition at line 30 of file check_asset_load_write.cpp.

References buf, c, MIN, and rndm().

Referenced by generate_animation(), generate_condition(), generate_face(), generate_quest(), generate_random_list(), generate_random_treasure(), and generate_step().

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

◆ generate_quest()

quest_definition* generate_quest ( Quests quests,
Faces faces 
)

Definition at line 256 of file check_asset_load_write.cpp.

References add_string(), dragon_attune::faces, generate_name(), generate_step(), item::q, quests, and rndm().

Referenced by START_TEST().

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

◆ generate_random_list()

treasurelist* generate_random_list ( Archetypes arches)

Definition at line 81 of file check_asset_load_write.cpp.

References add_string(), generate_name(), generate_random_treasure(), guildoracle::list, and rndm().

Referenced by START_TEST().

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

◆ generate_random_treasure()

treasure* generate_random_treasure ( Archetypes arches,
int  depth,
bool  single 
)

◆ generate_step()

quest_step_definition* generate_step ( )

Definition at line 244 of file check_asset_load_write.cpp.

References c, generate_condition(), generate_name(), quest_step_definition::is_completion_step, and rndm().

Referenced by generate_quest().

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

◆ main()

int main ( void  )

Definition at line 362 of file check_asset_load_write.cpp.

References shstr_suite().

+ Here is the call graph for this function:

◆ setup()

static void setup ( void  )
static

Definition at line 21 of file check_asset_load_write.cpp.

References assets_init(), and init_hash_table().

Referenced by shstr_suite().

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

◆ shstr_suite()

static END_TEST Suite* shstr_suite ( void  )
static

Definition at line 346 of file check_asset_load_write.cpp.

References setup(), and teardown().

Referenced by main().

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

◆ START_TEST() [1/4]

START_TEST ( test_animation  )

Definition at line 157 of file check_asset_load_write.cpp.

References animate::anim, make_face_from_files::anims, dragon_attune::faces, FAIL_UNLESS, generate_animation(), and write_load().

+ Here is the call graph for this function:

◆ START_TEST() [2/4]

START_TEST ( test_face  )

◆ START_TEST() [3/4]

START_TEST ( test_quest  )

Definition at line 318 of file check_asset_load_write.cpp.

References check_steps(), dragon_attune::faces, generate_quest(), quests, and write_load().

+ Here is the call graph for this function:

◆ START_TEST() [4/4]

◆ teardown()

static void teardown ( void  )
static

Definition at line 26 of file check_asset_load_write.cpp.

References assets_free().

Referenced by shstr_suite().

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

◆ write_load()

template<class T >
static void write_load ( T *  asset,
AssetWriter< T > &  writer,
AssetLoader loader 
)
static

Definition at line 41 of file check_asset_load_write.cpp.

References bufferreader_destroy(), bufferreader_init_from_memory(), navar-midane_time::data, AssetLoader::load(), stringbuffer_finish(), stringbuffer_length(), stringbuffer_new(), and AssetWriter< T >::write().

Referenced by START_TEST().

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