Angband
Macros | Functions | Variables
z-info.c File Reference
#include "unit-test.h"
#include "unit-test-data.h"
#include "init.h"

Macros

#define TEST_MAX(l, u)
#define TEST_MON(l, u)

Functions

int setup_tests (void **state)
int teardown_tests (void *state)
int test_negative (void *state)
int test_badmax (void *state)

Variables

const char * suite_name = "parse/z-info"
struct test tests []

Macro Definition Documentation

#define TEST_MAX (   l,
 
)
Value:
int test_##l(void *s) { \
struct angband_constants *m = parser_priv(s); \
char buf[64]; \
errr r; \
snprintf(buf, sizeof(buf), "level-max:%s:%d", u, __LINE__); \
r = parser_parse(s, buf); \
eq(m->l, __LINE__); \
eq(r, 0); \
ok; \
}
#define TEST_MON (   l,
 
)
Value:
int test_##l(void *s) { \
struct angband_constants *m = parser_priv(s); \
char buf[64]; \
errr r; \
snprintf(buf, sizeof(buf), "mon-gen:%s:%d", u, __LINE__); \
r = parser_parse(s, buf); \
eq(m->l, __LINE__); \
eq(r, 0); \
ok; \
}

Function Documentation

int setup_tests ( void **  state)
int teardown_tests ( void state)

References parser_destroy().

int test_badmax ( void state)

References eq, ok, and parser_parse().

int test_negative ( void state)

References eq, ok, and parser_parse().

Variable Documentation

const char* suite_name = "parse/z-info"
struct test tests[]
Initial value:
{
{ "negative", test_negative },
{ "badmax", test_badmax },
{ "monsters_max", test_level_monster_max },
{ "mon_chance", test_alloc_monster_chance },
{ "monsters_min", test_level_monster_min },
{ "town_day", test_town_monsters_day },
{ "town_night", test_town_monsters_night },
{ "repro_max", test_repro_monster_max },
{ NULL, NULL }
}