[network-manager-openvpn/th/ovpn-import-bgo761285] properties/tests: use nmtst_inet4_from_string() instead of _addr_from_string()
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/th/ovpn-import-bgo761285] properties/tests: use nmtst_inet4_from_string() instead of _addr_from_string()
- Date: Wed, 3 Feb 2016 14:30:47 +0000 (UTC)
commit 87a7a5e66c935fd5697c6fcb94cea60e18750b7d
Author: Thomas Haller <thaller redhat com>
Date: Wed Feb 3 13:05:49 2016 +0100
properties/tests: use nmtst_inet4_from_string() instead of _addr_from_string()
properties/tests/test-import-export.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/properties/tests/test-import-export.c b/properties/tests/test-import-export.c
index 686224b..85b89b4 100644
--- a/properties/tests/test-import-export.c
+++ b/properties/tests/test-import-export.c
@@ -52,16 +52,6 @@ _create_plugin (void)
/*****************************************************************************/
-inline static in_addr_t
-_addr_from_string (const char *saddr)
-{
- in_addr_t a;
-
- g_assert (saddr);
- g_assert (inet_pton (AF_INET, saddr, &a) == 1);
- return a;
-}
-
static NMConnection *
get_basic_connection (const char *detail,
NMVpnEditorPlugin *plugin,
@@ -1260,28 +1250,28 @@ test_route_import (NMVpnEditorPlugin *plugin,
/* route 1 */
route = nm_setting_ip4_config_get_route (s_ip4, 0);
- g_assert_cmpint (nm_ip4_route_get_dest (route), ==, _addr_from_string (expected_dest1));
+ g_assert_cmpint (nm_ip4_route_get_dest (route), ==, nmtst_inet4_from_string (expected_dest1));
ASSERT (nm_ip4_route_get_prefix (route) == expected_prefix1,
detail, "unexpected prefix of 1. route");
- g_assert_cmpint (nm_ip4_route_get_next_hop (route), ==, _addr_from_string (expected_nh1));
+ g_assert_cmpint (nm_ip4_route_get_next_hop (route), ==, nmtst_inet4_from_string
(expected_nh1));
ASSERT (nm_ip4_route_get_metric (route) == METR (expected_metric1),
detail, "unexpected metric of 1. route");
/* route 2 */
route = nm_setting_ip4_config_get_route (s_ip4, 1);
- g_assert_cmpint (nm_ip4_route_get_dest (route), ==, _addr_from_string (expected_dest2));
+ g_assert_cmpint (nm_ip4_route_get_dest (route), ==, nmtst_inet4_from_string (expected_dest2));
ASSERT (nm_ip4_route_get_prefix (route) == expected_prefix2,
detail, "unexpected prefix of 2. route");
- g_assert_cmpint (nm_ip4_route_get_next_hop (route), ==, _addr_from_string (expected_nh2));
+ g_assert_cmpint (nm_ip4_route_get_next_hop (route), ==, nmtst_inet4_from_string
(expected_nh2));
ASSERT (nm_ip4_route_get_metric (route) == METR (expected_metric2),
detail, "unexpected metric of 2. route");
/* route 3 */
route = nm_setting_ip4_config_get_route (s_ip4, 2);
- g_assert_cmpint (nm_ip4_route_get_dest (route), ==, _addr_from_string (expected_dest3));
+ g_assert_cmpint (nm_ip4_route_get_dest (route), ==, nmtst_inet4_from_string (expected_dest3));
ASSERT (nm_ip4_route_get_prefix (route) == expected_prefix3,
detail, "unexpected prefix of 3. route");
- g_assert_cmpint (nm_ip4_route_get_next_hop (route), ==, _addr_from_string (expected_nh3));
+ g_assert_cmpint (nm_ip4_route_get_next_hop (route), ==, nmtst_inet4_from_string
(expected_nh3));
ASSERT (nm_ip4_route_get_metric (route) == METR (expected_metric3),
detail, "unexpected metric of 3. route");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]