2011-03-09 06:06:38 +01:00
|
|
|
#include <platform.h>
|
|
|
|
#include "types.h"
|
|
|
|
#include "curse.h"
|
|
|
|
|
|
|
|
#include <util/attrib.h>
|
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
#include <cutest/CuTest.h>
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
static void test_curse(CuTest * tc)
|
|
|
|
{
|
|
|
|
attrib *attrs = NULL;
|
|
|
|
curse *c, *result;
|
2010-08-08 10:06:34 +02:00
|
|
|
int cid;
|
|
|
|
|
|
|
|
curse_type ct_dummy = { "dummy", CURSETYP_NORM, 0, M_SUMEFFECT, NULL };
|
|
|
|
c = create_curse(NULL, &attrs, &ct_dummy, 1.0, 1, 1, 1);
|
|
|
|
cid = c->no;
|
|
|
|
result = findcurse(cid);
|
|
|
|
CuAssertPtrEquals(tc, c, result);
|
|
|
|
destroy_curse(c);
|
|
|
|
result = findcurse(cid);
|
|
|
|
CuAssertPtrEquals(tc, NULL, result);
|
|
|
|
}
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
CuSuite *get_curse_suite(void)
|
2010-08-08 10:06:34 +02:00
|
|
|
{
|
2011-03-07 08:02:35 +01:00
|
|
|
CuSuite *suite = CuSuiteNew();
|
2010-08-08 10:06:34 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_curse);
|
|
|
|
return suite;
|
|
|
|
}
|