forked from github/server
relocate the addtoken leak "test" to umlaut.test.c
This commit is contained in:
parent
7b5383dfff
commit
fa6a3e377d
|
@ -17,7 +17,6 @@ IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
|
|
||||||
ELSEIF(MSVC)
|
ELSEIF(MSVC)
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||||
|
|
|
@ -19,21 +19,6 @@ static void test_init_directions(CuTest *tc) {
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_leak(CuTest *tc) {
|
|
||||||
struct locale *lang;
|
|
||||||
void **tokens;
|
|
||||||
variant token;
|
|
||||||
|
|
||||||
test_setup();
|
|
||||||
lang = get_or_create_locale("de");
|
|
||||||
tokens = get_translations(lang, UT_DIRECTIONS);
|
|
||||||
token.i = D_NORTHWEST;
|
|
||||||
addtoken(tokens, "NW", token);
|
|
||||||
addtoken(tokens, "northwest", token);
|
|
||||||
|
|
||||||
test_cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_init_direction(CuTest *tc) {
|
static void test_init_direction(CuTest *tc) {
|
||||||
struct locale *lang;
|
struct locale *lang;
|
||||||
test_setup();
|
test_setup();
|
||||||
|
@ -68,12 +53,9 @@ static void test_finddirection(CuTest *tc) {
|
||||||
CuSuite *get_direction_suite(void)
|
CuSuite *get_direction_suite(void)
|
||||||
{
|
{
|
||||||
CuSuite *suite = CuSuiteNew();
|
CuSuite *suite = CuSuiteNew();
|
||||||
SUITE_ADD_TEST(suite, test_leak);
|
|
||||||
/*
|
|
||||||
SUITE_ADD_TEST(suite, test_init_direction);
|
SUITE_ADD_TEST(suite, test_init_direction);
|
||||||
SUITE_ADD_TEST(suite, test_init_directions);
|
SUITE_ADD_TEST(suite, test_init_directions);
|
||||||
SUITE_ADD_TEST(suite, test_finddirection);
|
SUITE_ADD_TEST(suite, test_finddirection);
|
||||||
*/
|
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,16 @@ static void test_umlaut(CuTest * tc)
|
||||||
freetokens(tokens);
|
freetokens(tokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_leak(CuTest *tc) {
|
||||||
|
void *tokens = NULL;
|
||||||
|
variant token;
|
||||||
|
|
||||||
|
token.i = 42;
|
||||||
|
addtoken(&tokens, "NW", token);
|
||||||
|
addtoken(&tokens, "northwest", token);
|
||||||
|
freetokens(tokens);
|
||||||
|
}
|
||||||
|
|
||||||
CuSuite *get_umlaut_suite(void)
|
CuSuite *get_umlaut_suite(void)
|
||||||
{
|
{
|
||||||
CuSuite *suite = CuSuiteNew();
|
CuSuite *suite = CuSuiteNew();
|
||||||
|
@ -104,5 +114,6 @@ CuSuite *get_umlaut_suite(void)
|
||||||
SUITE_ADD_TEST(suite, test_directions);
|
SUITE_ADD_TEST(suite, test_directions);
|
||||||
SUITE_ADD_TEST(suite, test_transliterate);
|
SUITE_ADD_TEST(suite, test_transliterate);
|
||||||
SUITE_ADD_TEST(suite, test_transliterations);
|
SUITE_ADD_TEST(suite, test_transliterations);
|
||||||
|
SUITE_ADD_TEST(suite, test_leak);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue