forked from github/server
testing test_seen_interval
This commit is contained in:
parent
8562a6d072
commit
2e0482973e
|
@ -8,12 +8,22 @@
|
||||||
#include <tests.h>
|
#include <tests.h>
|
||||||
|
|
||||||
static void test_seen_region(CuTest *tc) {
|
static void test_seen_region(CuTest *tc) {
|
||||||
region *r;
|
region *r, *first, *last;
|
||||||
seen_region **seen;
|
seen_region **seen;
|
||||||
|
int dir;
|
||||||
|
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
r = test_create_region(0, 0, 0);
|
r = test_create_region(0, 0, 0);
|
||||||
|
for (dir=0;dir!=MAXDIRECTIONS;++dir) {
|
||||||
|
region *rn = test_create_region(delta_x[dir], delta_y[dir], 0);
|
||||||
|
}
|
||||||
seen = seen_init();
|
seen = seen_init();
|
||||||
|
add_seen(seen, r, see_unit, true);
|
||||||
|
first = r;
|
||||||
|
last = 0;
|
||||||
|
get_seen_interval(seen, &first, &last);
|
||||||
|
CuAssertPtrEquals(tc, r, first);
|
||||||
|
CuAssertPtrEquals(tc, 0, last);
|
||||||
seen_done(seen);
|
seen_done(seen);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue