forked from github/server
leaks: remember to call test_cleanup
This commit is contained in:
parent
284a74c878
commit
03ff8f612d
1 changed files with 10 additions and 2 deletions
|
@ -99,8 +99,11 @@ static void test_parse_make_temp(CuTest *tc) {
|
||||||
static void test_parse_maketemp(CuTest *tc) {
|
static void test_parse_maketemp(CuTest *tc) {
|
||||||
char cmd[32];
|
char cmd[32];
|
||||||
order *ord;
|
order *ord;
|
||||||
struct locale * lang = get_or_create_locale("en");
|
struct locale * lang;
|
||||||
|
|
||||||
|
test_cleanup();
|
||||||
|
|
||||||
|
lang = get_or_create_locale("en");
|
||||||
locale_setstring(lang, keyword(K_MAKE), "MAKE");
|
locale_setstring(lang, keyword(K_MAKE), "MAKE");
|
||||||
locale_setstring(lang, keyword(K_MAKETEMP), "MAKETEMP");
|
locale_setstring(lang, keyword(K_MAKETEMP), "MAKETEMP");
|
||||||
locale_setstring(lang, "TEMP", "TEMP");
|
locale_setstring(lang, "TEMP", "TEMP");
|
||||||
|
@ -113,17 +116,22 @@ static void test_parse_maketemp(CuTest *tc) {
|
||||||
CuAssertIntEquals(tc, K_MAKETEMP, init_order(ord));
|
CuAssertIntEquals(tc, K_MAKETEMP, init_order(ord));
|
||||||
CuAssertStrEquals(tc, "herp", getstrtoken());
|
CuAssertStrEquals(tc, "herp", getstrtoken());
|
||||||
free_order(ord);
|
free_order(ord);
|
||||||
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_init_order(CuTest *tc) {
|
static void test_init_order(CuTest *tc) {
|
||||||
order *ord;
|
order *ord;
|
||||||
struct locale * lang = get_or_create_locale("en");
|
struct locale * lang;
|
||||||
|
|
||||||
|
test_cleanup();
|
||||||
|
|
||||||
|
lang = get_or_create_locale("en");
|
||||||
ord = create_order(K_MAKETEMP, lang, "hurr durr");
|
ord = create_order(K_MAKETEMP, lang, "hurr durr");
|
||||||
CuAssertIntEquals(tc, K_MAKETEMP, init_order(ord));
|
CuAssertIntEquals(tc, K_MAKETEMP, init_order(ord));
|
||||||
CuAssertStrEquals(tc, "hurr", getstrtoken());
|
CuAssertStrEquals(tc, "hurr", getstrtoken());
|
||||||
CuAssertStrEquals(tc, "durr", getstrtoken());
|
CuAssertStrEquals(tc, "durr", getstrtoken());
|
||||||
free_order(ord);
|
free_order(ord);
|
||||||
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_getstrtoken(CuTest *tc) {
|
static void test_getstrtoken(CuTest *tc) {
|
||||||
|
|
Loading…
Reference in a new issue