Go to the documentation of this file.
48 object *
tmp, *best = NULL;
49 int match_val = 0, tmpmatch;
68 object *gorokh, *cloak, *other;
71 fail_unless(
pl != NULL,
"can't find kobold archetype.");
85 fail_unless(
found == other,
"not found gem but %s",
found ?
found->name :
"nothing");
88 fail_unless(
found == cloak,
"didn't find cloak but %s",
found ?
found->name :
"nothing");
91 fail_unless(
found == NULL,
"Gorokh found %s instead of nothing",
found ?
found->name :
"nothing??");
97 object *sack, *
obj, *sack2, *dummy;
102 fail_unless(
test_map != NULL,
"can't create test map");
113 fail_unless(sack->
inv == NULL,
"sack's inventory isn't null?");
121 fail_unless(sack->
type ==
CONTAINER,
"sack isn't a container?");
127 fail_unless(sack->
inv ==
obj,
"object not inserted into sack?");
136 fail_unless(sack->
inv == NULL,
"item was put in sack even if too heavy?");
144 fail_unless(sack->
nrof == 1,
"sack wasn't split?");
145 fail_unless(sack->
above != NULL,
"no new sack created?");
146 fail_unless(sack->
inv ==
obj,
"object not inserted in old sack?");
147 fail_unless(sack ==
obj->env,
"object's env not updated?");
155 fail_unless(sack2->
inv == NULL,
"sack2's not empty?");
156 fail_unless(sack->
inv ==
obj,
"obj wasn't transferred?");
165 fail_unless(sack->
inv == NULL,
"sack wasn't put into sack2?");
166 fail_unless(sack2->
inv != NULL,
"sack2 wasn't filled?");
167 fail_unless(sack2->
above != NULL,
"sack2 wasn't split?");
168 fail_unless(sack2->
above->
inv == NULL,
"sack2's split was filled?");
174 #define TEST_ITEMS_COUNT 11
207 const char *
action = do_what ==
DO_TAKE ?
"picked" :
"dropped";
210 fail_unless(
test_map != NULL,
"couldn't create map");
212 fail_unless(
monster != NULL,
"couldn't create kobold");
219 fail_unless(
arch != NULL,
"couldn't find arch %s",
test_items[i]);
221 fail_unless(items[i] != NULL,
"couldn't create %s",
test_items[i]);
233 while ((idx = va_arg(
args,
int)) != -1) {
236 while ((idx = va_arg(
args,
int)) != -1) {
247 while ((idx = va_arg(
args,
int)) != -1) {
281 do_test(
DO_TAKE,
"all", -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1);
282 do_test(
DO_TAKE,
"*", -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1);
319 Suite *s = suite_create(
"c_object");
320 TCase *tc_core = tcase_create(
"Core");
325 suite_add_tcase(s, tc_core);
326 tcase_add_test(tc_core, test_find_best_apply_object_match);
327 tcase_add_test(tc_core, test_put_object_in_sack);
328 tcase_add_test(tc_core, test_command_take);
329 tcase_add_test(tc_core, test_command_drop);
337 SRunner *sr = srunner_create(s);
343 srunner_set_fork_status (sr, CK_NOFORK);
345 srunner_set_xml(sr, LOGDIR
"/unit/server/c_object.xml");
346 srunner_set_log(sr, LOGDIR
"/unit/server/c_object.out");
347 srunner_run_all(sr, CK_ENV);
348 nf = srunner_ntests_failed(sr);
350 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
#define GET_MAP_OB(M, X, Y)
START_TEST(test_find_best_apply_object_match)
mapstruct * get_empty_map(int sizex, int sizey)
#define QUERY_FLAG(xyz, p)
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
static END_TEST Suite * c_object_suite(void)
the faster the spell may be cast there are several other common only the caster may be affected by the spell The most common spell range is that of touch This denotes that the caster much touch the recipient of the spell in order to release the spell monster
object * object_insert_in_ob(object *op, object *where)
static const char * test_items[TEST_ITEMS_COUNT]
void object_free_drop_inventory(object *ob)
static void do_test(const int do_what, const char *param,...)
void command_take(object *op, const char *params)
sstring add_string(const char *str)
static void teardown(void)
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin it tries to load all available files in the SHARE plugins directory as plugin libraries It first displays the Initializing the plugin has the opportunity to signal itself by a message on the console Then the server displays an informative message containing both the plugin content and its keyword For the Python the standard load process thus GreenGoblin When a plugin has been it can request to be warned whenever a global event and are named freely by the developer If the directory doesn t nothing will happen< event name > can be init
#define INS_BELOW_ORIGINATOR
void free_map(mapstruct *m)
int object_matches_string(object *pl, object *op, const char *name)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
static std::shared_ptr< inja::Environment > env
object * create_archetype(const char *name)
void command_drop(object *op, const char *params)
#define CLEAR_FLAG(xyz, p)
static object * find_best_apply_object_match(object *start, object *pl, const char *params, int aflag)
object * arch_to_object(archetype *at)
void object_remove(object *op)
archetype * try_find_archetype(const char *name)
No space after the left no space before the right paren Comma right after the formal param
void put_object_in_sack(object *op, object *sack, object *tmp, uint32_t nrof)