summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-02-09 10:57:37 +0100
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-02-13 18:03:41 +0100
commit4fba017873987d9bfff02567b562898c6364d320 (patch)
tree6a66ac9ed37bfa1531ae6c5e505838d050facc73 /unit
parentd1ddd581e699333cd5eea06ebf8caf96890e2b74 (diff)
downloadconnman-4fba017873987d9bfff02567b562898c6364d320.tar.gz
connman-4fba017873987d9bfff02567b562898c6364d320.tar.bz2
connman-4fba017873987d9bfff02567b562898c6364d320.zip
test-ippool: Split basic0 test
Do not test two things in the same function.
Diffstat (limited to 'unit')
-rw-r--r--unit/test-ippool.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/unit/test-ippool.c b/unit/test-ippool.c
index 7b4a91bb..ebf8df4d 100644
--- a/unit/test-ippool.c
+++ b/unit/test-ippool.c
@@ -42,6 +42,19 @@
static void test_ippool_basic0(void)
{
struct connman_ippool *pool;
+ int i;
+
+ for (i = 0; i < 100000; i++) {
+ pool = __connman_ippool_create(23, 1, 20, NULL, NULL);
+ g_assert(pool);
+
+ __connman_ippool_unref(pool);
+ }
+}
+
+static void test_ippool_basic1(void)
+{
+ struct connman_ippool *pool;
const char *gateway;
const char *broadcast;
const char *subnet_mask;
@@ -50,10 +63,6 @@ static void test_ippool_basic0(void)
int i;
/* Test the IP range */
-
- pool = __connman_ippool_create(23, 1, 500, NULL, NULL);
- g_assert(pool == NULL);
-
for (i = 1; i < 254; i++) {
pool = __connman_ippool_create(23, 1, i, NULL, NULL);
g_assert(pool);
@@ -78,7 +87,7 @@ static void test_ippool_basic0(void)
}
}
-static void test_ippool_basic1(void)
+static void test_ippool_basic2(void)
{
struct connman_ippool *pool;
const char *gateway;
@@ -200,6 +209,7 @@ int main(int argc, char *argv[])
g_test_add_func("/basic0", test_ippool_basic0);
g_test_add_func("/basic1", test_ippool_basic1);
+ g_test_add_func("/basic2", test_ippool_basic2);
g_test_add_func("/collision0", test_ippool_collision0);
err = g_test_run();