diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 374eba608..a0e1325b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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} -Wno-error=unused-but-set-variable") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") ELSEIF(MSVC) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP") set(CMAKE_EXE_LINKER_FLAGS_DEBUG diff --git a/src/direction.test.c b/src/direction.test.c index e5c55f3d8..bf50df6bf 100644 --- a/src/direction.test.c +++ b/src/direction.test.c @@ -19,21 +19,6 @@ static void test_init_directions(CuTest *tc) { 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) { struct locale *lang; test_setup(); @@ -68,12 +53,9 @@ static void test_finddirection(CuTest *tc) { CuSuite *get_direction_suite(void) { CuSuite *suite = CuSuiteNew(); - SUITE_ADD_TEST(suite, test_leak); - /* SUITE_ADD_TEST(suite, test_init_direction); SUITE_ADD_TEST(suite, test_init_directions); SUITE_ADD_TEST(suite, test_finddirection); - */ return suite; } diff --git a/src/util/umlaut.test.c b/src/util/umlaut.test.c index 577b7059a..d903c6fea 100644 --- a/src/util/umlaut.test.c +++ b/src/util/umlaut.test.c @@ -97,6 +97,16 @@ static void test_umlaut(CuTest * tc) 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 *suite = CuSuiteNew(); @@ -104,5 +114,6 @@ CuSuite *get_umlaut_suite(void) SUITE_ADD_TEST(suite, test_directions); SUITE_ADD_TEST(suite, test_transliterate); SUITE_ADD_TEST(suite, test_transliterations); + SUITE_ADD_TEST(suite, test_leak); return suite; }