X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Funit%2Ftest_ust_data.c;h=75257d3e2c7297c5bded9d181df66757183174c5;hb=4bd1c41e33bbbdd3beeb730c7e9501ff4bb699bd;hp=ec61ffbad60285d16d2c0e789dd52ec9ea9765ea;hpb=edf4b93e2f5c849cbec49e987990b3705ea49f6a;p=lttng-tools.git diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index ec61ffbad..75257d3e2 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * * SPDX-License-Identifier: GPL-2.0-only * @@ -21,6 +21,8 @@ #include #include +#include + #include /* This path will NEVER be created in this test */ @@ -31,10 +33,7 @@ /* Number of TAP tests in this file */ #define NUM_TESTS 16 -/* For error.h */ -int lttng_opt_quiet = 1; -int lttng_opt_verbose; -int lttng_opt_mi; +DEFINE_LTTNG_UST_SIGBUS_STATE(); static const char alphanum[] = "0123456789" @@ -79,6 +78,7 @@ static void test_create_one_ust_session(void) "Validate UST session"); trace_ust_destroy_session(usess); + trace_ust_free_session(usess); } static void test_create_ust_channel(void) @@ -103,7 +103,7 @@ static void test_create_ust_channel(void) ok(uchan->enabled == 0 && strncmp(uchan->name, "channel0", 8) == 0 && - uchan->name[LTTNG_UST_SYM_NAME_LEN - 1] == '\0' && + uchan->name[LTTNG_UST_ABI_SYM_NAME_LEN - 1] == '\0' && uchan->ctx != NULL && uchan->events != NULL && uchan->attr.overwrite == attr.attr.overwrite, @@ -135,9 +135,9 @@ static void test_create_ust_event(void) } ok(event->enabled == 0 && - event->attr.instrumentation == LTTNG_UST_TRACEPOINT && + event->attr.instrumentation == LTTNG_UST_ABI_TRACEPOINT && strcmp(event->attr.name, ev.name) == 0 && - event->attr.name[LTTNG_UST_SYM_NAME_LEN - 1] == '\0', + event->attr.name[LTTNG_UST_ABI_SYM_NAME_LEN - 1] == '\0', "Validate UST event"); trace_ust_destroy_event(event); @@ -177,9 +177,9 @@ static void test_create_ust_event_exclusion(void) exclusion->count = exclusion_count; random_name = get_random_string(); strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 0), random_name, - LTTNG_SYMBOL_NAME_LEN); + LTTNG_SYMBOL_NAME_LEN - 1); strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 1), random_name, - LTTNG_SYMBOL_NAME_LEN); + LTTNG_SYMBOL_NAME_LEN - 1); ret = trace_ust_create_event(&ev, NULL, NULL, exclusion, false, &event); exclusion = NULL; @@ -209,9 +209,9 @@ static void test_create_ust_event_exclusion(void) exclusion->count = exclusion_count; strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 0), - get_random_string(), LTTNG_SYMBOL_NAME_LEN); + get_random_string(), LTTNG_SYMBOL_NAME_LEN - 1); strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion, 1), - get_random_string(), LTTNG_SYMBOL_NAME_LEN); + get_random_string(), LTTNG_SYMBOL_NAME_LEN - 1); exclusion_copy->count = exclusion_count; strncpy(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusion_copy, 0), @@ -229,13 +229,13 @@ static void test_create_ust_event_exclusion(void) } ok(event->enabled == 0 && - event->attr.instrumentation == LTTNG_UST_TRACEPOINT && + event->attr.instrumentation == LTTNG_UST_ABI_TRACEPOINT && strcmp(event->attr.name, ev.name) == 0 && event->exclusion != NULL && event->exclusion->count == exclusion_count && !memcmp(event->exclusion->names, exclusion_copy->names, LTTNG_SYMBOL_NAME_LEN * exclusion_count) && - event->attr.name[LTTNG_UST_SYM_NAME_LEN - 1] == '\0', + event->attr.name[LTTNG_UST_ABI_SYM_NAME_LEN - 1] == '\0', "Validate UST event and exclusion"); trace_ust_destroy_event(event); @@ -257,7 +257,7 @@ static void test_create_ust_context(void) ok(uctx != NULL, "Create UST context"); if (uctx) { - ok((int) uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID, + ok((int) uctx->ctx.ctx == LTTNG_UST_ABI_CONTEXT_VTID, "Validate UST context"); } else { skip(1, "Skipping UST context validation as creation failed");