diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0e1325b9..374eba608 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,6 +17,7 @@ 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 b7516a8e6..e5c55f3d8 100644 --- a/src/direction.test.c +++ b/src/direction.test.c @@ -3,6 +3,7 @@ #include "direction.h" #include "tests.h" +#include #include #include @@ -18,6 +19,21 @@ 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(); @@ -52,9 +68,12 @@ 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; }