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

◆ TEST_MAX

#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; \
}
void * parser_priv(struct parser *p)
Gets parser's private data.
Definition: parser.c:336
enum parser_error parser_parse(struct parser *p, const char *line)
Parses the provided line.
Definition: parser.c:205
png_bytep buf
Definition: libpng12/png.h:2815
Information about maximal indices of certain arrays.
Definition: init.h:27

◆ TEST_MON

#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; \
}
void * parser_priv(struct parser *p)
Gets parser's private data.
Definition: parser.c:336
enum parser_error parser_parse(struct parser *p, const char *line)
Parses the provided line.
Definition: parser.c:205
png_bytep buf
Definition: libpng12/png.h:2815
Information about maximal indices of certain arrays.
Definition: init.h:27

Function Documentation

◆ setup_tests()

int setup_tests ( void **  state)

◆ teardown_tests()

int teardown_tests ( void state)

◆ test_badmax()

int test_badmax ( void state)

References eq, ok, and parser_parse().

◆ test_negative()

int test_negative ( void state)

References eq, ok, and parser_parse().

Variable Documentation

◆ suite_name

const char* suite_name = "parse/z-info"

◆ tests

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 }
}
int test_badmax(void *state)
Definition: z-info.c:27
int test_negative(void *state)
Definition: z-info.c:21
NULL
Definition: list-summon-types.h:18