forked from github/server
fix gcc build, ebable new test.
This commit is contained in:
parent
9848ba08d0
commit
6e24fe9be2
2 changed files with 5 additions and 6 deletions
|
@ -12,12 +12,10 @@ ally * ally_find(ally *al, const struct faction *f) {
|
||||||
|
|
||||||
ally * ally_add(ally **al_p, struct faction *f) {
|
ally * ally_add(ally **al_p, struct faction *f) {
|
||||||
ally * al;
|
ally * al;
|
||||||
if (f) {
|
while (*al_p) {
|
||||||
while (*al_p) {
|
al = *al_p;
|
||||||
al = *al_p;
|
if (f && al->faction == f) return al;
|
||||||
if (al->faction == f) return al;
|
al_p = &al->next;
|
||||||
al_p = &al->next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
al = (ally *)malloc(sizeof(ally));
|
al = (ally *)malloc(sizeof(ally));
|
||||||
al->faction = f;
|
al->faction = f;
|
||||||
|
|
|
@ -37,6 +37,7 @@ CuSuite *get_ally_suite(void)
|
||||||
{
|
{
|
||||||
CuSuite *suite = CuSuiteNew();
|
CuSuite *suite = CuSuiteNew();
|
||||||
SUITE_ADD_TEST(suite, test_ally);
|
SUITE_ADD_TEST(suite, test_ally);
|
||||||
|
SUITE_ADD_TEST(suite, test_ally_null);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue