tests: Move to kernel style SPDX license identifiers
[lttng-tools.git] / tests / unit / test_utils_compat_poll.c
index 1eb327a6a708c2137aa22d75a120f3de67bbb19d..41ff237d861d5e198840678eb047dee99fb6a733 100644 (file)
@@ -5,14 +5,8 @@
  *
  * Copyright (C) 2019 Yannick Lamarre <ylamarre@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by as
- * published by the Free Software Foundation; only version 2 of the License.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
  */
 
 #include <assert.h>
@@ -41,10 +35,17 @@ int lttng_opt_quiet = 1;
 int lttng_opt_verbose;
 int lttng_opt_mi;
 
+/*
+ * Non-zero 8-bits arbitrary value below 0x7f to ensure no sign extension
+ * occurs. Used to verify that the value is properly propagated through the
+ * pipe.
+ */
+#define MAGIC_VALUE ((char) 0x5A)
+
 #ifdef HAVE_EPOLL
-#define NUM_TESTS 46
+#define NUM_TESTS 47
 #else
-#define NUM_TESTS 45
+#define NUM_TESTS 46
 #endif
 
 #ifdef HAVE_EPOLL
@@ -54,11 +55,6 @@ int lttng_opt_mi;
 #define CLOE_VALUE FD_CLOEXEC
 #endif
 
-/* Non-zero 8-bits arbitrary value below 0x7f to ensure no sign extension
- * used to verify that the value is properly propagated throught the pipe.
- */
-#define MAGIC_VALUE ((char)0x5A)
-
 void test_epoll_compat(void)
 {
        /*
@@ -69,7 +65,7 @@ void test_epoll_compat(void)
 }
 #endif
 
-void test_alloc(void)
+static void test_alloc(void)
 {
        struct lttng_poll_event poll_events;
 
@@ -90,7 +86,7 @@ void test_alloc(void)
 }
 
 /* Tests stuff related to what would be handled with epoll_ctl. */
-void test_add_del(void)
+static void test_add_del(void)
 {
        struct lttng_poll_event poll_events;
 
@@ -99,7 +95,7 @@ void test_add_del(void)
        ok(lttng_poll_add(&poll_events, 1, LPOLLIN) != 0, "Adding to uninitialized structure fails");
        ok(lttng_poll_add(&poll_events, -1, LPOLLIN) != 0, "Adding invalid FD fails");
 
-       lttng_poll_create(&poll_events, 1, 0);
+       ok(lttng_poll_create(&poll_events, 1, 0) == 0, "Create a poll set succeeds");
        ok(LTTNG_POLL_GETNB(&poll_events) == 0, "Set created empty");
 
        ok(lttng_poll_add(NULL, 1, LPOLLIN) != 0, "Adding to NULL set fails");
@@ -128,7 +124,7 @@ void test_add_del(void)
        lttng_poll_clean(&poll_events);
 }
 
-void test_mod_wait(void)
+static void test_mod_wait(void)
 {
        struct lttng_poll_event poll_events;
        struct lttng_poll_event cpoll_events;
@@ -184,7 +180,7 @@ void test_mod_wait(void)
        }
 }
 
-void test_func_def(void)
+static void test_func_def(void)
 {
 #ifdef LTTNG_POLL_GETFD
 #define PASS_GETFD 1
This page took 0.027953 seconds and 5 git commands to generate.