X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Funit%2Ftest_ust_data.c;h=a12343d7bc14b5afe6f3c9ea5a0d5b216b5369e2;hb=13c556223508c8d6c12443cda9c3fde67eb35943;hp=86c1e23bf43edceffa0bce237c40fb0772899a8b;hpb=83b45089a2624e885b0f0308be7ba5b061b23282;p=lttng-tools.git diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index 86c1e23bf..a12343d7b 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -60,9 +60,6 @@ static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz"; static char random_string[RANDOM_STRING_LEN]; -static struct ltt_ust_session *usess; -static struct lttng_domain dom; - /* * Return random string of 10 characters. * Not thread-safe. @@ -82,9 +79,9 @@ static char *get_random_string(void) static void test_create_one_ust_session(void) { - dom.type = LTTNG_DOMAIN_UST; + struct ltt_ust_session *usess = + trace_ust_create_session(42); - usess = trace_ust_create_session(42); ok(usess != NULL, "Create UST session"); if (!usess) { @@ -106,16 +103,19 @@ static void test_create_ust_channel(void) { struct ltt_ust_channel *uchan; struct lttng_channel attr; + struct lttng_channel_extended extended; memset(&attr, 0, sizeof(attr)); + memset(&extended, 0, sizeof(extended)); + attr.attr.extended.ptr = &extended; ok(lttng_strncpy(attr.name, "channel0", sizeof(attr.name)) == 0, "Validate channel name length"); uchan = trace_ust_create_channel(&attr, LTTNG_DOMAIN_UST); ok(uchan != NULL, "Create UST channel"); - if (!usess) { - skip(1, "UST session is null"); + if (!uchan) { + skip(1, "UST channel is null"); return; } @@ -249,8 +249,12 @@ static void test_create_ust_context(void) uctx = trace_ust_create_context(&ectx); ok(uctx != NULL, "Create UST context"); - ok((int) uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID, - "Validate UST context"); + if (uctx) { + ok((int) uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID, + "Validate UST context"); + } else { + skip(1, "Skipping UST context validation as creation failed"); + } free(uctx); }