summaryrefslogtreecommitdiff
path: root/unit/test-ippool.c
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2018-01-23 14:50:50 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2018-01-23 14:50:55 +0900
commit30602f521a85820a9f6b7ac04876400e00c68b15 (patch)
treef035a4fcc014a034f3b492886d1e8395f327fd25 /unit/test-ippool.c
parenta079cfe6f815f8c69055de834d1ccbdf1fd94ba7 (diff)
parent9362752a471a5c892d679548fbf2828d5fc5684b (diff)
downloadconnman-30602f521a85820a9f6b7ac04876400e00c68b15.tar.gz
connman-30602f521a85820a9f6b7ac04876400e00c68b15.tar.bz2
connman-30602f521a85820a9f6b7ac04876400e00c68b15.zip
Updated connman to version 1.35
Change-Id: I13526fbf80296a79be15548fc226a308941ac9ec Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
Diffstat (limited to 'unit/test-ippool.c')
-rwxr-xr-xunit/test-ippool.c70
1 files changed, 34 insertions, 36 deletions
diff --git a/unit/test-ippool.c b/unit/test-ippool.c
index e8d077a6..17fac9d9 100755
--- a/unit/test-ippool.c
+++ b/unit/test-ippool.c
@@ -253,7 +253,7 @@ static void test_case_4(void)
static void test_case_5(void)
{
- struct connman_ippool *pool;
+ struct connman_ippool *pool1, *pool2;
const char *gateway;
const char *broadcast;
const char *subnet_mask;
@@ -271,14 +271,14 @@ static void test_case_5(void)
g_assert(flag == 0);
/* pool should return 192.168.0.1 now */
- pool = __connman_ippool_create(26, 1, 100, collision_cb, &flag);
- g_assert(pool);
+ pool1 = __connman_ippool_create(26, 1, 100, collision_cb, &flag);
+ g_assert(pool1);
- gateway = __connman_ippool_get_gateway(pool);
- broadcast = __connman_ippool_get_broadcast(pool);
- subnet_mask = __connman_ippool_get_subnet_mask(pool);
- start_ip = __connman_ippool_get_start_ip(pool);
- end_ip = __connman_ippool_get_end_ip(pool);
+ gateway = __connman_ippool_get_gateway(pool1);
+ broadcast = __connman_ippool_get_broadcast(pool1);
+ subnet_mask = __connman_ippool_get_subnet_mask(pool1);
+ start_ip = __connman_ippool_get_start_ip(pool1);
+ end_ip = __connman_ippool_get_end_ip(pool1);
g_assert(gateway);
g_assert(broadcast);
@@ -296,8 +296,6 @@ static void test_case_5(void)
"\tgateway %s broadcast %s mask %s", start_ip, end_ip,
gateway, broadcast, subnet_mask);
- __connman_ippool_unref(pool);
-
/*
* Now create the pool again, we should not get collision
* with existing allocated address.
@@ -305,14 +303,14 @@ static void test_case_5(void)
/* pool should return 192.168.2.1 now */
flag = 0;
- pool = __connman_ippool_create(23, 1, 100, collision_cb, &flag);
- g_assert(pool);
+ pool2 = __connman_ippool_create(23, 1, 100, collision_cb, &flag);
+ g_assert(pool2);
- gateway = __connman_ippool_get_gateway(pool);
- broadcast = __connman_ippool_get_broadcast(pool);
- subnet_mask = __connman_ippool_get_subnet_mask(pool);
- start_ip = __connman_ippool_get_start_ip(pool);
- end_ip = __connman_ippool_get_end_ip(pool);
+ gateway = __connman_ippool_get_gateway(pool2);
+ broadcast = __connman_ippool_get_broadcast(pool2);
+ subnet_mask = __connman_ippool_get_subnet_mask(pool2);
+ start_ip = __connman_ippool_get_start_ip(pool2);
+ end_ip = __connman_ippool_get_end_ip(pool2);
g_assert(gateway);
g_assert(broadcast);
@@ -332,14 +330,15 @@ static void test_case_5(void)
g_assert(flag == 0);
- __connman_ippool_unref(pool);
+ __connman_ippool_unref(pool1);
+ __connman_ippool_unref(pool2);
__connman_ippool_cleanup();
}
static void test_case_6(void)
{
- struct connman_ippool *pool;
+ struct connman_ippool *pool1, *pool2;
const char *gateway;
const char *broadcast;
const char *subnet_mask;
@@ -362,14 +361,14 @@ static void test_case_6(void)
g_assert(flag == 0);
/* pool should return 192.168.2.1 now */
- pool = __connman_ippool_create(26, 1, 100, collision_cb, &flag);
- g_assert(pool);
+ pool1 = __connman_ippool_create(26, 1, 100, collision_cb, &flag);
+ g_assert(pool1);
- gateway = __connman_ippool_get_gateway(pool);
- broadcast = __connman_ippool_get_broadcast(pool);
- subnet_mask = __connman_ippool_get_subnet_mask(pool);
- start_ip = __connman_ippool_get_start_ip(pool);
- end_ip = __connman_ippool_get_end_ip(pool);
+ gateway = __connman_ippool_get_gateway(pool1);
+ broadcast = __connman_ippool_get_broadcast(pool1);
+ subnet_mask = __connman_ippool_get_subnet_mask(pool1);
+ start_ip = __connman_ippool_get_start_ip(pool1);
+ end_ip = __connman_ippool_get_end_ip(pool1);
g_assert(gateway);
g_assert(broadcast);
@@ -387,8 +386,6 @@ static void test_case_6(void)
"\tgateway %s broadcast %s mask %s", start_ip, end_ip,
gateway, broadcast, subnet_mask);
- __connman_ippool_unref(pool);
-
/*
* Now create the pool again, we should not get collision
* with existing allocated address.
@@ -396,14 +393,14 @@ static void test_case_6(void)
/* pool should return 192.168.3.1 now */
flag = 0;
- pool = __connman_ippool_create(23, 1, 100, collision_cb, &flag);
- g_assert(pool);
+ pool2 = __connman_ippool_create(23, 1, 100, collision_cb, &flag);
+ g_assert(pool2);
- gateway = __connman_ippool_get_gateway(pool);
- broadcast = __connman_ippool_get_broadcast(pool);
- subnet_mask = __connman_ippool_get_subnet_mask(pool);
- start_ip = __connman_ippool_get_start_ip(pool);
- end_ip = __connman_ippool_get_end_ip(pool);
+ gateway = __connman_ippool_get_gateway(pool2);
+ broadcast = __connman_ippool_get_broadcast(pool2);
+ subnet_mask = __connman_ippool_get_subnet_mask(pool2);
+ start_ip = __connman_ippool_get_start_ip(pool2);
+ end_ip = __connman_ippool_get_end_ip(pool2);
g_assert(gateway);
g_assert(broadcast);
@@ -428,7 +425,8 @@ static void test_case_6(void)
__connman_ippool_newaddr(25, start_ip, 24);
g_assert(flag == 1);
- __connman_ippool_unref(pool);
+ __connman_ippool_unref(pool1);
+ __connman_ippool_unref(pool2);
__connman_ippool_cleanup();
}