moved convenience function for convenience

the formerly static function test_create_castorder is now available for
general usage via tests.h/.c
This commit is contained in:
Philipp Dreher 2015-11-02 16:12:56 +01:00
parent f550431118
commit 0e8365c802
3 changed files with 10 additions and 10 deletions

View File

@ -19,16 +19,6 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
static void test_create_castorder(castorder *co, unit *u, int level, float force, int range) {
struct locale * lang;
order *ord;
lang = get_or_create_locale("en");
create_castorder(co, u, NULL, NULL, u->region, level, force, range, ord = create_order(K_CAST, lang, ""), NULL);
free_order(ord);
}
static void test_good_dreams(CuTest *tc) { static void test_good_dreams(CuTest *tc) {
struct region *r; struct region *r;
struct faction *f1, *f2; struct faction *f1, *f2;

View File

@ -179,6 +179,15 @@ item_type * test_create_itemtype(const char * name) {
return itype; return itype;
} }
void test_create_castorder(castorder *co, unit *u, int level, float force, int range) {
struct locale * lang;
order *ord;
lang = get_or_create_locale("en");
create_castorder(co, u, NULL, NULL, u->region, level, force, range, ord = create_order(K_CAST, lang, ""), NULL);
free_order(ord);
}
void test_translate_param(const struct locale *lang, param_t param, const char *text) { void test_translate_param(const struct locale *lang, param_t param, const char *text) {
struct critbit_tree **cb; struct critbit_tree **cb;

View File

@ -37,6 +37,7 @@ extern "C" {
struct item_type * test_create_itemtype(const char * name); struct item_type * test_create_itemtype(const char * name);
struct ship_type *test_create_shiptype(const char * name); struct ship_type *test_create_shiptype(const char * name);
struct building_type *test_create_buildingtype(const char *name); struct building_type *test_create_buildingtype(const char *name);
void test_create_castorder(struct castorder *co, struct unit *u, int level, float force, int range);
int RunAllTests(void); int RunAllTests(void);
void test_translate_param(const struct locale *lang, param_t param, const char *text); void test_translate_param(const struct locale *lang, param_t param, const char *text);