forked from github/server
test undead name generation.
This commit is contained in:
parent
020ab942ec
commit
eb8db3bfb9
|
@ -21,7 +21,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void register_names(void);
|
||||
|
||||
struct unit;
|
||||
typedef const char *(*name_func)(const struct unit *);
|
||||
void register_names(void);
|
||||
const char *abkz(const char *s, char *buf, size_t size, size_t maxchars);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "names.h"
|
||||
|
||||
#include <util/language.h>
|
||||
#include <util/functions.h>
|
||||
|
||||
#include <CuTest.h>
|
||||
|
@ -9,9 +10,15 @@
|
|||
|
||||
static void test_names(CuTest * tc)
|
||||
{
|
||||
name_func foo;
|
||||
test_cleanup();
|
||||
register_names();
|
||||
CuAssertPtrNotNull(tc, get_function("nameundead"));
|
||||
default_locale = test_create_locale();
|
||||
locale_setstring(default_locale, "undead_prefix_0", "Kleine");
|
||||
locale_setstring(default_locale, "undead_name_0", "Graue");
|
||||
locale_setstring(default_locale, "undead_postfix_0", "Kobolde");
|
||||
CuAssertPtrNotNull(tc, foo = (name_func)get_function("nameundead"));
|
||||
CuAssertStrEquals(tc, "Kleine Graue Kobolde", foo(NULL));
|
||||
CuAssertPtrNotNull(tc, get_function("nameskeleton"));
|
||||
CuAssertPtrNotNull(tc, get_function("namezombie"));
|
||||
CuAssertPtrNotNull(tc, get_function("nameghoul"));
|
||||
|
|
Loading…
Reference in New Issue