tests: remove cflag -w and fix warnings
The flag hides errors. But we want unit tests to be correct in order to reveal errors in the main code. The patch removes tests_unittests_unittests_CFLAGS which makes autotools use AM_CFLAGS instead. Therefore, unit tests are built with flags derived from configure.ac.
This commit is contained in:
@@ -31,12 +31,12 @@ void find_after_create(void **state)
|
||||
void get_after_create_returns_null(void **state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
GSList *result = autocomplete_create_list(ac);
|
||||
GList *result = autocomplete_create_list(ac);
|
||||
|
||||
assert_null(result);
|
||||
|
||||
autocomplete_clear(ac);
|
||||
g_slist_free_full(result, g_free);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void add_one_and_complete(void **state)
|
||||
@@ -80,12 +80,12 @@ void add_two_adds_two(void **state)
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Help");
|
||||
GSList *result = autocomplete_create_list(ac);
|
||||
GList *result = autocomplete_create_list(ac);
|
||||
|
||||
assert_int_equal(2, g_slist_length(result));
|
||||
assert_int_equal(2, g_list_length(result));
|
||||
|
||||
autocomplete_clear(ac);
|
||||
g_slist_free_full(result, g_free);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void add_two_same_adds_one(void **state)
|
||||
@@ -93,12 +93,12 @@ void add_two_same_adds_one(void **state)
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Hello");
|
||||
GSList *result = autocomplete_create_list(ac);
|
||||
GList *result = autocomplete_create_list(ac);
|
||||
|
||||
assert_int_equal(1, g_slist_length(result));
|
||||
assert_int_equal(1, g_list_length(result));
|
||||
|
||||
autocomplete_clear(ac);
|
||||
g_slist_free_full(result, g_free);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void add_two_same_updates(void **state)
|
||||
@@ -106,16 +106,16 @@ void add_two_same_updates(void **state)
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Hello");
|
||||
GSList *result = autocomplete_create_list(ac);
|
||||
GList *result = autocomplete_create_list(ac);
|
||||
|
||||
GSList *first = g_slist_nth(result, 0);
|
||||
GList *first = g_list_nth(result, 0);
|
||||
|
||||
char *str = first->data;
|
||||
|
||||
assert_string_equal("Hello", str);
|
||||
|
||||
autocomplete_clear(ac);
|
||||
g_slist_free_full(result, g_free);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void complete_accented_with_accented(void **state)
|
||||
|
||||
Reference in New Issue
Block a user