Skip to content

Commit

Permalink
also check message parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ennorehling committed Mar 31, 2024
1 parent 3487245 commit 60df1e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/move.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ static void test_holyground_blocks_undead_moves(CuTest* tc) {
region* r, *rt;
struct locale* lang;
race* rc;
message* msg;

test_setup();
setup_move();
Expand All @@ -1380,7 +1381,9 @@ static void test_holyground_blocks_undead_moves(CuTest* tc) {
move_cmd(u, u->thisorder);
CuAssertPtrEquals(tc, NULL, u->thisorder);
CuAssertPtrEquals(tc, NULL, test_find_messagetype(u->faction->msgs, "enterfail"));
CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "moveblocked"));
CuAssertPtrNotNull(tc, msg = test_find_messagetype(u->faction->msgs, "moveblocked"));
CuAssertPtrEquals(tc, u, msg->parameters[0].v);
CuAssertIntEquals(tc, D_WEST, msg->parameters[1].i);
CuAssertPtrEquals(tc, r, u->region);
test_teardown();
}
Expand All @@ -1390,6 +1393,7 @@ static void test_holyground_blocks_undead_follow(CuTest* tc) {
region* r, *rt;
struct locale* lang;
race* rc;
message* msg;

test_setup();
setup_move();
Expand Down Expand Up @@ -1419,7 +1423,9 @@ static void test_holyground_blocks_undead_follow(CuTest* tc) {
CuAssertPtrEquals(tc, NULL, test_find_messagetype(u2->faction->msgs, "enterfail"));
CuAssertPtrEquals(tc, NULL, test_find_messagetype(u2->faction->msgs, "moveblocked"));
CuAssertPtrEquals(tc, NULL, test_find_messagetype(u->faction->msgs, "moveblocked"));
CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "enterfail"));
CuAssertPtrNotNull(tc, msg = test_find_messagetype(u->faction->msgs, "enterfail"));
CuAssertPtrEquals(tc, u, msg->parameters[0].v);
CuAssertPtrEquals(tc, rt, msg->parameters[1].v);
test_teardown();
}

Expand Down

0 comments on commit 60df1e4

Please sign in to comment.