repair the test for academies, make academy bonus use non-deprecated learn_skill

This commit is contained in:
Enno Rehling 2016-03-24 13:44:29 +01:00
parent 87b09cd3c6
commit f55168e7de
2 changed files with 3 additions and 6 deletions

View File

@ -27,8 +27,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
void academy_teaching_bonus(struct unit *u, skill_t sk, int academy) { void academy_teaching_bonus(struct unit *u, skill_t sk, int academy) {
if (academy && sk != NOSKILL) { if (academy && sk != NOSKILL) {
academy = academy / 30; /* anzahl gelehrter wochen, max. 10 */ learn_skill(u, sk, academy / STUDYDAYS);
learn_skill_depr(u, sk, academy / 30.0 / TEACHNUMBER);
} }
} }

View File

@ -230,14 +230,12 @@ static void test_academy_building(CuTest *tc) {
teach_cmd(u, u->thisorder); teach_cmd(u, u->thisorder);
learn_reset(); learn_reset();
CuAssertPtrNotNull(tc, msg = test_find_messagetype(u->faction->msgs, "teach_asgood")); CuAssertPtrNotNull(tc, msg = test_find_messagetype(u->faction->msgs, "teach_asgood"));
// FIXME: new injection function
#if 0
CuAssertPtrEquals(tc, u, (unit *)(msg)->parameters[0].v); CuAssertPtrEquals(tc, u, (unit *)(msg)->parameters[0].v);
CuAssertPtrEquals(tc, u2, (unit *)(msg)->parameters[3].v); CuAssertPtrEquals(tc, u2, (unit *)(msg)->parameters[3].v);
CuAssertPtrEquals(tc, u, log_learners[0].u); CuAssertPtrEquals(tc, u, log_learners[0].u);
CuAssertIntEquals(tc, SK_CROSSBOW, log_learners[0].sk); CuAssertIntEquals(tc, SK_CROSSBOW, log_learners[0].sk);
CuAssertIntEquals(tc, 10, log_learners[0].days); CuAssertIntEquals(tc, 15, log_learners[0].days);
#endif
test_cleanup(); test_cleanup();
} }