X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Funit%2Ftest_session.c;h=c16695255123a40e5859c01623899fd5d641652e;hb=e1d64b5c248be1da1734357816e029527d6a2cce;hp=991b1dca3de4e71d69d038bab9469bbef402af6c;hpb=21bba73bcee011f677bdb23ec7f95bd2de9e340d;p=lttng-tools.git diff --git a/tests/unit/test_session.c b/tests/unit/test_session.c index 991b1dca3..c16695255 100644 --- a/tests/unit/test_session.c +++ b/tests/unit/test_session.c @@ -44,7 +44,6 @@ /* Number of TAP tests in this file */ #define NUM_TESTS 11 -struct health_app *health_sessiond; static struct ltt_session_list *session_list; /* For error.h */ @@ -52,9 +51,6 @@ int lttng_opt_quiet = 1; int lttng_opt_verbose = 0; int lttng_opt_mi; -int ust_consumerd32_fd; -int ust_consumerd64_fd; - static const char alphanum[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -141,21 +137,17 @@ static int create_one_session(char *name) /* Session not found by name */ printf("session not found after creation\n"); ret = -1; - goto end; } else { /* Success */ ret = 0; - goto end; } } else { if (ret_code == LTTNG_ERR_EXIST_SESS) { printf("(session already exists) "); } ret = -1; - goto end; } - ret = 0; -end: + session_unlock_list(); return ret; } @@ -269,9 +261,13 @@ void test_destroy_session(void) ok(tmp != NULL, "Destroying session: session found"); - ok(destroy_one_session(tmp) == 0, - "Destroying session: %s destroyed", - SESSION1); + if (tmp) { + ok(destroy_one_session(tmp) == 0, + "Destroying session: %s destroyed", + SESSION1); + } else { + skip(1, "Skipping session destruction as it was not found"); + } session_unlock_list(); }