about summary refs log tree commit diff stats
path: root/tests/unittests/test_autocomplete.c
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2018-10-31 18:35:59 +0200
committerDmitry Podgorny <pasis.ua@gmail.com>2018-10-31 18:35:59 +0200
commite3f2ca7d1027435dec6e4bb5aa6dae7177c6315d (patch)
tree7167bca163668b4f87feb64458bb3b3a4019ed9d /tests/unittests/test_autocomplete.c
parent21fffb1e86db2a6fa65f650869f8e82d2031b114 (diff)
downloadprofani-tty-e3f2ca7d1027435dec6e4bb5aa6dae7177c6315d.tar.gz
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.
Diffstat (limited to 'tests/unittests/test_autocomplete.c')
-rw-r--r--tests/unittests/test_autocomplete.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/unittests/test_autocomplete.c b/tests/unittests/test_autocomplete.c
index 519973c4..4a519d77 100644
--- a/tests/unittests/test_autocomplete.c
+++ b/tests/unittests/test_autocomplete.c
@@ -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)