This commit is contained in:
Enno Rehling 2018-05-09 22:21:56 +02:00
commit fc052034ac
2 changed files with 2 additions and 2 deletions

View file

@ -112,8 +112,7 @@ static void test_rc_set_param(CuTest *tc) {
CuAssertPtrEquals(tc, NULL, rc->options); CuAssertPtrEquals(tc, NULL, rc->options);
rc_set_param(rc, "recruit_multi", "0.5"); rc_set_param(rc, "recruit_multi", "0.5");
CuAssertDblEquals(tc, 0.5, rc->recruit_multi, 0.0); CuAssertDblEquals(tc, 0.5, rc->recruit_multi, 0.0);
rc_set_param(rc, "migrants.formula", "1"); rc->flags |= RCF_MIGRANTS;
CuAssertIntEquals(tc, RCF_MIGRANTS, rc->flags&RCF_MIGRANTS);
CuAssertIntEquals(tc, MIGRANTS_LOG10, rc_migrants_formula(rc)); CuAssertIntEquals(tc, MIGRANTS_LOG10, rc_migrants_formula(rc));
rc_set_param(rc, "scare", "400"); rc_set_param(rc, "scare", "400");
CuAssertIntEquals(tc, 400, rc_scare(rc)); CuAssertIntEquals(tc, 400, rc_scare(rc));

View file

@ -218,6 +218,7 @@ unsigned int wang_hash(unsigned int a)
} }
char *str_strdup(const char *s) { char *str_strdup(const char *s) {
if (s == NULL) return NULL;
#ifdef HAVE_STRDUP #ifdef HAVE_STRDUP
return strdup(s); return strdup(s);
#elif defined(_MSC_VER) #elif defined(_MSC_VER)