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_steps (const quest_step_definition *ls, const 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 275 of file check_asset_load_write.cpp.

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

Referenced by check_steps().

+ Here is the caller graph for this function:

◆ check_steps()

void check_steps ( const quest_step_definition ls,
const quest_step_definition rs 
)

Definition at line 287 of file check_asset_load_write.cpp.

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

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 
)

Definition at line 95 of file check_asset_load_write.cpp.

References treasurestruct::chance, treasurestruct::magic, and treasurestruct::nrof.

Referenced by equal(), and START_TEST().

+ Here is the caller graph for this function:

◆ equal() [2/2]

bool equal ( const treasurelist left,
const treasurelist right 
)

Definition at line 107 of file check_asset_load_write.cpp.

References equal(), treasureliststruct::items, treasureliststruct::name, and treasureliststruct::total_chance.

+ Here is the call graph for this function:

◆ generate_animation()

static END_TEST Animations* generate_animation ( Faces faces)
static

Definition at line 139 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 220 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 176 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 32 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 251 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 80 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 238 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 348 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 23 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 332 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 151 of file check_asset_load_write.cpp.

References animate::anim, make_face_from_files::anims, dragon_attune::faces, 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 304 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]

START_TEST ( test_treasure  )

◆ teardown()

static void teardown ( void  )
static

Definition at line 28 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 43 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: