Revert "WIP rework of test for description regarding functionality of locales"

This reverts commit c3add85739.
This commit is contained in:
Philipp Dreher 2015-10-31 16:55:59 +01:00
parent c3add85739
commit 486a4b8406
1 changed files with 4 additions and 9 deletions

View File

@ -9,7 +9,6 @@
#include <kernel/region.h> #include <kernel/region.h>
#include <util/language.h> #include <util/language.h>
#include <util/language_struct.h>
#include <string.h> #include <string.h>
@ -24,17 +23,16 @@ static void test_manacrystal(CuTest *tc) {
static void test_skillpotion(CuTest *tc) { static void test_skillpotion(CuTest *tc) {
unit *u; unit *u;
faction *f;
const struct item_type *itype; const struct item_type *itype;
struct locale* pLang = NULL;
const char* pPotionText = NULL; const char* pPotionText = NULL;
const char* pDescription = NULL; const char* pDescription = NULL;
test_cleanup(); test_cleanup();
test_create_world(); 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"); itype = test_create_itemtype("skillpotion");
change_resource(u, itype->rtype, 2); change_resource(u, itype->rtype, 2);
CuAssertIntEquals(tc, 1, use_skillpotion(u, itype, 1, NULL)); CuAssertIntEquals(tc, 1, use_skillpotion(u, itype, 1, NULL));
@ -42,10 +40,7 @@ static void test_skillpotion(CuTest *tc) {
pPotionText = mkname("potion", "skillpotion"); pPotionText = mkname("potion", "skillpotion");
CuAssertPtrNotNull(tc, pPotionText); CuAssertPtrNotNull(tc, pPotionText);
pLang = get_locale("de"); pDescription = LOC(f->locale, pPotionText);
CuAssertPtrNotNull(tc, pLang);
pDescription = locale_string(pLang, pPotionText, true);
CuAssertPtrNotNull(tc, pDescription); CuAssertPtrNotNull(tc, pDescription);
CuAssert(tc, "Description empty", strlen(pDescription) == 0); CuAssert(tc, "Description empty", strlen(pDescription) == 0);