BUG 2356: add a failing test.

This commit is contained in:
Enno Rehling 2017-08-18 19:36:17 +02:00
parent 6d050bb6c2
commit 293cb78de8
1 changed files with 7 additions and 5 deletions

View File

@ -137,11 +137,13 @@ static void test_write_flag(CuTest *tc) {
mstream_init(&data.strm);
gamedata_init(&data, &store, RELEASE_VERSION);
setup_curse(&fix, "gbdream");
setup_curse(&fix, "magicwalls");
c = fix.c;
r = fix.r;
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);
free_gamedata();
data.strm.api->rewind(data.strm.handle);
@ -150,7 +152,7 @@ static void test_write_flag(CuTest *tc) {
CuAssertPtrNotNull(tc, r);
CuAssertPtrNotNull(tc, r->attribs);
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);
gamedata_done(&data);