Crossfire Server, Trunk
R21670
|
#include <global.h>
#include <stdlib.h>
#include <check.h>
#include <loader.h>
#include <toolkit_common.h>
#include "stringbuffer.h"
Go to the source code of this file.
Macros | |
#define | IS_OBJECT_ACTIVE(op) (op->active_next || op->active_prev || op == active_objects) |
Functions | |
int | main (void) |
static END_TEST Suite * | object_suite (void) |
static void | setup (void) |
START_TEST (test_object_can_merge) | |
END_TEST | START_TEST (test_object_sum_weight) |
END_TEST | START_TEST (test_object_get_env_recursive) |
END_TEST | START_TEST (test_object_get_player_container) |
END_TEST | START_TEST (test_object_dump) |
END_TEST | START_TEST (test_object_dump_all) |
END_TEST | START_TEST (test_object_find_by_tag_global) |
END_TEST | START_TEST (test_object_find_by_name_global) |
END_TEST | START_TEST (test_object_free_all_data) |
END_TEST | START_TEST (test_object_get_owner) |
END_TEST | START_TEST (test_object_clear_owner) |
END_TEST | START_TEST (test_object_set_owner) |
END_TEST | START_TEST (test_object_copy_owner) |
END_TEST | START_TEST (test_object_reset) |
END_TEST | START_TEST (test_object_clear) |
END_TEST | START_TEST (test_object_copy) |
END_TEST | START_TEST (test_object_new) |
END_TEST | START_TEST (test_object_update_turn_face) |
START_TEST (test_object_update_speed) | |
END_TEST | START_TEST (test_object_remove_from_active_list) |
END_TEST | START_TEST (test_object_update) |
END_TEST | START_TEST (test_object_free_drop_inventory) |
END_TEST | START_TEST (test_object_count_free) |
END_TEST | START_TEST (test_object_count_used) |
END_TEST | START_TEST (test_object_count_active) |
END_TEST | START_TEST (test_object_sub_weight) |
END_TEST | START_TEST (test_object_remove) |
END_TEST | START_TEST (test_object_merge) |
END_TEST | START_TEST (test_object_insert_in_map_at) |
END_TEST | START_TEST (test_object_insert_in_map) |
END_TEST | START_TEST (test_object_replace_insert_in_map) |
END_TEST | START_TEST (test_object_split) |
END_TEST | START_TEST (test_object_decrease_nrof) |
END_TEST | START_TEST (test_object_add_weight) |
END_TEST | START_TEST (test_object_insert_in_ob) |
END_TEST | START_TEST (test_object_check_move_on) |
END_TEST | START_TEST (test_map_find_by_archetype) |
END_TEST | START_TEST (test_map_find_by_type) |
END_TEST | START_TEST (test_object_present_in_ob) |
END_TEST | START_TEST (test_object_present_in_ob_by_name) |
END_TEST | START_TEST (test_arch_present_in_ob) |
END_TEST | START_TEST (test_object_set_flag_inv) |
END_TEST | START_TEST (test_object_unset_flag_inv) |
END_TEST | START_TEST (test_object_set_cheat) |
END_TEST | START_TEST (test_object_find_free_spot) |
END_TEST | START_TEST (test_object_find_first_free_spot) |
END_TEST | START_TEST (test_get_search_arr) |
END_TEST | START_TEST (test_map_find_dir) |
END_TEST | START_TEST (test_object_distance) |
END_TEST | START_TEST (test_find_dir_2) |
END_TEST | START_TEST (test_absdir) |
END_TEST | START_TEST (test_dirdiff) |
END_TEST | START_TEST (test_can_see_monsterP) |
END_TEST | START_TEST (test_object_can_pick) |
END_TEST | START_TEST (test_object_create_clone) |
END_TEST | START_TEST (test_object_was_destroyed) |
END_TEST | START_TEST (test_object_find_by_type_subtype) |
END_TEST | START_TEST (test_object_get_key_value) |
END_TEST | START_TEST (test_object_get_value) |
END_TEST | START_TEST (test_object_set_value) |
END_TEST | START_TEST (test_object_matches_string) |
static void | teardown (void) |
#define IS_OBJECT_ACTIVE | ( | op | ) | (op->active_next || op->active_prev || op == active_objects) |
Definition at line 459 of file check_object.c.
Referenced by START_TEST().
int main | ( | void | ) |
Definition at line 1259 of file check_object.c.
References object_suite().
|
static |
Definition at line 1186 of file check_object.c.
References setup(), and teardown().
Referenced by main().
|
static |
Definition at line 41 of file check_object.c.
References cctk_init_std_archetypes(), cctk_setdatadir(), and cctk_setlog().
Referenced by object_suite().
START_TEST | ( | test_object_can_merge | ) |
This is the test to check the behaviour of the method int object_can_merge(object *ob1, object *ob2);
Definition at line 102 of file check_object.c.
References add_string(), cctk_create_game_object(), obj::name, obj::nrof, object_can_merge(), and obj::type.
END_TEST START_TEST | ( | test_object_sum_weight | ) |
This is the test to check the behaviour of the method signed long object_sum_weight(object *op);
Definition at line 125 of file check_object.c.
References cctk_create_game_object(), CONTAINER, obj::nrof, object_insert_in_ob(), object_sum_weight(), obj::stats, liv::Str, obj::type, and obj::weight.
END_TEST START_TEST | ( | test_object_get_env_recursive | ) |
This is the test to check the behaviour of the method object *object_get_env_recursive(object *op);
Definition at line 154 of file check_object.c.
References cctk_create_game_object(), object_get_env_recursive(), and object_insert_in_ob().
END_TEST START_TEST | ( | test_object_get_player_container | ) |
This is the test to check the behaviour of the method object *object_get_player_container(object *op);
Definition at line 176 of file check_object.c.
References cctk_create_game_object(), object_get_player_container(), object_insert_in_ob(), PLAYER, and obj::type.
END_TEST START_TEST | ( | test_object_dump | ) |
This is the test to check the behaviour of the method void object_dump(object *op);
Definition at line 201 of file check_object.c.
References cctk_create_game_object(), object_dump(), object_insert_in_ob(), stringbuffer_finish(), and stringbuffer_new().
END_TEST START_TEST | ( | test_object_dump_all | ) |
This is the test to check the behaviour of the method void object_dump_all(void);
Definition at line 224 of file check_object.c.
References cctk_create_game_object(), and object_dump_all().
END_TEST START_TEST | ( | test_object_find_by_tag_global | ) |
This is the test to check the behaviour of the method object *object_find_by_tag_global(tag_t i);
Definition at line 235 of file check_object.c.
References cctk_create_game_object(), obj::count, and object_find_by_tag_global().
END_TEST START_TEST | ( | test_object_find_by_name_global | ) |
This is the test to check the behaviour of the method object *object_find_by_name_global(const char *str);
Definition at line 250 of file check_object.c.
References add_string(), cctk_create_game_object(), obj::name, and object_find_by_name_global().
END_TEST START_TEST | ( | test_object_free_all_data | ) |
This is the test to check the behaviour of the method void object_free_all_data(void);
Definition at line 268 of file check_object.c.
END_TEST START_TEST | ( | test_object_get_owner | ) |
This is the test to check the behaviour of the method object *object_get_owner(object *op);
Definition at line 276 of file check_object.c.
References cctk_create_game_object(), CLEAR_FLAG, FLAG_REMOVED, object_get_owner(), and object_set_owner().
END_TEST START_TEST | ( | test_object_clear_owner | ) |
This is the test to check the behaviour of the method void object_clear_owner(object *op);
Definition at line 292 of file check_object.c.
References cctk_create_game_object(), object_clear_owner(), object_set_owner(), and obj::owner.
END_TEST START_TEST | ( | test_object_set_owner | ) |
This is the test to check the behaviour of the method void object_set_owner(object *op, object *owner);
Definition at line 308 of file check_object.c.
References cctk_create_game_object(), object_set_owner(), and obj::owner.
END_TEST START_TEST | ( | test_object_copy_owner | ) |
This is the test to check the behaviour of the method void object_copy_owner(object *op, object *clone);
Definition at line 322 of file check_object.c.
References cctk_create_game_object(), object_copy_owner(), object_get_owner(), and object_set_owner().
END_TEST START_TEST | ( | test_object_reset | ) |
This is the test to check the behaviour of the method void object_reset(object *op);
Definition at line 339 of file check_object.c.
References cctk_create_game_object(), obj::lore, obj::materialname, obj::msg, obj::name, obj::name_pl, object_reset(), obj::race, obj::skill, obj::slaying, and obj::title.
END_TEST START_TEST | ( | test_object_clear | ) |
This is the test to check the behaviour of the method void object_clear(object *op);
Definition at line 359 of file check_object.c.
References add_string(), cctk_create_game_object(), cctk_set_object_strings(), obj::lore, obj::materialname, obj::msg, obj::name, obj::name_pl, object_clear(), query_refcount(), obj::race, obj::skill, obj::slaying, and obj::title.
END_TEST START_TEST | ( | test_object_copy | ) |
This is the test to check the behaviour of the method void object_copy(object *op2, object *op);
Definition at line 383 of file check_object.c.
References add_string(), cctk_create_game_object(), cctk_set_object_strings(), obj::lore, obj::materialname, obj::msg, obj::name, obj::name_pl, object_copy(), query_refcount(), obj::race, obj::skill, obj::slaying, and obj::title.
END_TEST START_TEST | ( | test_object_new | ) |
This is the test to check the behaviour of the method object *object_new(void);
Definition at line 411 of file check_object.c.
References obj::active_next, obj::active_prev, llevDebug, LOG(), obj::lore, obj::materialname, obj::msg, obj::name, obj::name_pl, object_new(), obj::prev, obj::race, obj::skill, obj::slaying, and obj::title.
END_TEST START_TEST | ( | test_object_update_turn_face | ) |
This is the test to check the behaviour of the method void object_update_turn_face(object *op);
Definition at line 443 of file check_object.c.
References cctk_create_game_object(), obj::direction, obj::face, and object_update_turn_face().
START_TEST | ( | test_object_update_speed | ) |
This is the test to check the behaviour of the method void object_update_speed(object *op);
Definition at line 463 of file check_object.c.
References cctk_create_game_object(), IS_OBJECT_ACTIVE, MIN_ACTIVE_SPEED, object_update_speed(), and obj::speed.
END_TEST START_TEST | ( | test_object_remove_from_active_list | ) |
This is the test to check the behaviour of the method void object_remove_from_active_list(object *op);
Definition at line 508 of file check_object.c.
References cctk_create_game_object(), IS_OBJECT_ACTIVE, MIN_ACTIVE_SPEED, object_remove_from_active_list(), object_update_speed(), and obj::speed.
END_TEST START_TEST | ( | test_object_update | ) |
This is the test to check the behaviour of the method void object_update(object *op, int action);
Definition at line 524 of file check_object.c.
END_TEST START_TEST | ( | test_object_free_drop_inventory | ) |
This is the test to check the behaviour of the method void object_free_drop_inventory(object *ob);
Definition at line 532 of file check_object.c.
References cctk_create_game_object(), FLAG_FREED, object_free_drop_inventory(), object_insert_in_ob(), and QUERY_FLAG.
END_TEST START_TEST | ( | test_object_count_free | ) |
This is the test to check the behaviour of the method int object_count_free(void);
Definition at line 548 of file check_object.c.
References cctk_create_game_object(), and object_count_free().
END_TEST START_TEST | ( | test_object_count_used | ) |
This is the test to check the behaviour of the method int object_count_used(void);
Definition at line 569 of file check_object.c.
References cctk_create_game_object(), and object_count_used().
END_TEST START_TEST | ( | test_object_count_active | ) |
This is the test to check the behaviour of the method int object_count_active(void);
Definition at line 583 of file check_object.c.
References cctk_create_game_object(), MIN_ACTIVE_SPEED, object_count_active(), object_update_speed(), and obj::speed.
END_TEST START_TEST | ( | test_object_sub_weight | ) |
This is the test to check the behaviour of the method void object_sub_weight(object *op, signed long weight);
Definition at line 602 of file check_object.c.
References obj::carrying, cctk_create_game_object(), CONTAINER, object_insert_in_ob(), object_sub_weight(), object_sum_weight(), obj::stats, liv::Str, obj::type, and obj::weight.
END_TEST START_TEST | ( | test_object_remove | ) |
This is the test to check the behaviour of the method void object_remove(object *op);
Definition at line 634 of file check_object.c.
END_TEST START_TEST | ( | test_object_merge | ) |
This is the test to check the behaviour of the method object *object_merge(object *op, object *top);
Definition at line 646 of file check_object.c.
References obj::above, add_string(), obj::below, cctk_create_game_object(), and obj::name.
END_TEST START_TEST | ( | test_object_insert_in_map_at | ) |
This is the test to check the behaviour of the method object *object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y);
Definition at line 672 of file check_object.c.
References cctk_create_game_object(), get_empty_map(), GET_MAP_OB, obj::more, and object_insert_in_map_at().
END_TEST START_TEST | ( | test_object_insert_in_map | ) |
This is the test to check the behaviour of the method object *object_insert_in_map(object *op, mapstruct *m, object *originator, int flag);
Definition at line 703 of file check_object.c.
References obj::above, obj::below, cctk_create_game_object(), FLAG_FREED, get_empty_map(), GET_MAP_OB, INS_ABOVE_FLOOR_ONLY, INS_BELOW_ORIGINATOR, obj::nrof, object_insert_in_map(), QUERY_FLAG, obj::value, obj::x, and obj::y.
END_TEST START_TEST | ( | test_object_replace_insert_in_map | ) |
This is the test to check the behaviour of the method void object_replace_insert_in_map(const char *arch_string, object *op);
Definition at line 811 of file check_object.c.
References cctk_create_game_object(), obj::count, get_empty_map(), GET_MAP_OB, object_insert_in_map_at(), object_replace_insert_in_map(), and object_was_destroyed.
END_TEST START_TEST | ( | test_object_split | ) |
This is the test to check the behaviour of the method object *object_split(object *orig_ob, uint32_t nr);
Definition at line 862 of file check_object.c.
References cctk_create_game_object(), FLAG_FREED, obj::nrof, object_split(), and QUERY_FLAG.
END_TEST START_TEST | ( | test_object_decrease_nrof | ) |
This is the test to check the behaviour of the method object *object_decrease_nrof(object *op, uint32_t i);
Definition at line 889 of file check_object.c.
References cctk_create_game_object(), FLAG_FREED, obj::nrof, object_decrease_nrof(), and QUERY_FLAG.
END_TEST START_TEST | ( | test_object_add_weight | ) |
This is the test to check the behaviour of the method void object_add_weight(object *op, signed long weight);
Definition at line 909 of file check_object.c.
END_TEST START_TEST | ( | test_object_insert_in_ob | ) |
This is the test to check the behaviour of the method object *object_insert_in_ob(object *op, object *where);
Definition at line 917 of file check_object.c.
References obj::carrying, cctk_create_game_object(), obj::inv, object_insert_in_ob(), object_remove(), and obj::weight.
END_TEST START_TEST | ( | test_object_check_move_on | ) |
This is the test to check the behaviour of the method int object_check_move_on(object *op, object *originator);
Definition at line 949 of file check_object.c.
END_TEST START_TEST | ( | test_map_find_by_archetype | ) |
This is the test to check the behaviour of the method object *map_find_by_archetype(mapstruct *m, int x, int y, const archetype *at);
Definition at line 957 of file check_object.c.
END_TEST START_TEST | ( | test_map_find_by_type | ) |
This is the test to check the behaviour of the method object *map_find_by_type(mapstruct *m, int x, int y, unsigned char type);
Definition at line 965 of file check_object.c.
END_TEST START_TEST | ( | test_object_present_in_ob | ) |
This is the test to check the behaviour of the method object *object_present_in_ob(unsigned char type, const object *op);
Definition at line 973 of file check_object.c.
END_TEST START_TEST | ( | test_object_present_in_ob_by_name | ) |
This is the test to check the behaviour of the method object *object_present_in_ob_by_name(int type, const char *str, const object *op);
Definition at line 981 of file check_object.c.
END_TEST START_TEST | ( | test_arch_present_in_ob | ) |
This is the test to check the behaviour of the method object *arch_present_in_ob(const archetype *at, const object *op);
Definition at line 989 of file check_object.c.
END_TEST START_TEST | ( | test_object_set_flag_inv | ) |
This is the test to check the behaviour of the method void object_set_flag_inv(object *op, int flag);
Definition at line 997 of file check_object.c.
END_TEST START_TEST | ( | test_object_unset_flag_inv | ) |
This is the test to check the behaviour of the method void object_unset_flag_inv(object *op, int flag);
Definition at line 1005 of file check_object.c.
END_TEST START_TEST | ( | test_object_set_cheat | ) |
This is the test to check the behaviour of the method void object_set_cheat(object *op);
Definition at line 1013 of file check_object.c.
END_TEST START_TEST | ( | test_object_find_free_spot | ) |
This is the test to check the behaviour of the method int object_find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop);
Definition at line 1021 of file check_object.c.
END_TEST START_TEST | ( | test_object_find_first_free_spot | ) |
This is the test to check the behaviour of the method int object_find_first_free_spot(const object *ob, mapstruct *m, int x, int y);
Definition at line 1029 of file check_object.c.
END_TEST START_TEST | ( | test_get_search_arr | ) |
This is the test to check the behaviour of the method void get_search_arr(int *search_arr);
Definition at line 1037 of file check_object.c.
END_TEST START_TEST | ( | test_map_find_dir | ) |
This is the test to check the behaviour of the method int map_find_dir(mapstruct *m, int x, int y, object *exclude);
Definition at line 1045 of file check_object.c.
END_TEST START_TEST | ( | test_object_distance | ) |
This is the test to check the behaviour of the method int object_distance(const object *ob1, const object *ob2);
Definition at line 1053 of file check_object.c.
END_TEST START_TEST | ( | test_find_dir_2 | ) |
This is the test to check the behaviour of the method int find_dir_2(int x, int y);
Definition at line 1061 of file check_object.c.
END_TEST START_TEST | ( | test_absdir | ) |
This is the test to check the behaviour of the method int absdir(int d);
Definition at line 1069 of file check_object.c.
END_TEST START_TEST | ( | test_dirdiff | ) |
This is the test to check the behaviour of the method int dirdiff(int dir1, int dir2);
Definition at line 1077 of file check_object.c.
END_TEST START_TEST | ( | test_can_see_monsterP | ) |
This is the test to check the behaviour of the method int can_see_monsterP(mapstruct *m, int x, int y, int dir);
Definition at line 1085 of file check_object.c.
END_TEST START_TEST | ( | test_object_can_pick | ) |
This is the test to check the behaviour of the method int object_can_pick(const object *who, const object *item);
Definition at line 1093 of file check_object.c.
END_TEST START_TEST | ( | test_object_create_clone | ) |
This is the test to check the behaviour of the method object *object_create_clone(object *asrc);
Definition at line 1101 of file check_object.c.
END_TEST START_TEST | ( | test_object_was_destroyed | ) |
This is the test to check the behaviour of the method int object_was_destroyed(const object *op, tag_t old_tag);
Definition at line 1109 of file check_object.c.
END_TEST START_TEST | ( | test_object_find_by_type_subtype | ) |
This is the test to check the behaviour of the method object *object_find_by_type_subtype(const object *who, int type, int subtype);
Definition at line 1117 of file check_object.c.
END_TEST START_TEST | ( | test_object_get_key_value | ) |
This is the test to check the behaviour of the method key_value *object_get_key_value(const object *ob, const char *key);
Definition at line 1125 of file check_object.c.
END_TEST START_TEST | ( | test_object_get_value | ) |
This is the test to check the behaviour of the method const char *object_get_value(const object *op, const char *const key);
Definition at line 1133 of file check_object.c.
END_TEST START_TEST | ( | test_object_set_value | ) |
This is the test to check the behaviour of the method int object_set_value(object *op, const char *key, const char *value, int add_key);
Definition at line 1141 of file check_object.c.
END_TEST START_TEST | ( | test_object_matches_string | ) |
This is the test to check the behaviour of the method int object_matches_string(object *pl, object *op, const char *name);
Definition at line 1149 of file check_object.c.
References add_string(), cctk_create_game_object(), CLEAR_FLAG, obj::contr, FLAG_IDENTIFIED, FLAG_UNPAID, object_matches_string(), SET_FLAG, and obj::title.
|
static |
Definition at line 48 of file check_object.c.
Referenced by object_suite().