#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <time.h>
#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
#include <urcu.h>
-#include <tap/tap.h>
+#include <bin/lttng-sessiond/health-sessiond.hpp>
+#include <bin/lttng-sessiond/session.hpp>
+#include <bin/lttng-sessiond/thread.hpp>
+#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 <common/compat/errno.h>
-#include <bin/lttng-sessiond/session.h>
-#include <bin/lttng-sessiond/ust-app.h>
-#include <bin/lttng-sessiond/health-sessiond.h>
-#include <bin/lttng-sessiond/thread.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/common.h>
+#include <tap/tap.h>
#define SESSION1 "test1"
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 */
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 */
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) {
MAX_SESSIONS);
}
-int main(int argc, char **argv)
+int main(void)
{
plan_tests(NUM_TESTS);