forked from github/server
fix build, missing limits.h include
This commit is contained in:
parent
1e669472a6
commit
d7e5876c62
2 changed files with 15 additions and 14 deletions
|
@ -53,6 +53,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
/* in spy steht der Unterschied zwischen Wahrnehmung des Opfers und
|
/* in spy steht der Unterschied zwischen Wahrnehmung des Opfers und
|
||||||
* Spionage des Spions */
|
* Spionage des Spions */
|
||||||
|
@ -61,7 +62,7 @@ void spy_message(int spy, const unit * u, const unit * target)
|
||||||
const char *str = report_kampfstatus(target, u->faction->locale);
|
const char *str = report_kampfstatus(target, u->faction->locale);
|
||||||
|
|
||||||
ADDMSG(&u->faction->msgs, msg_message("spyreport", "spy target status", u,
|
ADDMSG(&u->faction->msgs, msg_message("spyreport", "spy target status", u,
|
||||||
target, str));
|
target, str));
|
||||||
if (spy > 20) {
|
if (spy > 20) {
|
||||||
sc_mage *mage = get_mage(target);
|
sc_mage *mage = get_mage(target);
|
||||||
/* for mages, spells and magic school */
|
/* for mages, spells and magic school */
|
||||||
|
|
|
@ -68,9 +68,9 @@ static void test_simple_spy_message(CuTest *tc) {
|
||||||
static void set_factionstealth(unit *u, faction *f) {
|
static void set_factionstealth(unit *u, faction *f) {
|
||||||
attrib *a = a_find(u->attribs, &at_otherfaction);
|
attrib *a = a_find(u->attribs, &at_otherfaction);
|
||||||
if (!a)
|
if (!a)
|
||||||
a = a_add(&u->attribs, make_otherfaction(f));
|
a = a_add(&u->attribs, make_otherfaction(f));
|
||||||
else
|
else
|
||||||
a->data.v = f;
|
a->data.v = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_all_spy_message(CuTest *tc) {
|
static void test_all_spy_message(CuTest *tc) {
|
||||||
|
@ -92,11 +92,11 @@ static void test_all_spy_message(CuTest *tc) {
|
||||||
spy_message(99, fix.spy, fix.victim);
|
spy_message(99, fix.spy, fix.victim);
|
||||||
|
|
||||||
assert_messages(tc, fix.spy->faction->msgs->begin, fix.msg_types, 5, true,
|
assert_messages(tc, fix.spy->faction->msgs->begin, fix.msg_types, 5, true,
|
||||||
M_BASE,
|
M_BASE,
|
||||||
M_MAGE,
|
M_MAGE,
|
||||||
M_FACTION,
|
M_FACTION,
|
||||||
M_SKILLS,
|
M_SKILLS,
|
||||||
M_ITEMS);
|
M_ITEMS);
|
||||||
|
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ static void test_sabotage_self(CuTest *tc) {
|
||||||
r = test_create_region(0, 0, NULL);
|
r = test_create_region(0, 0, NULL);
|
||||||
assert(r);
|
assert(r);
|
||||||
u = test_create_unit(test_create_faction(NULL), r);
|
u = test_create_unit(test_create_faction(NULL), r);
|
||||||
assert(u && u->faction && u->region==r);
|
assert(u && u->faction && u->region == r);
|
||||||
u->ship = test_create_ship(r, test_create_shiptype("boat"));
|
u->ship = test_create_ship(r, test_create_shiptype("boat"));
|
||||||
assert(u->ship);
|
assert(u->ship);
|
||||||
ord = create_order(K_SABOTAGE, lang, "SCHIFF");
|
ord = create_order(K_SABOTAGE, lang, "SCHIFF");
|
||||||
|
@ -128,9 +128,9 @@ static void test_sabotage_self(CuTest *tc) {
|
||||||
|
|
||||||
CuSuite *get_spy_suite(void)
|
CuSuite *get_spy_suite(void)
|
||||||
{
|
{
|
||||||
CuSuite *suite = CuSuiteNew();
|
CuSuite *suite = CuSuiteNew();
|
||||||
SUITE_ADD_TEST(suite, test_simple_spy_message);
|
SUITE_ADD_TEST(suite, test_simple_spy_message);
|
||||||
SUITE_ADD_TEST(suite, test_all_spy_message);
|
SUITE_ADD_TEST(suite, test_all_spy_message);
|
||||||
SUITE_ADD_TEST(suite, test_sabotage_self);
|
SUITE_ADD_TEST(suite, test_sabotage_self);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue