summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-06-07 15:42:22 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2011-06-07 15:42:57 +0200
commit7b8124ac2f08b77d890dd0f0208bdff220e3116c (patch)
tree0fc52d985d10fa166a1da17d301dc720cf552a3f /unit
parent0ef4e08aac482ff4b0efaa9d42cc1a41af5849ba (diff)
downloadconnman-7b8124ac2f08b77d890dd0f0208bdff220e3116c.tar.gz
connman-7b8124ac2f08b77d890dd0f0208bdff220e3116c.tar.bz2
connman-7b8124ac2f08b77d890dd0f0208bdff220e3116c.zip
unit: Add create and destroy test case
Diffstat (limited to 'unit')
-rw-r--r--unit/test-session.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/unit/test-session.c b/unit/test-session.c
index 91662dac..a2bd3726 100644
--- a/unit/test-session.c
+++ b/unit/test-session.c
@@ -119,6 +119,25 @@ static gboolean test_session_create(gpointer data)
return FALSE;
}
+static gboolean test_session_create_destroy(gpointer data)
+{
+ struct test_fix *fix = data;
+ struct test_session *session;
+
+ util_session_create(fix, 1);
+ session = fix->session;
+
+ session->notify_path = g_strdup("/foo");
+
+ util_session_init(fix->session);
+ util_session_cleanup(fix->session);
+
+ g_assert(is_connman_running(session->connection) == TRUE);
+ util_idle_call(fix, util_quit_loop, util_session_destroy);
+
+ return FALSE;
+}
+
static void set_session_mode(struct test_fix *fix,
connman_bool_t enable)
{
@@ -177,6 +196,8 @@ int main(int argc, char *argv[])
test_session_destroy_no_notify, setup_cb, teardown_cb);
util_test_add("/manager/session create",
test_session_create, setup_cb, teardown_cb);
+ util_test_add("/manager/session create destroy",
+ test_session_create_destroy, setup_cb, teardown_cb);
return g_test_run();
}