forked from github/server
BUG 2356: add a failing test.
This commit is contained in:
parent
6d050bb6c2
commit
293cb78de8
|
@ -137,11 +137,13 @@ static void test_write_flag(CuTest *tc) {
|
||||||
mstream_init(&data.strm);
|
mstream_init(&data.strm);
|
||||||
gamedata_init(&data, &store, RELEASE_VERSION);
|
gamedata_init(&data, &store, RELEASE_VERSION);
|
||||||
|
|
||||||
setup_curse(&fix, "gbdream");
|
setup_curse(&fix, "magicwalls");
|
||||||
c = fix.c;
|
c = fix.c;
|
||||||
r = fix.r;
|
r = fix.r;
|
||||||
uid = r->uid;
|
uid = r->uid;
|
||||||
c->flags = CURSE_ISNEW;
|
c_setflag(c, CURSE_ISNEW);
|
||||||
|
c_setflag(c, CURSE_IMMUNE);
|
||||||
|
CuAssertIntEquals(tc, c->type->flags | CURSE_IMMUNE | CURSE_ISNEW, c_flags(c));
|
||||||
write_game(&data);
|
write_game(&data);
|
||||||
free_gamedata();
|
free_gamedata();
|
||||||
data.strm.api->rewind(data.strm.handle);
|
data.strm.api->rewind(data.strm.handle);
|
||||||
|
@ -150,7 +152,7 @@ static void test_write_flag(CuTest *tc) {
|
||||||
CuAssertPtrNotNull(tc, r);
|
CuAssertPtrNotNull(tc, r);
|
||||||
CuAssertPtrNotNull(tc, r->attribs);
|
CuAssertPtrNotNull(tc, r->attribs);
|
||||||
c = (curse *)r->attribs->data.v;
|
c = (curse *)r->attribs->data.v;
|
||||||
CuAssertIntEquals(tc, CURSE_ISNEW, c->flags);
|
CuAssertIntEquals(tc, c->type->flags | CURSE_IMMUNE | CURSE_ISNEW, c_flags(c));
|
||||||
|
|
||||||
mstream_done(&data.strm);
|
mstream_done(&data.strm);
|
||||||
gamedata_done(&data);
|
gamedata_done(&data);
|
||||||
|
|
Loading…
Reference in New Issue