Add lttng_trace_format::sptr to ltt_session
[lttng-tools.git] / tests / unit / test_session.cpp
index c19a1afddfc0a17a445b71d367b74dfaaf7444b6..fbbf4f4db6f21f5a05876e833769c12377243425 100644 (file)
@@ -19,6 +19,7 @@
 #include <bin/lttng-sessiond/ust-app.hpp>
 #include <common/common.hpp>
 #include <common/compat/errno.hpp>
+#include <common/make-unique.hpp>
 #include <common/sessiond-comm/sessiond-comm.hpp>
 
 #include <tap/tap.h>
@@ -108,9 +109,11 @@ static int create_one_session(const char *name)
        int ret;
        enum lttng_error_code ret_code;
        struct ltt_session *session = NULL;
+       lttng::trace_format_descriptor::uptr trace_format_descriptor =
+                       lttng::make_unique<lttng::trace_format_descriptor_ctf1>();
 
        session_lock_list();
-       ret_code = session_create(name, geteuid(), getegid(), &session);
+       ret_code = session_create(name, geteuid(), getegid(), trace_format_descriptor, &session);
        session_put(session);
        if (ret_code == LTTNG_OK) {
                /* Validate */
@@ -150,7 +153,7 @@ static int destroy_one_session(struct ltt_session *session)
 
        ret = find_session_name(session_name);
        if (ret < 0) {
-               /* Success, -1 means that the sesion is NOT found */
+               /* Success, -1 means that the session is NOT found */
                ret = 0;
        } else {
                /* Fail */
@@ -264,9 +267,11 @@ static void test_session_name_generation(void)
        struct ltt_session *session = NULL;
        enum lttng_error_code ret_code;
        const char *expected_session_name_prefix = DEFAULT_SESSION_NAME;
+       lttng::trace_format_descriptor::uptr trace_format_descriptor =
+                       lttng::make_unique<lttng::trace_format_descriptor_ctf1>();
 
        session_lock_list();
-       ret_code = session_create(NULL, geteuid(), getegid(), &session);
+       ret_code = session_create(NULL, geteuid(), getegid(), trace_format_descriptor, &session);
        ok(ret_code == LTTNG_OK,
                "Create session with a NULL name (auto-generate a name)");
        if (!session) {
This page took 0.027397 seconds and 5 git commands to generate.