diff options
| author | Michael Biebl <biebl@debian.org> | 2015-11-24 00:06:32 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2015-11-24 00:06:32 +0100 |
| commit | a6ece1a2aa19a6268335c87d4fdef20123dd04a5 (patch) | |
| tree | 87f1961faacdfafb1c4fee5f2feb6bcb5c06813b /src/devices/wifi/tests | |
| parent | 81836c2d44802b4cca833d7775dd627e0797a7e2 (diff) | |
Imported Upstream version 1.0.8 upstream/1.0.8
Diffstat (limited to 'src/devices/wifi/tests')
| -rw-r--r-- | src/devices/wifi/tests/Makefile.am | 1 | ||||
| -rw-r--r-- | src/devices/wifi/tests/Makefile.in | 2 | ||||
| -rw-r--r-- | src/devices/wifi/tests/test-wifi-ap-utils.c | 137 |
3 files changed, 48 insertions, 92 deletions
diff --git a/src/devices/wifi/tests/Makefile.am b/src/devices/wifi/tests/Makefile.am index 2a7d7849..f76bdbf5 100644 --- a/src/devices/wifi/tests/Makefile.am +++ b/src/devices/wifi/tests/Makefile.am @@ -1,5 +1,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -I${top_srcdir}/src/platform \ diff --git a/src/devices/wifi/tests/Makefile.in b/src/devices/wifi/tests/Makefile.in index f807ee77..f2488c7d 100644 --- a/src/devices/wifi/tests/Makefile.in +++ b/src/devices/wifi/tests/Makefile.in @@ -511,6 +511,7 @@ LOG_DRIVER = @LOG_DRIVER@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -653,6 +654,7 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -I${top_srcdir}/src/platform \ diff --git a/src/devices/wifi/tests/test-wifi-ap-utils.c b/src/devices/wifi/tests/test-wifi-ap-utils.c index 3c405e26..26e130c4 100644 --- a/src/devices/wifi/tests/test-wifi-ap-utils.c +++ b/src/devices/wifi/tests/test-wifi-ap-utils.c @@ -1364,10 +1364,10 @@ main (int argc, char **argv) test_open_ap_leap_connection_1); g_test_add_func ("/wifi/open_ap/leap_connection/2", test_open_ap_leap_connection_2); - g_test_add_data_func ("/wifi/open_ap/wep_connection", + g_test_add_data_func ("/wifi/open_ap/wep_connection_true", (gconstpointer) TRUE, test_open_ap_wep_connection); - g_test_add_data_func ("/wifi/open_ap/wep_connection", + g_test_add_data_func ("/wifi/open_ap/wep_connection_false", (gconstpointer) FALSE, test_open_ap_wep_connection); @@ -1441,104 +1441,57 @@ main (int argc, char **argv) (gconstpointer) IDX_PRIV, test_ap_wpa_eap_connection_5); +#define ADD_FUNC(func) do { \ + gchar *name_idx = g_strdup_printf ("/wifi/wpa_psk/" G_STRINGIFY (func) "/%zd", i); \ + g_test_add_data_func (name_idx, (gconstpointer) i, func); \ + g_free (name_idx); \ + } while (0) + /* WPA-PSK tests */ for (i = IDX_WPA_PSK_PTKIP_GTKIP; i <= IDX_WPA_RSN_PSK_PCCMP_GCCMP; i++) { - g_test_add_data_func ("/wifi/wpa_psk/empty_connection", - (gconstpointer) i, - test_wpa_ap_empty_connection); - g_test_add_data_func ("/wifi/wpa_psk/leap_connection/1", - (gconstpointer) i, - test_wpa_ap_leap_connection_1); - g_test_add_data_func ("/wifi/wpa_psk/leap_connection/2", - (gconstpointer) i, - test_wpa_ap_leap_connection_2); - - g_test_add_data_func ("/wifi/wpa_psk/dynamic_wep_connection", - (gconstpointer) i, - test_wpa_ap_dynamic_wep_connection); - - g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/1", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_1); - g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/2", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_2); - g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/3", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_3); - g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/4", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_4); - g_test_add_data_func ("/wifi/wpa_psk/wpa_psk_connection/5", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_5); - - g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/1", - (gconstpointer) i, - test_ap_wpa_eap_connection_1); - g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/2", - (gconstpointer) i, - test_ap_wpa_eap_connection_2); - g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/3", - (gconstpointer) i, - test_ap_wpa_eap_connection_3); - g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/4", - (gconstpointer) i, - test_ap_wpa_eap_connection_4); - g_test_add_data_func ("/wifi/wpa_psk/wpa_eap_connection/5", - (gconstpointer) i, - test_ap_wpa_eap_connection_5); + ADD_FUNC(test_wpa_ap_empty_connection); + ADD_FUNC(test_wpa_ap_leap_connection_1); + ADD_FUNC(test_wpa_ap_leap_connection_2); + ADD_FUNC(test_wpa_ap_dynamic_wep_connection); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_1); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_2); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_3); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_4); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_5); + ADD_FUNC(test_ap_wpa_eap_connection_1); + ADD_FUNC(test_ap_wpa_eap_connection_2); + ADD_FUNC(test_ap_wpa_eap_connection_3); + ADD_FUNC(test_ap_wpa_eap_connection_4); + ADD_FUNC(test_ap_wpa_eap_connection_5); } +#undef ADD_FUNC +#define ADD_FUNC(func) do { \ + gchar *name_idx = g_strdup_printf ("/wifi/rsn_psk/" G_STRINGIFY (func) "/%zd", i); \ + g_test_add_data_func (name_idx, (gconstpointer) i, func); \ + g_free (name_idx); \ + } while (0) + /* RSN-PSK tests */ for (i = IDX_WPA_RSN_PSK_PTKIP_PCCMP_GTKIP; i <= IDX_RSN_PSK_PTKIP_PCCMP_GTKIP; i++) { - g_test_add_data_func ("/wifi/rsn_psk/empty_connection", - (gconstpointer) i, - test_wpa_ap_empty_connection); - g_test_add_data_func ("/wifi/rsn_psk/leap_connection/1", - (gconstpointer) i, - test_wpa_ap_leap_connection_1); - g_test_add_data_func ("/wifi/rsn_psk/leap_connection/2", - (gconstpointer) i, - test_wpa_ap_leap_connection_2); - - g_test_add_data_func ("/wifi/rsn_psk/dynamic_wep_connection", - (gconstpointer) i, - test_wpa_ap_dynamic_wep_connection); - - g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/1", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_1); - g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/2", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_2); - g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/3", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_3); - g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/4", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_4); - g_test_add_data_func ("/wifi/rsn_psk/wpa_psk_connection/5", - (gconstpointer) i, - test_wpa_ap_wpa_psk_connection_5); - - g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/1", - (gconstpointer) i, - test_ap_wpa_eap_connection_1); - g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/2", - (gconstpointer) i, - test_ap_wpa_eap_connection_2); - g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/3", - (gconstpointer) i, - test_ap_wpa_eap_connection_3); - g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/4", - (gconstpointer) i, - test_ap_wpa_eap_connection_4); - g_test_add_data_func ("/wifi/rsn_psk/wpa_eap_connection/5", - (gconstpointer) i, - test_ap_wpa_eap_connection_5); + ADD_FUNC(test_wpa_ap_empty_connection); + ADD_FUNC(test_wpa_ap_leap_connection_1); + ADD_FUNC(test_wpa_ap_leap_connection_2); + ADD_FUNC(test_wpa_ap_dynamic_wep_connection); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_1); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_2); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_3); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_4); + ADD_FUNC(test_wpa_ap_wpa_psk_connection_5); + ADD_FUNC(test_ap_wpa_eap_connection_1); + ADD_FUNC(test_ap_wpa_eap_connection_2); + ADD_FUNC(test_ap_wpa_eap_connection_3); + ADD_FUNC(test_ap_wpa_eap_connection_4); + ADD_FUNC(test_ap_wpa_eap_connection_5); } +#undef ADD_FUNC + /* Scanned signal strength conversion tests */ g_test_add_func ("/wifi/strength/dbm", test_strength_dbm); |