forked from github/server
Merge branch 'master' into release-3-5
Conflicts: src/laws.test.c
This commit is contained in:
commit
29753985f7
|
@ -36,3 +36,4 @@ game-e3/reports/
|
|||
*.log.*
|
||||
tags
|
||||
Thumbs.db
|
||||
.gdb_history
|
||||
|
|
|
@ -12,7 +12,6 @@ locales = de,en
|
|||
install = .
|
||||
paths = lunit:scripts
|
||||
maxnmrs = 20
|
||||
rules = e2
|
||||
|
||||
[editor]
|
||||
color = 1
|
||||
|
|
|
@ -5,6 +5,6 @@ end
|
|||
rules=''
|
||||
if config.rules then
|
||||
rules = config.rules .. '/'
|
||||
end
|
||||
read_xml(confdir .. rules .. 'config.xml', confdir .. rules .. 'catalog.xml')
|
||||
eressea.config.read(rules .. 'config.json', confdir)
|
||||
end
|
||||
|
|
|
@ -696,13 +696,12 @@ static void test_reserve_self(CuTest *tc) {
|
|||
|
||||
static void statistic_test(CuTest *tc, int peasants, int luck, int maxp,
|
||||
double variance, int min_value, int max_value) {
|
||||
int effect, i;
|
||||
for (i = 0; i < 1000; ++i) {
|
||||
int effect;
|
||||
|
||||
effect = peasant_luck_effect(peasants, luck, maxp, variance);
|
||||
CuAssertTrue(tc, min_value <= effect);
|
||||
CuAssertTrue(tc, max_value >= effect);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_peasant_luck_effect(CuTest *tc) {
|
||||
const char *plf = get_param(global.parameters, "rules.peasants.peasantluck.factor");
|
||||
|
@ -713,6 +712,13 @@ static void test_peasant_luck_effect(CuTest *tc) {
|
|||
|
||||
statistic_test(tc, 100, 0, 1000, 0, 0, 0);
|
||||
statistic_test(tc, 100, 2, 1000, 0, 1, 1);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/*
|
||||
statistic_test(tc, 1000, 400, 1000, 0, (int)(400 * 10 * 0.001 * .75),
|
||||
(int)(400 * 10 * 0.001 * .75));
|
||||
*/
|
||||
>>>>>>> master
|
||||
statistic_test(tc, 1000, 400, 1000, 0, 3, 3);
|
||||
statistic_test(tc, 1000, 1000, 2000, .5, 1, 501);
|
||||
|
||||
|
|
Loading…
Reference in New Issue