From 9188f6fbb62e82f747839e33aaec77b6841b7626 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 26 Nov 2017 15:06:52 +0100 Subject: [PATCH] scale_number test revised --- src/kernel/unit.test.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/kernel/unit.test.c b/src/kernel/unit.test.c index fcd737ff8..69932afbd 100644 --- a/src/kernel/unit.test.c +++ b/src/kernel/unit.test.c @@ -106,13 +106,22 @@ static void test_scale_number(CuTest *tc) { ptype = new_potiontype(it_get_or_create(rt_get_or_create("hodor")), 1); u = test_create_unit(test_create_faction(test_create_race("human")), findregion(0, 0)); change_effect(u, ptype, 1); + u->hp = 35; CuAssertIntEquals(tc, 1, u->number); - CuAssertIntEquals(tc, 20, u->hp); + CuAssertIntEquals(tc, 35, u->hp); CuAssertIntEquals(tc, 1, get_effect(u, ptype)); scale_number(u, 2); CuAssertIntEquals(tc, 2, u->number); - CuAssertIntEquals(tc, 40, u->hp); - CuAssertIntEquals(tc, 2, get_effect(u, ptype)); + CuAssertIntEquals(tc, 35 * u->number, u->hp); + CuAssertIntEquals(tc, u->number, get_effect(u, ptype)); + scale_number(u, 8237); + CuAssertIntEquals(tc, 8237, u->number); + CuAssertIntEquals(tc, 35 * u->number, u->hp); + CuAssertIntEquals(tc, u->number, get_effect(u, ptype)); + scale_number(u, 8100); + CuAssertIntEquals(tc, 8100, u->number); + CuAssertIntEquals(tc, 35 * u->number, u->hp); + CuAssertIntEquals(tc, u->number, get_effect(u, ptype)); set_level(u, SK_ALCHEMY, 1); scale_number(u, 0); CuAssertIntEquals(tc, 0, get_level(u, SK_ALCHEMY));