Crossfire Server, Trunk
|
#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"
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 Animations * | generate_animation (Faces &faces) |
END_TEST quest_condition * | generate_condition () |
static END_TEST Face * | generate_face (Faces &faces) |
char * | generate_name (size_t max_length) |
quest_definition * | generate_quest (Quests &quests, Faces &faces) |
treasurelist * | generate_random_list (Archetypes &arches) |
treasure * | generate_random_treasure (Archetypes &arches, int depth, bool single) |
quest_step_definition * | generate_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) |
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().
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().
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().
Definition at line 96 of file check_asset_load_write.cpp.
References treasure::artifact, treasure::chance, FAIL_UNLESS, treasure::item, treasure::list_magic_adjustment, treasure::list_magic_value, treasure::magic, treasure::name, and treasure::nrof.
Referenced by equal(), and START_TEST().
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.
|
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().
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().
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().
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().
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().
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().
treasure* generate_random_treasure | ( | Archetypes & | arches, |
int | depth, | ||
bool | single | ||
) |
Definition at line 56 of file check_asset_load_write.cpp.
References add_string(), treasure::artifact, treasure::chance, generate_name(), AssetsCollection< T, Key >::get(), treasure::item, treasure::list_magic_adjustment, treasure::list_magic_value, treasure::magic, treasure::name, treasure::next, treasure::next_no, treasure::next_yes, treasure::nrof, and rndm().
Referenced by generate_random_list().
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().
int main | ( | void | ) |
Definition at line 362 of file check_asset_load_write.cpp.
References shstr_suite().
|
static |
Definition at line 21 of file check_asset_load_write.cpp.
References assets_init(), and init_hash_table().
Referenced by shstr_suite().
|
static |
Definition at line 346 of file check_asset_load_write.cpp.
References setup(), and teardown().
Referenced by main().
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().
START_TEST | ( | test_face | ) |
Definition at line 201 of file check_asset_load_write.cpp.
References make_face_from_files::anims, dragon_attune::faces, generate_face(), Face::magicmap, Face::name, Face::smoothface, Face::visibility, and write_load().
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().
START_TEST | ( | test_treasure | ) |
Definition at line 125 of file check_asset_load_write.cpp.
References archininventory::arch, AssetsCollection< T, Key >::clear(), AssetsCollection< T, Key >::define(), equal(), FAIL_UNLESS, AssetsCollection< T, Key >::find(), generate_random_list(), and write_load().
|
static |
Definition at line 26 of file check_asset_load_write.cpp.
References assets_free().
Referenced by shstr_suite().
|
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().