quickly fix summary test when there is no calendar defined

This commit is contained in:
Enno Rehling 2016-09-09 17:29:17 +02:00
parent 5864651b28
commit a62a14956f
3 changed files with 12 additions and 5 deletions

View File

@ -142,13 +142,18 @@ static char *gamedate2(const struct locale *lang)
{
static char buf[256];
gamedate gd;
const char *week = "a_week", *month = "a_month";
assert(weeknames2);
assert(monthnames);
if (weeknames2) {
week = weeknames2[gd.week];
}
if (monthnames) {
month = monthnames[gd.month];
}
get_gamedate(turn, &gd);
sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
LOC(lang, weeknames2[gd.week]),
LOC(lang, monthnames[gd.month]),
LOC(lang, week),
LOC(lang, month),
gd.year, agename ? LOC(lang, agename) : "");
return buf;
}

View File

@ -6,6 +6,8 @@
#include <CuTest.h>
#include "tests.h"
#include <stdio.h>
static void test_summary(CuTest * tc)
{
struct summary *sum;

View File

@ -36,7 +36,7 @@ VALGRIND=`which valgrind`
SERVER=../Debug/eressea/eressea
if [ -n "$VALGRIND" ]; then
SUPP=../share/ubuntu-12_04.supp
SERVER="$VALGRIND --track-origins=yes --gen-suppressions=all --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER"
SERVER="$VALGRIND --track-origins=yes --gen-suppressions=all --suppressions=$SUPP --error-exitcode=1 --leak-check=full $SERVER"
fi
echo "running $SERVER"
$SERVER -t 184 test-turn.lua