Tests: fix: leak of some attributes of ltt_ust_session
[lttng-tools.git] / tests / unit / test_ust_data.c
index f92b1f802b7481b415aae1834ae2475b02e070c3..75257d3e2c7297c5bded9d181df66757183174c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  *
  * SPDX-License-Identifier: GPL-2.0-only
  *
@@ -21,6 +21,8 @@
 #include <bin/lttng-sessiond/ust-app.h>
 #include <bin/lttng-sessiond/notification-thread.h>
 
+#include <lttng/ust-sigbus.h>
+
 #include <tap/tap.h>
 
 /* This path will NEVER be created in this test */
 /* 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)
@@ -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),
This page took 0.024895 seconds and 4 git commands to generate.