2012-05-17 09:13:30 +02:00
|
|
|
#include <platform.h>
|
|
|
|
#include <stdlib.h>
|
2014-08-27 06:40:18 +02:00
|
|
|
#include "move.h"
|
2012-05-17 09:13:30 +02:00
|
|
|
|
2018-11-04 15:53:27 +01:00
|
|
|
#include "contact.h"
|
2016-12-16 17:16:10 +01:00
|
|
|
#include "lighthouse.h"
|
2015-09-12 23:41:37 +02:00
|
|
|
|
2018-09-30 13:45:19 +02:00
|
|
|
#include <kernel/attrib.h>
|
2014-10-03 21:26:11 +02:00
|
|
|
#include <kernel/ally.h>
|
2011-03-09 10:43:30 +01:00
|
|
|
#include <kernel/building.h>
|
2018-09-30 13:45:19 +02:00
|
|
|
#include <kernel/config.h>
|
2014-10-03 21:26:11 +02:00
|
|
|
#include <kernel/faction.h>
|
2011-03-09 10:43:30 +01:00
|
|
|
#include <kernel/region.h>
|
2012-07-02 03:00:31 +02:00
|
|
|
#include <kernel/ship.h>
|
|
|
|
#include <kernel/terrain.h>
|
2015-04-14 02:32:01 +02:00
|
|
|
#include <kernel/item.h>
|
2014-10-03 21:26:11 +02:00
|
|
|
#include <kernel/unit.h>
|
2015-04-14 02:32:01 +02:00
|
|
|
#include <kernel/race.h>
|
2015-11-14 16:47:14 +01:00
|
|
|
#include <kernel/order.h>
|
2011-03-09 10:43:30 +01:00
|
|
|
|
2018-09-30 13:45:19 +02:00
|
|
|
#include "util/keyword.h"
|
2011-03-09 10:43:30 +01:00
|
|
|
#include <util/language.h>
|
2015-11-14 16:47:14 +01:00
|
|
|
#include <util/message.h>
|
|
|
|
#include <util/base36.h>
|
|
|
|
#include <util/parser.h>
|
2011-03-09 10:43:30 +01:00
|
|
|
|
2012-05-31 04:17:08 +02:00
|
|
|
#include <CuTest.h>
|
2011-03-09 10:43:30 +01:00
|
|
|
#include <tests.h>
|
2015-04-14 02:32:01 +02:00
|
|
|
#include <assert.h>
|
2011-03-09 10:43:30 +01:00
|
|
|
|
2018-01-13 08:51:40 +01:00
|
|
|
static void setup_move(void) {
|
2018-05-18 19:58:49 +02:00
|
|
|
mt_create_va(mt_new("travel", NULL),
|
|
|
|
"unit:unit", "start:region", "end:region", "mode:int", "regions:regions", MT_NEW_END);
|
|
|
|
mt_create_va(mt_new("moveblocked", NULL),
|
|
|
|
"unit:unit", "direction:int", MT_NEW_END);
|
2018-01-13 08:51:40 +01:00
|
|
|
}
|
|
|
|
|
2012-07-02 03:36:16 +02:00
|
|
|
static void test_ship_not_allowed_in_coast(CuTest * tc)
|
|
|
|
{
|
2014-10-03 21:26:11 +02:00
|
|
|
region *r1, *r2;
|
|
|
|
ship * sh;
|
|
|
|
terrain_type *ttype, *otype;
|
|
|
|
ship_type *stype;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2016-06-10 20:55:27 +02:00
|
|
|
ttype = test_create_terrain("glacier", LAND_REGION | ARCTIC_REGION | WALK_INTO);
|
|
|
|
otype = test_create_terrain("ocean", SEA_REGION);
|
2014-10-03 21:26:11 +02:00
|
|
|
stype = test_create_shiptype("derp");
|
2016-03-11 09:50:18 +01:00
|
|
|
free(stype->coasts);
|
2014-12-31 01:00:10 +01:00
|
|
|
stype->coasts = (struct terrain_type **)calloc(2, sizeof(struct terrain_type *));
|
2014-10-03 21:26:11 +02:00
|
|
|
|
|
|
|
r1 = test_create_region(0, 0, ttype);
|
|
|
|
r2 = test_create_region(1, 0, otype);
|
|
|
|
sh = test_create_ship(0, stype);
|
|
|
|
|
|
|
|
CuAssertIntEquals(tc, SA_COAST, check_ship_allowed(sh, r2));
|
|
|
|
CuAssertIntEquals(tc, SA_NO_COAST, check_ship_allowed(sh, r1));
|
|
|
|
stype->coasts[0] = ttype;
|
|
|
|
CuAssertIntEquals(tc, SA_COAST, check_ship_allowed(sh, r1));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2012-07-02 03:36:16 +02:00
|
|
|
}
|
|
|
|
|
2014-10-03 21:26:11 +02:00
|
|
|
typedef struct move_fixture {
|
|
|
|
region *r;
|
|
|
|
ship *sh;
|
|
|
|
building * b;
|
|
|
|
unit *u;
|
|
|
|
} move_fixture;
|
|
|
|
|
|
|
|
static void setup_harbor(move_fixture *mf) {
|
|
|
|
region *r;
|
|
|
|
ship * sh;
|
|
|
|
terrain_type * ttype;
|
|
|
|
building_type * btype;
|
|
|
|
building * b;
|
|
|
|
unit *u;
|
|
|
|
|
2016-06-10 20:55:27 +02:00
|
|
|
ttype = test_create_terrain("glacier", LAND_REGION | ARCTIC_REGION | WALK_INTO);
|
2014-10-03 21:26:11 +02:00
|
|
|
btype = test_create_buildingtype("harbour");
|
|
|
|
|
2018-01-14 09:58:45 +01:00
|
|
|
sh = test_create_ship(0, NULL);
|
2014-10-03 21:26:11 +02:00
|
|
|
r = test_create_region(0, 0, ttype);
|
|
|
|
|
|
|
|
b = test_create_building(r, btype);
|
2016-08-21 20:12:28 +02:00
|
|
|
b->flags |= BLD_MAINTAINED;
|
2014-10-03 21:26:11 +02:00
|
|
|
|
2018-01-14 09:38:26 +01:00
|
|
|
u = test_create_unit(test_create_faction(NULL), r);
|
2014-10-03 21:26:11 +02:00
|
|
|
u->ship = sh;
|
|
|
|
ship_set_owner(u);
|
|
|
|
|
|
|
|
mf->r = r;
|
|
|
|
mf->u = u;
|
|
|
|
mf->sh = sh;
|
|
|
|
mf->b = b;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_allowed_without_harbormaster(CuTest * tc)
|
2012-07-02 03:36:16 +02:00
|
|
|
{
|
2014-10-03 21:26:11 +02:00
|
|
|
move_fixture mf;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2014-10-03 21:26:11 +02:00
|
|
|
setup_harbor(&mf);
|
|
|
|
|
|
|
|
CuAssertIntEquals(tc, SA_HARBOUR, check_ship_allowed(mf.sh, mf.r));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2014-10-03 21:26:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_blocked_by_harbormaster(CuTest * tc) {
|
|
|
|
unit *u;
|
|
|
|
move_fixture mf;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2014-10-03 21:26:11 +02:00
|
|
|
setup_harbor(&mf);
|
|
|
|
|
2018-01-14 09:38:26 +01:00
|
|
|
u = test_create_unit(test_create_faction(NULL), mf.r);
|
2014-10-03 21:26:11 +02:00
|
|
|
u->building = mf.b;
|
|
|
|
building_set_owner(u);
|
|
|
|
|
|
|
|
CuAssertIntEquals_Msg(tc, "harbor master must contact ship", SA_NO_COAST, check_ship_allowed(mf.sh, mf.r));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2014-10-03 21:26:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_has_harbormaster_contact(CuTest * tc) {
|
|
|
|
unit *u;
|
|
|
|
move_fixture mf;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2014-10-03 21:26:11 +02:00
|
|
|
setup_harbor(&mf);
|
|
|
|
|
2018-01-14 09:38:26 +01:00
|
|
|
u = test_create_unit(test_create_faction(NULL), mf.r);
|
2014-10-03 21:26:11 +02:00
|
|
|
u->building = mf.b;
|
|
|
|
building_set_owner(u);
|
2018-11-04 18:07:42 +01:00
|
|
|
contact_unit(mf.b->_owner, mf.sh->_owner);
|
2014-10-03 21:26:11 +02:00
|
|
|
|
|
|
|
CuAssertIntEquals(tc, SA_HARBOUR, check_ship_allowed(mf.sh, mf.r));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2014-10-03 21:26:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_has_harbormaster_same_faction(CuTest * tc) {
|
|
|
|
unit *u;
|
|
|
|
move_fixture mf;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2014-10-03 21:26:11 +02:00
|
|
|
setup_harbor(&mf);
|
|
|
|
|
|
|
|
u = test_create_unit(mf.u->faction, mf.r);
|
|
|
|
u->building = mf.b;
|
|
|
|
building_set_owner(u);
|
|
|
|
|
|
|
|
CuAssertIntEquals(tc, SA_HARBOUR, check_ship_allowed(mf.sh, mf.r));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2014-10-03 21:26:11 +02:00
|
|
|
}
|
2012-07-02 03:36:16 +02:00
|
|
|
|
2014-10-03 21:26:11 +02:00
|
|
|
static void test_ship_has_harbormaster_ally(CuTest * tc) {
|
|
|
|
unit *u;
|
|
|
|
move_fixture mf;
|
2012-07-02 03:36:16 +02:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2014-10-03 21:26:11 +02:00
|
|
|
setup_harbor(&mf);
|
2012-07-02 03:36:16 +02:00
|
|
|
|
2018-01-14 09:38:26 +01:00
|
|
|
u = test_create_unit(test_create_faction(NULL), mf.r);
|
2014-10-03 21:26:11 +02:00
|
|
|
u->building = mf.b;
|
|
|
|
building_set_owner(u);
|
2018-10-26 19:47:50 +02:00
|
|
|
ally_set(&u->faction->allies, mf.u->faction, HELP_GUARD);
|
2012-07-02 03:36:16 +02:00
|
|
|
|
2014-10-03 21:26:11 +02:00
|
|
|
CuAssertIntEquals(tc, SA_HARBOUR, check_ship_allowed(mf.sh, mf.r));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2012-07-02 03:36:16 +02:00
|
|
|
}
|
|
|
|
|
2015-04-14 02:32:01 +02:00
|
|
|
static void test_walkingcapacity(CuTest *tc) {
|
|
|
|
unit *u;
|
|
|
|
int cap;
|
|
|
|
const struct item_type *itype;
|
|
|
|
|
2017-03-10 21:29:37 +01:00
|
|
|
test_setup();
|
|
|
|
init_resources();
|
2015-04-14 02:32:01 +02:00
|
|
|
|
2017-03-10 21:29:37 +01:00
|
|
|
u = test_create_unit(test_create_faction(NULL), test_create_region(0, 0, NULL));
|
2015-04-14 02:32:01 +02:00
|
|
|
cap = u->number * (u->_race->capacity + u->_race->weight);
|
|
|
|
CuAssertIntEquals(tc, cap, walkingcapacity(u));
|
|
|
|
scale_number(u, 2);
|
|
|
|
cap = u->number * (u->_race->capacity + u->_race->weight);
|
|
|
|
CuAssertIntEquals(tc, cap, walkingcapacity(u));
|
|
|
|
|
|
|
|
itype = it_find("horse");
|
|
|
|
assert(itype);
|
|
|
|
i_change(&u->items, itype, 1);
|
|
|
|
cap += itype->capacity;
|
|
|
|
CuAssertIntEquals(tc, cap, walkingcapacity(u));
|
|
|
|
i_change(&u->items, itype, 1);
|
|
|
|
cap += itype->capacity;
|
|
|
|
CuAssertIntEquals(tc, cap, walkingcapacity(u));
|
|
|
|
|
2017-03-10 21:29:37 +01:00
|
|
|
itype = test_create_itemtype("cart");
|
2015-04-14 02:32:01 +02:00
|
|
|
assert(itype);
|
|
|
|
i_change(&u->items, itype, 1);
|
|
|
|
CuAssertIntEquals(tc, cap, walkingcapacity(u));
|
|
|
|
set_level(u, SK_RIDING, 1);
|
|
|
|
cap += itype->capacity;
|
|
|
|
CuAssertIntEquals(tc, cap, walkingcapacity(u));
|
|
|
|
|
|
|
|
itype = test_create_itemtype("trollbelt");
|
|
|
|
assert(itype);
|
|
|
|
i_change(&u->items, itype, 1);
|
|
|
|
CuAssertIntEquals(tc, cap + (STRENGTHMULTIPLIER-1) * u->_race->capacity, walkingcapacity(u));
|
2015-11-22 10:33:31 +01:00
|
|
|
config_set("rules.trollbelt.multiplier", "5");
|
2015-04-14 02:32:01 +02:00
|
|
|
CuAssertIntEquals(tc, cap + 4 * u->_race->capacity, walkingcapacity(u));
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-04-14 02:32:01 +02:00
|
|
|
}
|
|
|
|
|
2015-09-23 22:21:13 +02:00
|
|
|
static void test_ship_trails(CuTest *tc) {
|
|
|
|
ship *sh;
|
|
|
|
region *r1, *r2, *r3;
|
|
|
|
terrain_type *otype;
|
|
|
|
region_list *route = 0;
|
2015-08-30 14:52:42 +02:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2016-06-10 20:55:27 +02:00
|
|
|
otype = test_create_terrain("ocean", SEA_REGION);
|
2015-09-23 22:21:13 +02:00
|
|
|
r1 = test_create_region(0, 0, otype);
|
|
|
|
r2 = test_create_region(1, 0, otype);
|
|
|
|
r3 = test_create_region(2, 0, otype);
|
2018-01-14 09:58:45 +01:00
|
|
|
sh = test_create_ship(r1, NULL);
|
|
|
|
move_ship(sh, r1, r3, NULL);
|
2015-09-23 22:21:13 +02:00
|
|
|
CuAssertPtrEquals(tc, r3, sh->region);
|
|
|
|
CuAssertPtrEquals(tc, sh, r3->ships);
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, r1->ships);
|
|
|
|
CuAssertPtrEquals(tc, NULL, a_find(r1->attribs, &at_shiptrail));
|
|
|
|
CuAssertPtrEquals(tc, NULL, a_find(r3->attribs, &at_shiptrail));
|
2015-09-23 22:21:13 +02:00
|
|
|
add_regionlist(&route, r3);
|
|
|
|
add_regionlist(&route, r2);
|
|
|
|
move_ship(sh, r3, r1, route);
|
|
|
|
CuAssertPtrEquals(tc, r1, sh->region);
|
|
|
|
CuAssertPtrEquals(tc, sh, r1->ships);
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, r3->ships);
|
|
|
|
CuAssertPtrEquals(tc, NULL, a_find(r1->attribs, &at_shiptrail));
|
2015-09-23 22:21:13 +02:00
|
|
|
CuAssertPtrNotNull(tc, a_find(r2->attribs, &at_shiptrail));
|
|
|
|
CuAssertPtrNotNull(tc, a_find(r3->attribs, &at_shiptrail));
|
2015-10-14 12:03:19 +02:00
|
|
|
free_regionlist(route);
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-08-30 14:52:42 +02:00
|
|
|
}
|
|
|
|
|
2015-09-24 10:28:43 +02:00
|
|
|
static void test_age_trails(CuTest *tc) {
|
|
|
|
region_list *route = 0;
|
|
|
|
region *r1, *r2;
|
|
|
|
ship *sh;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2018-01-14 09:38:26 +01:00
|
|
|
r1 = test_create_region(0, 0, NULL);
|
2018-01-14 09:58:45 +01:00
|
|
|
r2 = test_create_region(1, 0, NULL);
|
|
|
|
sh = test_create_ship(r1, NULL);
|
2015-09-24 10:28:43 +02:00
|
|
|
add_regionlist(&route, r1);
|
|
|
|
add_regionlist(&route, r2);
|
|
|
|
move_ship(sh, r1, r2, route);
|
|
|
|
|
|
|
|
CuAssertPtrNotNull(tc, r1->attribs);
|
2015-12-16 22:18:44 +01:00
|
|
|
a_age(&r1->attribs, r1);
|
2015-09-24 10:28:43 +02:00
|
|
|
CuAssertPtrNotNull(tc, r1->attribs);
|
2015-12-16 22:18:44 +01:00
|
|
|
a_age(&r1->attribs, r1);
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, r1->attribs);
|
2015-10-14 12:03:19 +02:00
|
|
|
free_regionlist(route);
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-09-24 10:28:43 +02:00
|
|
|
}
|
|
|
|
|
2015-11-15 02:20:55 +01:00
|
|
|
struct drift_fixture {
|
|
|
|
faction *f;
|
|
|
|
region *r;
|
|
|
|
unit *u;
|
|
|
|
terrain_type *t_ocean;
|
|
|
|
ship_type *st_boat;
|
|
|
|
ship *sh;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
void setup_drift (struct drift_fixture *fix) {
|
2017-03-10 21:43:36 +01:00
|
|
|
test_create_locale();
|
2015-11-27 12:40:17 +01:00
|
|
|
config_set("rules.ship.storms", "0");
|
2015-11-15 02:20:55 +01:00
|
|
|
|
2017-03-10 21:43:36 +01:00
|
|
|
fix->st_boat = test_create_shiptype("boat");
|
2015-11-19 12:36:15 +01:00
|
|
|
fix->st_boat->cabins = 20000;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-03-10 21:29:37 +01:00
|
|
|
test_create_ocean(0, 0);
|
2018-01-14 09:38:26 +01:00
|
|
|
fix->u = test_create_unit(fix->f = test_create_faction(NULL), fix->r = test_create_ocean(-1, 0));
|
2016-11-19 20:57:10 +01:00
|
|
|
assert(fix->r && fix->u && fix->f);
|
2015-11-15 02:20:55 +01:00
|
|
|
set_level(fix->u, SK_SAILING, fix->st_boat->sumskill);
|
|
|
|
u_set_ship(fix->u, fix->sh = test_create_ship(fix->u->region, fix->st_boat));
|
2016-11-19 20:57:10 +01:00
|
|
|
assert(fix->sh);
|
2018-01-12 21:15:21 +01:00
|
|
|
|
2018-08-01 11:55:57 +02:00
|
|
|
mt_create_va(mt_new("sink_msg", NULL),
|
|
|
|
"ship:ship", "region:region", MT_NEW_END);
|
|
|
|
|
2018-05-18 19:58:49 +02:00
|
|
|
mt_create_va(mt_new("ship_drift", NULL),
|
|
|
|
"ship:ship", "dir:int", MT_NEW_END);
|
|
|
|
mt_create_va(mt_new("shipsink", NULL),
|
|
|
|
"ship:ship", MT_NEW_END);
|
|
|
|
mt_create_va(mt_new("massive_overload", NULL),
|
|
|
|
"ship:ship", MT_NEW_END);
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_no_overload(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-15 02:20:55 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
|
|
|
|
fix.u->number = 2;
|
|
|
|
movement();
|
|
|
|
CuAssertPtrEquals(tc, fix.u->region, findregion(-1,0));
|
|
|
|
CuAssertIntEquals(tc, 0, fix.sh->damage);
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
2015-11-29 21:06:35 +01:00
|
|
|
static void test_ship_empty(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-29 21:06:35 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
fix.u->ship = NULL;
|
|
|
|
ship_update_owner(fix.sh);
|
|
|
|
|
|
|
|
movement();
|
|
|
|
CuAssertPtrEquals(tc, fix.sh->region, findregion(0, 0));
|
|
|
|
CuAssertIntEquals(tc, 2, ship_damage_percent(fix.sh));
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, test_find_messagetype(fix.f->msgs, "ship_drift"));
|
2015-11-29 21:06:35 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-29 21:06:35 +01:00
|
|
|
}
|
|
|
|
|
2017-12-25 23:22:19 +01:00
|
|
|
static void test_no_drift_damage(CuTest *tc) {
|
2015-11-15 02:20:55 +01:00
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2017-12-25 23:22:19 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
fix.u->ship = NULL;
|
|
|
|
ship_update_owner(fix.sh);
|
|
|
|
|
|
|
|
config_set("rules.ship.damage_drift", "0.0");
|
|
|
|
movement();
|
|
|
|
CuAssertPtrEquals(tc, fix.sh->region, findregion(0, 0));
|
|
|
|
CuAssertIntEquals(tc, 0, ship_damage_percent(fix.sh));
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, test_find_messagetype(fix.f->msgs, "ship_drift"));
|
2017-12-25 23:22:19 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2017-12-25 23:22:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_normal_overload(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-15 02:20:55 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
fix.u->number = 21;
|
2015-11-15 02:20:55 +01:00
|
|
|
movement();
|
|
|
|
CuAssertPtrEquals(tc, fix.u->region, findregion(0, 0));
|
2015-11-17 15:47:43 +01:00
|
|
|
CuAssertIntEquals(tc, 2, ship_damage_percent(fix.sh));
|
2015-11-15 02:20:55 +01:00
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(fix.f->msgs, "ship_drift"));
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_big_overload(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-15 02:20:55 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
fix.u->number = 22;
|
2015-11-15 02:20:55 +01:00
|
|
|
movement();
|
|
|
|
CuAssertPtrEquals(tc, fix.u->region, findregion(-1, 0));
|
2015-11-19 12:36:15 +01:00
|
|
|
CuAssertIntEquals(tc, 5, ship_damage_percent(fix.sh));
|
2015-11-15 02:20:55 +01:00
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(fix.f->msgs, "massive_overload"));
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_no_real_overload(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-15 02:20:55 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
fix.u->number = 21;
|
2015-11-15 02:20:55 +01:00
|
|
|
damage_ship(fix.sh, .80);
|
|
|
|
movement();
|
|
|
|
CuAssertPtrEquals(tc, fix.u->region, findregion(0, 0));
|
2015-11-17 15:47:43 +01:00
|
|
|
CuAssertIntEquals(tc, 82, ship_damage_percent(fix.sh));
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, test_find_messagetype(fix.f->msgs, "massive_overload"));
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_ridiculous_overload(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-15 02:20:55 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
fix.u->number = 500;
|
2015-11-15 02:20:55 +01:00
|
|
|
movement();
|
2015-11-17 15:47:43 +01:00
|
|
|
CuAssertIntEquals(tc, 37, ship_damage_percent(fix.sh));
|
2015-11-15 02:20:55 +01:00
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(fix.f->msgs, "massive_overload"));
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_ridiculous_overload_no_captain(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-15 02:20:55 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
set_level(fix.u, SK_SAILING, 0);
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
fix.u->number = 500;
|
2015-11-15 02:20:55 +01:00
|
|
|
movement();
|
2015-11-17 15:47:43 +01:00
|
|
|
CuAssertIntEquals(tc, 37, ship_damage_percent(fix.sh));
|
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(fix.f->msgs, "massive_overload"));
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-17 15:47:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ship_ridiculous_overload_bad(CuTest *tc) {
|
|
|
|
struct drift_fixture fix;
|
2015-11-19 15:28:21 +01:00
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2015-11-17 15:47:43 +01:00
|
|
|
setup_drift(&fix);
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
fix.u->number = 500;
|
2015-11-27 12:40:17 +01:00
|
|
|
config_set("rules.ship.overload.damage.max", "1");
|
2015-11-17 15:47:43 +01:00
|
|
|
movement();
|
|
|
|
CuAssertTrue(tc, ship_damage_percent(fix.sh) > 99);
|
2015-11-15 02:20:55 +01:00
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(fix.f->msgs, "massive_overload"));
|
2018-10-14 11:48:21 +02:00
|
|
|
CuAssertPtrEquals(tc, NULL, fix.sh->region);
|
2015-11-15 02:20:55 +01:00
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(fix.f->msgs, "shipsink"));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-15 02:20:55 +01:00
|
|
|
}
|
|
|
|
|
2015-11-19 12:36:15 +01:00
|
|
|
extern double damage_overload(double overload);
|
|
|
|
|
|
|
|
static void test_ship_damage_overload(CuTest *tc) {
|
|
|
|
CuAssertDblEquals(tc, 0.0, damage_overload(1), ASSERT_DBL_DELTA);
|
|
|
|
CuAssertDblEquals(tc, 0.05, damage_overload(1.1), ASSERT_DBL_DELTA);
|
|
|
|
CuAssertDblEquals(tc, 0.05, damage_overload(1.5), ASSERT_DBL_DELTA);
|
|
|
|
CuAssertDblEquals(tc, 0.21, damage_overload(3.25), ASSERT_DBL_DELTA);
|
|
|
|
CuAssertDblEquals(tc, 0.37, damage_overload(5), ASSERT_DBL_DELTA);
|
|
|
|
}
|
2015-11-17 15:47:43 +01:00
|
|
|
|
2015-11-14 16:47:14 +01:00
|
|
|
typedef struct traveldir {
|
|
|
|
int no;
|
|
|
|
direction_t dir;
|
|
|
|
int age;
|
|
|
|
} traveldir;
|
|
|
|
|
|
|
|
static void test_follow_ship_msg(CuTest * tc) {
|
|
|
|
region *r;
|
|
|
|
ship * sh;
|
|
|
|
faction *f;
|
|
|
|
unit *u;
|
|
|
|
const ship_type *stype;
|
|
|
|
message *msg;
|
|
|
|
order *ord;
|
|
|
|
traveldir *td = NULL;
|
|
|
|
attrib *a;
|
2017-02-18 21:15:14 +01:00
|
|
|
void *p;
|
|
|
|
|
|
|
|
test_setup();
|
2017-03-10 21:29:37 +01:00
|
|
|
init_resources();
|
|
|
|
|
2018-01-14 09:38:26 +01:00
|
|
|
f = test_create_faction(NULL);
|
2017-03-10 21:29:37 +01:00
|
|
|
r = test_create_plain(0, 0);
|
|
|
|
test_create_ocean(-1, 1); /* D_NORTHWEST */
|
2015-11-14 16:47:14 +01:00
|
|
|
|
|
|
|
stype = st_find("boat");
|
|
|
|
sh = test_create_ship(r, stype);
|
|
|
|
u = test_create_unit(f, r);
|
|
|
|
u->ship = sh;
|
|
|
|
ship_set_owner(u);
|
|
|
|
set_level(u, SK_SAILING, 10);
|
|
|
|
|
|
|
|
ord = create_order(K_FOLLOW, f->locale, "SHIP 2");
|
|
|
|
assert(ord);
|
|
|
|
unit_addorder(u, ord);
|
|
|
|
|
2017-03-10 21:29:37 +01:00
|
|
|
set_money(u, 999999); /* overloaded ship */
|
2015-11-14 16:47:14 +01:00
|
|
|
|
|
|
|
a = a_add(&(r->attribs), a_new(&at_shiptrail));
|
|
|
|
td = (traveldir *)a->data.v;
|
|
|
|
td->no = 2;
|
|
|
|
td->dir = D_NORTHWEST;
|
|
|
|
td->age = 2;
|
|
|
|
|
2018-05-18 19:58:49 +02:00
|
|
|
mt_create_va(mt_new("error18", NULL),
|
|
|
|
"unit:unit", "region:region", "command:order", MT_NEW_END);
|
2015-11-14 16:47:14 +01:00
|
|
|
|
2017-10-09 20:33:47 +02:00
|
|
|
init_order_depr(ord);
|
2015-11-14 16:47:14 +01:00
|
|
|
getstrtoken();
|
|
|
|
|
|
|
|
follow_ship(u, ord);
|
|
|
|
|
2018-05-27 20:31:36 +02:00
|
|
|
CuAssertPtrEquals(tc, r, u->region);
|
2015-11-14 16:47:14 +01:00
|
|
|
CuAssertPtrNotNull(tc, msg = test_find_messagetype(u->faction->msgs, "error18"));
|
2017-02-18 21:15:14 +01:00
|
|
|
p = msg->parameters[2].v;
|
2015-11-14 16:47:14 +01:00
|
|
|
CuAssertPtrNotNull(tc, p);
|
|
|
|
CuAssertIntEquals(tc, K_FOLLOW, getkeyword((order *)p));
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-11-14 16:47:14 +01:00
|
|
|
}
|
|
|
|
|
2016-06-10 18:24:18 +02:00
|
|
|
static void test_drifting_ships(CuTest *tc) {
|
|
|
|
ship *sh;
|
2017-10-30 18:12:24 +01:00
|
|
|
region *r;
|
2016-06-10 18:24:18 +02:00
|
|
|
terrain_type *t_ocean, *t_plain;
|
|
|
|
ship_type *st_boat;
|
2017-12-27 19:58:39 +01:00
|
|
|
|
2016-12-16 07:29:43 +01:00
|
|
|
test_setup();
|
2016-06-10 20:55:27 +02:00
|
|
|
t_ocean = test_create_terrain("ocean", SEA_REGION);
|
|
|
|
t_plain = test_create_terrain("plain", LAND_REGION);
|
2017-10-30 18:12:24 +01:00
|
|
|
r = test_create_region(0, 0, t_ocean);
|
|
|
|
test_create_region(1, 0, t_ocean);
|
2016-06-10 18:24:18 +02:00
|
|
|
st_boat = test_create_shiptype("boat");
|
2017-10-30 18:12:24 +01:00
|
|
|
sh = test_create_ship(r, st_boat);
|
2017-10-21 10:44:07 +02:00
|
|
|
CuAssertIntEquals(tc, D_EAST, drift_target(sh));
|
2017-10-30 18:12:24 +01:00
|
|
|
test_create_region(-1, 0, t_plain);
|
2017-10-21 10:44:07 +02:00
|
|
|
CuAssertIntEquals(tc, D_WEST, drift_target(sh));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2016-06-10 18:24:18 +02:00
|
|
|
}
|
|
|
|
|
2016-12-16 07:29:43 +01:00
|
|
|
static void test_ship_leave_trail(CuTest *tc) {
|
|
|
|
ship *s1, *s2;
|
|
|
|
region *r1, *r2;
|
|
|
|
terrain_type *t_ocean;
|
|
|
|
ship_type *st_boat;
|
|
|
|
region_list *route = NULL;
|
|
|
|
|
|
|
|
test_setup();
|
|
|
|
t_ocean = test_create_terrain("ocean", SEA_REGION);
|
|
|
|
r1 = test_create_region(0, 0, t_ocean);
|
|
|
|
add_regionlist(&route, test_create_region(2, 0, t_ocean));
|
2016-12-16 17:16:10 +01:00
|
|
|
add_regionlist(&route, r2 = test_create_region(1, 0, t_ocean));
|
2016-12-16 07:29:43 +01:00
|
|
|
st_boat = test_create_shiptype("boat");
|
|
|
|
s1 = test_create_ship(r1, st_boat);
|
|
|
|
s2 = test_create_ship(r1, st_boat);
|
|
|
|
leave_trail(s1, r1, route);
|
2016-12-16 17:16:10 +01:00
|
|
|
a_add(&r1->attribs, a_new(&at_lighthouse));
|
2016-12-16 07:29:43 +01:00
|
|
|
leave_trail(s2, r1, route);
|
2016-12-16 17:16:10 +01:00
|
|
|
a_add(&r2->attribs, a_new(&at_lighthouse));
|
|
|
|
CuAssertPtrEquals(tc, &at_shiptrail, (void *)r1->attribs->type);
|
|
|
|
CuAssertPtrEquals(tc, &at_shiptrail, (void *)r1->attribs->next->type);
|
|
|
|
CuAssertPtrEquals(tc, &at_lighthouse, (void *)r1->attribs->next->next->type);
|
|
|
|
CuAssertPtrEquals(tc, &at_shiptrail, (void *)r2->attribs->type);
|
|
|
|
CuAssertPtrEquals(tc, &at_shiptrail, (void *)r2->attribs->next->type);
|
|
|
|
CuAssertPtrEquals(tc, &at_lighthouse, (void *)r2->attribs->next->next->type);
|
2016-12-16 07:29:43 +01:00
|
|
|
free_regionlist(route);
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2016-12-16 07:29:43 +01:00
|
|
|
}
|
|
|
|
|
2017-10-06 22:15:48 +02:00
|
|
|
static void test_movement_speed(CuTest *tc) {
|
|
|
|
unit * u;
|
|
|
|
race * rc;
|
|
|
|
const struct item_type *it_horse;
|
|
|
|
|
|
|
|
test_setup();
|
|
|
|
it_horse = test_create_horse();
|
|
|
|
rc = test_create_race(NULL);
|
|
|
|
u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, NULL));
|
|
|
|
|
|
|
|
rc->speed = 1.0;
|
|
|
|
CuAssertIntEquals(tc, BP_WALKING, movement_speed(u));
|
|
|
|
|
|
|
|
rc->speed = 2.0;
|
|
|
|
CuAssertIntEquals(tc, 2 * BP_WALKING, movement_speed(u));
|
|
|
|
|
|
|
|
set_level(u, SK_RIDING, 1);
|
|
|
|
i_change(&u->items, it_horse, 1);
|
|
|
|
CuAssertIntEquals(tc, BP_RIDING, movement_speed(u));
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2017-10-06 22:15:48 +02:00
|
|
|
}
|
|
|
|
|
2017-12-11 16:24:06 +01:00
|
|
|
static void test_route_cycle(CuTest *tc) {
|
|
|
|
unit *u;
|
|
|
|
region *r;
|
|
|
|
struct locale *lang;
|
|
|
|
char buffer[32];
|
|
|
|
|
|
|
|
test_setup();
|
2018-01-13 08:51:40 +01:00
|
|
|
setup_move();
|
2017-12-11 16:24:06 +01:00
|
|
|
test_create_region(1, 0, NULL);
|
|
|
|
r = test_create_region(2, 0, NULL);
|
|
|
|
lang = test_create_locale();
|
|
|
|
CuAssertPtrNotNull(tc, LOC(lang, shortdirections[D_WEST]));
|
|
|
|
u = test_create_unit(test_create_faction(NULL), r);
|
|
|
|
u->faction->locale = lang;
|
|
|
|
CuAssertIntEquals(tc, RCF_WALK, u->_race->flags & RCF_WALK);
|
|
|
|
u->orders = create_order(K_ROUTE, u->faction->locale, "WEST EAST NW");
|
|
|
|
CuAssertStrEquals(tc, "route WEST EAST NW", get_command(u->orders, lang, buffer, sizeof(buffer)));
|
|
|
|
init_order(u->orders, u->faction->locale);
|
|
|
|
move_cmd(u, u->orders);
|
2018-01-13 08:51:40 +01:00
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "moveblocked"));
|
2017-12-11 16:24:06 +01:00
|
|
|
CuAssertIntEquals(tc, 1, u->region->x);
|
|
|
|
CuAssertStrEquals(tc, "route east nw west", get_command(u->orders, lang, buffer, sizeof(buffer)));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2017-12-11 16:24:06 +01:00
|
|
|
}
|
|
|
|
|
2018-04-22 12:00:58 +02:00
|
|
|
static void test_cycle_route(CuTest *tc) {
|
|
|
|
struct locale *lang;
|
|
|
|
char buffer[32];
|
|
|
|
order *ord, *onew;
|
|
|
|
|
|
|
|
test_setup();
|
|
|
|
lang = test_create_locale();
|
|
|
|
CuAssertPtrNotNull(tc, LOC(lang, shortdirections[D_WEST]));
|
|
|
|
|
|
|
|
ord = create_order(K_ROUTE, lang, "WEST EAST PAUSE NW");
|
|
|
|
CuAssertStrEquals(tc, "route WEST EAST PAUSE NW", get_command(ord, lang, buffer, sizeof(buffer)));
|
|
|
|
|
|
|
|
onew = cycle_route(ord, lang, 1);
|
|
|
|
CuAssertStrEquals(tc, "route east PAUSE nw west", get_command(onew, lang, buffer, sizeof(buffer)));
|
|
|
|
free_order(onew);
|
|
|
|
|
|
|
|
onew = cycle_route(ord, lang, 2);
|
|
|
|
CuAssertStrEquals(tc, "route nw west east PAUSE", get_command(onew, lang, buffer, sizeof(buffer)));
|
|
|
|
free_order(onew);
|
|
|
|
|
|
|
|
free_order(ord);
|
|
|
|
test_teardown();
|
|
|
|
}
|
|
|
|
|
2017-12-11 16:24:06 +01:00
|
|
|
static void test_route_pause(CuTest *tc) {
|
|
|
|
unit *u;
|
|
|
|
region *r;
|
|
|
|
struct locale *lang;
|
|
|
|
char buffer[32];
|
|
|
|
|
|
|
|
test_setup();
|
2018-01-13 08:51:40 +01:00
|
|
|
setup_move();
|
2017-12-11 16:24:06 +01:00
|
|
|
test_create_region(1, 0, NULL);
|
|
|
|
r = test_create_region(2, 0, NULL);
|
|
|
|
lang = test_create_locale();
|
|
|
|
CuAssertPtrNotNull(tc, LOC(lang, shortdirections[D_WEST]));
|
|
|
|
u = test_create_unit(test_create_faction(NULL), r);
|
|
|
|
u->faction->locale = lang;
|
|
|
|
CuAssertIntEquals(tc, RCF_WALK, u->_race->flags & RCF_WALK);
|
|
|
|
u->orders = create_order(K_ROUTE, u->faction->locale, "PAUSE EAST NW");
|
|
|
|
CuAssertStrEquals(tc, "route PAUSE EAST NW", get_command(u->orders, lang, buffer, sizeof(buffer)));
|
|
|
|
init_order(u->orders, u->faction->locale);
|
|
|
|
move_cmd(u, u->orders);
|
|
|
|
CuAssertIntEquals(tc, 2, u->region->x);
|
|
|
|
CuAssertStrEquals(tc, "route PAUSE EAST NW", get_command(u->orders, lang, buffer, sizeof(buffer)));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2017-12-11 16:24:06 +01:00
|
|
|
}
|
|
|
|
|
2017-12-26 06:26:56 +01:00
|
|
|
static void test_movement_speed_dragon(CuTest *tc) {
|
|
|
|
unit *u;
|
|
|
|
race *rc;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2017-12-26 06:26:56 +01:00
|
|
|
rc = test_create_race("dragon");
|
|
|
|
rc->flags |= RCF_DRAGON;
|
|
|
|
rc->speed = 1.5;
|
|
|
|
u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, NULL));
|
|
|
|
CuAssertIntEquals(tc, 6, movement_speed(u));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2017-12-26 06:26:56 +01:00
|
|
|
}
|
|
|
|
|
2018-04-22 19:08:56 +02:00
|
|
|
static void test_make_movement_order(CuTest *tc) {
|
|
|
|
order *ord;
|
|
|
|
char buffer[32];
|
|
|
|
struct locale *lang;
|
|
|
|
direction_t steps[] = { D_EAST, D_WEST, D_EAST, D_WEST };
|
|
|
|
|
|
|
|
test_setup();
|
|
|
|
lang = test_create_locale();
|
|
|
|
|
|
|
|
ord = make_movement_order(lang, steps, 2);
|
|
|
|
CuAssertStrEquals(tc, "move east west", get_command(ord, lang, buffer, sizeof(buffer)));
|
|
|
|
free_order(ord);
|
|
|
|
|
|
|
|
ord = make_movement_order(lang, steps, 4);
|
|
|
|
CuAssertStrEquals(tc, "move east west east west", get_command(ord, lang, buffer, sizeof(buffer)));
|
|
|
|
free_order(ord);
|
|
|
|
|
|
|
|
test_teardown();
|
|
|
|
}
|
|
|
|
|
2011-03-09 06:06:38 +01:00
|
|
|
CuSuite *get_move_suite(void)
|
|
|
|
{
|
2014-10-03 21:26:11 +02:00
|
|
|
CuSuite *suite = CuSuiteNew();
|
2017-10-06 22:15:48 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_movement_speed);
|
2017-12-26 06:26:56 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_movement_speed_dragon);
|
2015-04-14 02:32:01 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_walkingcapacity);
|
2014-10-03 21:26:11 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_not_allowed_in_coast);
|
2016-12-16 07:29:43 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_leave_trail);
|
2014-10-03 21:26:11 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_allowed_without_harbormaster);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_blocked_by_harbormaster);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_has_harbormaster_contact);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_has_harbormaster_ally);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_has_harbormaster_same_faction);
|
2015-09-24 10:28:43 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_trails);
|
|
|
|
SUITE_ADD_TEST(suite, test_age_trails);
|
2015-11-15 02:20:55 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_no_overload);
|
2015-11-29 21:06:35 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_empty);
|
2017-12-25 23:22:19 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_no_drift_damage);
|
2015-11-15 02:20:55 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_normal_overload);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_no_real_overload);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_big_overload);
|
|
|
|
SUITE_ADD_TEST(suite, test_ship_ridiculous_overload);
|
2015-11-17 15:47:43 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_ridiculous_overload_bad);
|
2015-11-15 02:20:55 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_ridiculous_overload_no_captain);
|
2015-11-19 12:36:15 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_ship_damage_overload);
|
2015-11-14 16:47:14 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_follow_ship_msg);
|
2016-06-10 18:24:18 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_drifting_ships);
|
2017-12-11 16:24:06 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_route_cycle);
|
2018-04-22 12:00:58 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_cycle_route);
|
2017-12-11 16:24:06 +01:00
|
|
|
SUITE_ADD_TEST(suite, test_route_pause);
|
2018-04-22 19:08:56 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_make_movement_order);
|
2014-10-03 21:26:11 +02:00
|
|
|
return suite;
|
2011-03-09 06:06:38 +01:00
|
|
|
}
|