diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-06-07 15:42:22 +0200 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-06-07 15:42:57 +0200 |
commit | 7b8124ac2f08b77d890dd0f0208bdff220e3116c (patch) | |
tree | 0fc52d985d10fa166a1da17d301dc720cf552a3f | |
parent | 0ef4e08aac482ff4b0efaa9d42cc1a41af5849ba (diff) | |
download | connman-7b8124ac2f08b77d890dd0f0208bdff220e3116c.tar.gz connman-7b8124ac2f08b77d890dd0f0208bdff220e3116c.tar.bz2 connman-7b8124ac2f08b77d890dd0f0208bdff220e3116c.zip |
unit: Add create and destroy test case
-rw-r--r-- | unit/test-session.c | 21 |
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(); } |