diff --git a/src/laws.test.c b/src/laws.test.c index b7a8e4693..75c19a798 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -781,7 +781,7 @@ CuSuite *get_laws_suite(void) SUITE_ADD_TEST(suite, test_force_leave_ships); SUITE_ADD_TEST(suite, test_force_leave_ships_on_ocean); SUITE_ADD_TEST(suite, test_peasant_luck_effect); - DISABLE_TEST(suite, test_luck_message); + SUITE_ADD_TEST(suite, test_luck_message); return suite; } diff --git a/src/tests.c b/src/tests.c index f10befba6..07dcef979 100644 --- a/src/tests.c +++ b/src/tests.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -239,22 +240,24 @@ const message_type *register_msg(const char *type, int n_param, ...) { void assert_messages(struct CuTest * tc, struct mlist *msglist, const message_type **types, int num_msgs, bool exact_match, ...) { + char buf[100]; va_list args; - int found, argc = -1; + int found = 0, argc = -1; struct message *msg; bool match = true; va_start(args, exact_match); while (msglist) { + msg = msglist->msg; if (found >= num_msgs) { if (exact_match) { - CuFail(tc, "too many messages"); + slprintf(buf, sizeof(buf), "too many messages: %s", msg->type->name); + CuFail(tc, buf); } else { break; } } - msg = msglist->msg; if (exact_match || match) argc = va_arg(args, int);