forked from github/server
BUG 2356: add a failing test.
This commit is contained in:
parent
6d050bb6c2
commit
293cb78de8
1 changed files with 7 additions and 5 deletions
|
@ -106,7 +106,7 @@ static void test_memstream(CuTest *tc) {
|
||||||
storage store;
|
storage store;
|
||||||
stream out = { 0 };
|
stream out = { 0 };
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int val=0;
|
int val = 0;
|
||||||
|
|
||||||
mstream_init(&out);
|
mstream_init(&out);
|
||||||
binstore_init(&store, &out);
|
binstore_init(&store, &out);
|
||||||
|
@ -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 a new issue