2015-09-12 12:24:10 +02:00
|
|
|
#include "prefix.h"
|
|
|
|
|
2015-09-12 12:41:04 +02:00
|
|
|
#include <tests.h>
|
|
|
|
|
|
|
|
#include <stddef.h>
|
2015-09-12 12:24:10 +02:00
|
|
|
#include <CuTest.h>
|
|
|
|
|
2015-09-12 12:41:04 +02:00
|
|
|
static void test_add_prefix(CuTest *tc) {
|
|
|
|
test_cleanup();
|
|
|
|
CuAssertPtrEquals(tc, 0, race_prefixes);
|
|
|
|
add_raceprefix("sea");
|
|
|
|
CuAssertPtrNotNull(tc, race_prefixes);
|
|
|
|
CuAssertStrEquals(tc, "sea", race_prefixes[0]);
|
|
|
|
CuAssertPtrEquals(tc, 0, race_prefixes[1]);
|
|
|
|
add_raceprefix("moon");
|
|
|
|
CuAssertStrEquals(tc, "sea", race_prefixes[0]);
|
|
|
|
CuAssertStrEquals(tc, "moon", race_prefixes[1]);
|
|
|
|
CuAssertPtrEquals(tc, 0, race_prefixes[2]);
|
|
|
|
free_prefixes();
|
|
|
|
CuAssertPtrEquals(tc, 0, race_prefixes);
|
|
|
|
test_cleanup();
|
|
|
|
}
|
|
|
|
|
2015-09-12 12:24:10 +02:00
|
|
|
CuSuite *get_prefix_suite(void)
|
|
|
|
{
|
|
|
|
CuSuite *suite = CuSuiteNew();
|
2015-09-12 12:41:04 +02:00
|
|
|
SUITE_ADD_TEST(suite, test_add_prefix);
|
2015-09-12 12:24:10 +02:00
|
|
|
return suite;
|
|
|
|
}
|