X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_kernel_data.c;h=5bca684a513d16bbc4b740dc061e2dca4b4cbc34;hp=16d4f7b3991de7d980e2689c3a14571e10a1ac63;hb=72265d8a785062db82337b28108bbd950875c575;hpb=e7c9f24870f4c5df0f5b25deb498124f6d7fc655 diff --git a/tests/unit/test_kernel_data.c b/tests/unit/test_kernel_data.c index 16d4f7b39..5bca684a5 100644 --- a/tests/unit/test_kernel_data.c +++ b/tests/unit/test_kernel_data.c @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include #include #include @@ -33,11 +32,12 @@ #define RANDOM_STRING_LEN 11 /* Number of TAP tests in this file */ -#define NUM_TESTS 10 +#define NUM_TESTS 11 -/* For lttngerr.h */ +/* For error.h */ int lttng_opt_quiet = 1; int lttng_opt_verbose; +int lttng_opt_mi; int ust_consumerd32_fd; int ust_consumerd64_fd; @@ -120,7 +120,6 @@ static void test_create_kernel_channel(void) ok(chan->fd == -1 && chan->enabled == 1 && chan->stream_count == 0 && - chan->ctx == NULL && chan->channel->attr.overwrite == attr.attr.overwrite, "Validate kernel channel"); @@ -135,11 +134,13 @@ static void test_create_kernel_event(void) struct lttng_event ev; memset(&ev, 0, sizeof(ev)); - strncpy(ev.name, get_random_string(), LTTNG_KERNEL_SYM_NAME_LEN); + ok(!lttng_strncpy(ev.name, get_random_string(), + LTTNG_KERNEL_SYM_NAME_LEN), + "Validate string length"); ev.type = LTTNG_EVENT_TRACEPOINT; ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; - event = trace_kernel_create_event(&ev); + event = trace_kernel_create_event(&ev, NULL, NULL); ok(event != NULL, "Create kernel event"); ok(event->fd == -1 &&