Merge branch 'release-3-5' of github.com:eressea/server into release-3-5

This commit is contained in:
Enno Rehling 2015-06-08 08:49:14 +02:00
commit 5cf02e35e1
1 changed files with 2 additions and 3 deletions

View File

@ -700,7 +700,7 @@ static void statistic_test(CuTest *tc, int peasants, int luck, int maxp,
for (i = 0; i < 1000; ++i) { for (i = 0; i < 1000; ++i) {
effect = peasant_luck_effect(peasants, luck, maxp, variance); effect = peasant_luck_effect(peasants, luck, maxp, variance);
CuAssertTrue(tc, min_value <= effect); CuAssertTrue(tc, min_value <= effect);
// broken CuAssertTrue(tc, max_value >= effect); CuAssertTrue(tc, max_value >= effect);
} }
} }
@ -713,8 +713,7 @@ static void test_peasant_luck_effect(CuTest *tc) {
statistic_test(tc, 100, 0, 1000, 0, 0, 0); statistic_test(tc, 100, 0, 1000, 0, 0, 0);
statistic_test(tc, 100, 2, 1000, 0, 1, 1); statistic_test(tc, 100, 2, 1000, 0, 1, 1);
statistic_test(tc, 1000, 400, 1000, 0, (int)(400 * 10 * 0.001 * .75), statistic_test(tc, 1000, 400, 1000, 0, 3, 3);
(int)(400 * 10 * 0.001 * .75));
statistic_test(tc, 1000, 1000, 2000, .5, 1, 501); statistic_test(tc, 1000, 1000, 2000, .5, 1, 501);
set_param(&global.parameters, "rules.peasants.growth.factor", "1"); set_param(&global.parameters, "rules.peasants.growth.factor", "1");