2017-01-10 18:20:47 +01:00
|
|
|
#include <platform.h>
|
2015-09-09 15:45:20 +02:00
|
|
|
#include "donations.h"
|
|
|
|
|
|
|
|
#include <kernel/faction.h>
|
|
|
|
#include <kernel/region.h>
|
|
|
|
#include <tests.h>
|
|
|
|
|
|
|
|
#include <CuTest.h>
|
|
|
|
|
|
|
|
static void test_add_donation(CuTest *tc) {
|
|
|
|
faction *f1, *f2;
|
|
|
|
region *r;
|
|
|
|
|
2017-12-27 19:58:39 +01:00
|
|
|
test_setup();
|
2018-01-14 09:38:26 +01:00
|
|
|
r = test_create_region(0, 0, NULL);
|
|
|
|
f1 = test_create_faction(NULL);
|
|
|
|
f2 = test_create_faction(NULL);
|
2015-09-09 15:45:20 +02:00
|
|
|
add_donation(f1, f2, 100, r);
|
|
|
|
report_donations();
|
|
|
|
CuAssertPtrNotNull(tc, test_find_messagetype(r->individual_messages->msgs, "donation"));
|
|
|
|
free_donations();
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2015-09-09 15:45:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CuSuite *get_donations_suite(void)
|
|
|
|
{
|
|
|
|
CuSuite *suite = CuSuiteNew();
|
|
|
|
SUITE_ADD_TEST(suite, test_add_donation);
|
|
|
|
return suite;
|
|
|
|
}
|