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]; static char buf[256];
gamedate gd; gamedate gd;
const char *week = "a_week", *month = "a_month";
assert(weeknames2); if (weeknames2) {
assert(monthnames); week = weeknames2[gd.week];
}
if (monthnames) {
month = monthnames[gd.month];
}
get_gamedate(turn, &gd); get_gamedate(turn, &gd);
sprintf(buf, "in %s des Monats %s im Jahre %d %s.", sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
LOC(lang, weeknames2[gd.week]), LOC(lang, week),
LOC(lang, monthnames[gd.month]), LOC(lang, month),
gd.year, agename ? LOC(lang, agename) : ""); gd.year, agename ? LOC(lang, agename) : "");
return buf; return buf;
} }

View File

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

View File

@ -36,7 +36,7 @@ VALGRIND=`which valgrind`
SERVER=../Debug/eressea/eressea SERVER=../Debug/eressea/eressea
if [ -n "$VALGRIND" ]; then if [ -n "$VALGRIND" ]; then
SUPP=../share/ubuntu-12_04.supp 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 fi
echo "running $SERVER" echo "running $SERVER"
$SERVER -t 184 test-turn.lua $SERVER -t 184 test-turn.lua