Crossfire Server, Trunk
|
#include <global.h>
#include <stdlib.h>
#include <check.h>
#include <loader.h>
#include <toolkit_common.h>
#include <sproto.h>
Go to the source code of this file.
Macros | |
#define | DO_DROP 2 |
#define | DO_TAKE 1 |
#define | TEST_ITEMS_COUNT 11 |
Functions | |
static END_TEST Suite * | c_object_suite (void) |
static void | do_test (const int do_what, const char *param,...) |
static object * | find_best_apply_object_match (object *start, object *pl, const char *params, int aflag) |
int | main (void) |
static void | setup (void) |
END_TEST | START_TEST (test_command_drop) |
START_TEST (test_command_take) | |
START_TEST (test_find_best_apply_object_match) | |
END_TEST | START_TEST (test_put_object_in_sack) |
static void | teardown (void) |
Variables | |
static const char * | test_items [TEST_ITEMS_COUNT] |
#define DO_DROP 2 |
Definition at line 190 of file check_c_object.cpp.
#define DO_TAKE 1 |
Definition at line 189 of file check_c_object.cpp.
#define TEST_ITEMS_COUNT 11 |
Definition at line 174 of file check_c_object.cpp.
|
static |
Definition at line 318 of file check_c_object.cpp.
References setup(), and teardown().
Referenced by main().
|
static |
Actual testing function. It creates all items in test_items, puts them on map or in inventory, and either takes or drops with the specified parameter. After "param", there should be 2 integer lists finished by -1, specifying first the index of items to lock, then the index of items that should be picked/dropped by the commant.
do_what | either DO_TAKE or DO_DROP. |
param | parameter to the take or drop command. |
... | items to lock, then items that should be non pickable, then items which should be taken/dropped. |
Definition at line 203 of file check_c_object.cpp.
References convert::action, archininventory::arch, arch_to_object(), make_face_from_files::args, bigchest::check, command_drop(), command_take(), create_archetype(), DO_TAKE, env, FAIL_UNLESS, FLAG_INV_LOCKED, FLAG_NO_PICK, get_empty_map(), INS_BELOW_ORIGINATOR, disinfect::map, object_insert_in_map_at(), object_insert_in_ob(), SET_FLAG, test_items, TEST_ITEMS_COUNT, test_map, give::top, and try_find_archetype().
Referenced by START_TEST().
|
static |
Definition at line 47 of file check_c_object.cpp.
References AP_APPLY, AP_UNAPPLY, FLAG_APPLIED, object_matches_string(), roll-o-matic::params, altar_valkyrie::pl, QUERY_FLAG, and Ice::tmp.
Referenced by START_TEST().
int main | ( | void | ) |
Definition at line 334 of file check_c_object.cpp.
References c_object_suite(), cctk_setdatadir(), Settings::debug, init(), llevError, and settings.
|
static |
Definition at line 40 of file check_c_object.cpp.
Referenced by c_object_suite().
END_TEST START_TEST | ( | test_command_drop | ) |
Definition at line 298 of file check_c_object.cpp.
References DO_DROP, and do_test().
START_TEST | ( | test_command_take | ) |
Definition at line 269 of file check_c_object.cpp.
References DO_TAKE, and do_test().
START_TEST | ( | test_find_best_apply_object_match | ) |
Definition at line 66 of file check_c_object.cpp.
References add_string(), CLEAR_FLAG, create_archetype(), FAIL_UNLESS, find_best_apply_object_match(), FLAG_IDENTIFIED, is_valid_types_gen::found, object_insert_in_ob(), altar_valkyrie::pl, and object::title.
END_TEST START_TEST | ( | test_put_object_in_sack | ) |
Definition at line 95 of file check_c_object.cpp.
References object::above, CONTAINER, object::container, create_archetype(), FAIL_UNLESS, FLAG_APPLIED, free_map(), get_empty_map(), GET_MAP_OB, object::inv, object::nrof, altar_valkyrie::obj, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), put_object_in_sack(), SET_FLAG, test_map, object::type, and object::weight_limit.
|
static |
Definition at line 43 of file check_c_object.cpp.
Referenced by c_object_suite().
|
static |
Definition at line 175 of file check_c_object.cpp.
Referenced by do_test().