lib: compile liblttng-ctl as C++
[lttng-tools.git] / tests / regression / tools / live / live_test.c
index a9adc5946d967b9c606469b661912fd314917b41..40d0f6270b69a962e6a660841d439723997cfc18 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -23,7 +22,6 @@
 
 #include <tap/tap.h>
 #include <lttng/lttng.h>
-#include <lttng/ust-sigbus.h>
 
 #include <urcu/list.h>
 #include <common/common.h>
 #define NUM_TESTS 11
 #define mmap_size 524288
 
-DEFINE_LTTNG_UST_SIGBUS_STATE();
+#ifdef HAVE_LIBLTTNG_UST_CTL
+#include <lttng/lttng-export.h>
+#include <lttng/ust-sigbus.h>
+LTTNG_EXPORT DEFINE_LTTNG_UST_SIGBUS_STATE();
+#endif
 
 static int control_sock;
 struct live_session *session;
@@ -76,7 +78,7 @@ ssize_t lttng_live_recv(int fd, void *buf, size_t len)
        do {
                ret = recv(fd, buf + copied, to_copy, 0);
                if (ret > 0) {
-                       assert(ret <= to_copy);
+                       LTTNG_ASSERT(ret <= to_copy);
                        copied += ret;
                        to_copy -= ret;
                }
@@ -250,7 +252,7 @@ int create_viewer_session(void)
                diag("[error] Error sending cmd");
                goto error;
        }
-       assert(ret_len == sizeof(cmd));
+       LTTNG_ASSERT(ret_len == sizeof(cmd));
 
        ret_len = lttng_live_recv(control_sock, &resp, sizeof(resp));
        if (ret_len == 0) {
@@ -261,7 +263,7 @@ int create_viewer_session(void)
                diag("[error] Error receiving create session reply");
                goto error;
        }
-       assert(ret_len == sizeof(resp));
+       LTTNG_ASSERT(ret_len == sizeof(resp));
 
        if (be32toh(resp.status) != LTTNG_VIEWER_CREATE_SESSION_OK) {
                diag("[error] Error creating viewer session");
This page took 0.02418 seconds and 4 git commands to generate.