summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-06-12 18:40:14 +0200
committerThomas Haller <thaller@redhat.com>2017-07-05 14:22:10 +0200
commit935411e5c03dcb62d5b2a85e67bf3220c75d0f5e (patch)
treea2736d05ab3424e576e250c65b44a6a16e4a861b /src/tests
parent89385bd9683c521fbc85b5e452459c3d46d4528d (diff)
downloadNetworkManager-935411e5c03dcb62d5b2a85e67bf3220c75d0f5e.tar.gz
core: refactor NMIP4Config to use dedup-index for IPv4 routes
Eventually, every NMPlatformIP4Route, NMPlatformIP6Route, NMPlatformIP4Address and NMPlatformIP6Address should be shared an deduplicated via the global NMDedupMultiIndex instance. As first proof of concept, refactor NMIP4Config to track IPv4 routes via the shared multi_idx. There is later potential for improvement, when we pass (deduplicated) NMPObject instances around instead of plain NMPlatformIP4Route, which needs still a lot of comparing and cloning.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test-ip4-config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index d9afb4c6ac..e865f5f26a 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -121,7 +121,7 @@ test_subtract (void)
g_assert_cmpuint (nm_ip4_config_get_gateway (dst), ==, 0);
g_assert_cmpuint (nm_ip4_config_get_num_routes (dst), ==, 1);
- test_route = nm_ip4_config_get_route (dst, 0);
+ test_route = _nmtst_nm_ip4_config_get_route (dst, 0);
g_assert (test_route != NULL);
g_assert_cmpuint (test_route->network, ==, nmtst_inet4_from_string (expected_route_dest));
g_assert_cmpuint (test_route->plen, ==, expected_route_plen);
@@ -236,27 +236,27 @@ test_add_route_with_source (void)
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
nm_ip4_config_add_route (a, &route);
- test_route = nm_ip4_config_get_route (a, 0);
+ test_route = _nmtst_nm_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
route.rt_source = NM_IP_CONFIG_SOURCE_VPN;
nm_ip4_config_add_route (a, &route);
- test_route = nm_ip4_config_get_route (a, 0);
+ test_route = _nmtst_nm_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
/* Test that a lower priority address source is overwritten */
- nm_ip4_config_del_route (a, 0);
+ _nmtst_nm_ip4_config_del_route (a, 0);
route.rt_source = NM_IP_CONFIG_SOURCE_KERNEL;
nm_ip4_config_add_route (a, &route);
- test_route = nm_ip4_config_get_route (a, 0);
+ test_route = _nmtst_nm_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_KERNEL);
route.rt_source = NM_IP_CONFIG_SOURCE_USER;
nm_ip4_config_add_route (a, &route);
- test_route = nm_ip4_config_get_route (a, 0);
+ test_route = _nmtst_nm_ip4_config_get_route (a, 0);
g_assert_cmpint (test_route->rt_source, ==, NM_IP_CONFIG_SOURCE_USER);
g_object_unref (a);