2016-08-23 07:38:44 +02:00
|
|
|
#include <platform.h>
|
2016-08-22 21:27:24 +02:00
|
|
|
#include <tests.h>
|
|
|
|
#include "volcano.h"
|
|
|
|
|
2016-08-23 07:38:44 +02:00
|
|
|
#include <kernel/region.h>
|
|
|
|
#include <kernel/terrain.h>
|
2016-08-22 21:27:24 +02:00
|
|
|
#include <CuTest.h>
|
|
|
|
|
|
|
|
static void test_volcano_update(CuTest *tc) {
|
2016-08-23 07:38:44 +02:00
|
|
|
region *r;
|
|
|
|
const struct terrain_type *t_volcano, *t_active;
|
|
|
|
|
|
|
|
t_volcano = test_create_terrain("volcano", LAND_REGION);
|
|
|
|
t_active = test_create_terrain("activevolcano", LAND_REGION);
|
2016-08-22 21:27:24 +02:00
|
|
|
test_cleanup();
|
2016-08-23 07:38:44 +02:00
|
|
|
r = test_create_region(0, 0, t_active);
|
2016-08-22 21:27:24 +02:00
|
|
|
volcano_update();
|
2016-08-23 07:38:44 +02:00
|
|
|
CuAssertPtrEquals(tc, (void *)t_volcano, (void *)r->terrain);
|
2016-08-22 21:27:24 +02:00
|
|
|
test_cleanup();
|
|
|
|
}
|
|
|
|
|
|
|
|
CuSuite *get_volcano_suite(void)
|
|
|
|
{
|
|
|
|
CuSuite *suite = CuSuiteNew();
|
|
|
|
SUITE_ADD_TEST(suite, test_volcano_update);
|
|
|
|
return suite;
|
|
|
|
}
|