From 486a4b84060532a141b2c68deb1a993b240aacab Mon Sep 17 00:00:00 2001 From: Philipp Dreher Date: Sat, 31 Oct 2015 16:55:59 +0100 Subject: [PATCH] Revert "WIP rework of test for description regarding functionality of locales" This reverts commit c3add85739a243a8a4ed975d6ff9f72bb12344bc. --- src/items/xerewards.test.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/items/xerewards.test.c b/src/items/xerewards.test.c index 44590bfdc..ddaab85f3 100644 --- a/src/items/xerewards.test.c +++ b/src/items/xerewards.test.c @@ -9,7 +9,6 @@ #include #include -#include #include @@ -24,17 +23,16 @@ static void test_manacrystal(CuTest *tc) { static void test_skillpotion(CuTest *tc) { unit *u; + faction *f; const struct item_type *itype; - - struct locale* pLang = NULL; const char* pPotionText = NULL; const char* pDescription = NULL; test_cleanup(); test_create_world(); - init_locales(); - u = test_create_unit(test_create_faction(NULL), findregion(0, 0)); + f = test_create_faction(NULL); + u = test_create_unit(f, findregion(0, 0)); itype = test_create_itemtype("skillpotion"); change_resource(u, itype->rtype, 2); CuAssertIntEquals(tc, 1, use_skillpotion(u, itype, 1, NULL)); @@ -42,10 +40,7 @@ static void test_skillpotion(CuTest *tc) { pPotionText = mkname("potion", "skillpotion"); CuAssertPtrNotNull(tc, pPotionText); - pLang = get_locale("de"); - CuAssertPtrNotNull(tc, pLang); - - pDescription = locale_string(pLang, pPotionText, true); + pDescription = LOC(f->locale, pPotionText); CuAssertPtrNotNull(tc, pDescription); CuAssert(tc, "Description empty", strlen(pDescription) == 0);