]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: fix include statements
authorChristian Brauner <brauner@kernel.org>
Wed, 23 Mar 2022 15:10:48 +0000 (16:10 +0100)
committerChristian Brauner (Microsoft) <christian.brauner@ubuntu.com>
Wed, 23 Mar 2022 15:10:48 +0000 (16:10 +0100)
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
src/tests/lxc-test-utils.c
src/tests/mount_injection.c
src/tests/parse_config_file.c
src/tests/reboot.c
src/tests/share_ns.c
src/tests/snapshot.c

index f10c1eba8e2982a3e7fdd2ff982388871407f0d3..e23ac729c960a81646243744e53cfe536446f63f 100644 (file)
@@ -254,13 +254,13 @@ void test_lxc_safe_uint(void)
        lxc_test_assert_abort((-EINVAL == lxc_safe_uint("-123", &n)));
 
        ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)UINT_MAX);
-       if (ret < 0 || ret >= sizeof(numstr))
+       if (ret < 0 || (size_t)ret >= sizeof(numstr))
                exit(EXIT_FAILURE);
 
        lxc_test_assert_abort((0 == lxc_safe_uint(numstr, &n)) && n == UINT_MAX);
 
        ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)UINT_MAX + 1);
-       if (ret < 0 || ret >= sizeof(numstr))
+       if (ret < 0 || (size_t)ret >= sizeof(numstr))
                exit(EXIT_FAILURE);
 
        lxc_test_assert_abort((-ERANGE == lxc_safe_uint(numstr, &n)));
@@ -287,25 +287,25 @@ void test_lxc_safe_int(void)
        char numstr[INTTYPE_TO_STRLEN(uint64_t)];
 
        ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)INT_MAX);
-       if (ret < 0 || ret >= sizeof(numstr))
+       if (ret < 0 || (size_t)ret >= sizeof(numstr))
                exit(EXIT_FAILURE);
 
        lxc_test_assert_abort((0 == lxc_safe_int(numstr, &n)) && n == INT_MAX);
 
        ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)INT_MAX + 1);
-       if (ret < 0 || ret >= sizeof(numstr))
+       if (ret < 0 || (size_t)ret >= sizeof(numstr))
                exit(EXIT_FAILURE);
 
        lxc_test_assert_abort((-ERANGE == lxc_safe_int(numstr, &n)));
 
        ret = snprintf(numstr, sizeof(numstr), "%" PRId64, (int64_t)INT_MIN);
-       if (ret < 0 || ret >= sizeof(numstr))
+       if (ret < 0 || (size_t)ret >= sizeof(numstr))
                exit(EXIT_FAILURE);
 
        lxc_test_assert_abort((0 == lxc_safe_int(numstr, &n)) && n == INT_MIN);
 
        ret = snprintf(numstr, sizeof(numstr), "%" PRId64, (int64_t)INT_MIN - 1);
-       if (ret < 0 || ret >= sizeof(numstr))
+       if (ret < 0 || (size_t)ret >= sizeof(numstr))
                exit(EXIT_FAILURE);
 
        lxc_test_assert_abort((-ERANGE == lxc_safe_int(numstr, &n)));
@@ -551,7 +551,7 @@ void test_task_blocks_signal(void)
 
                sigemptyset(&mask);
 
-               for (i = 0; i < (sizeof(signals) / sizeof(signals[0])); i++) {
+               for (i = 0; (size_t)i < (sizeof(signals) / sizeof(signals[0])); i++) {
                        ret = sigaddset(&mask, signals[i]);
                        if (ret < 0)
                                _exit(EXIT_FAILURE);
@@ -563,7 +563,7 @@ void test_task_blocks_signal(void)
                        _exit(EXIT_FAILURE);
                }
 
-               for (i = 0; i < (sizeof(signals) / sizeof(signals[0])); i++) {
+               for (i = 0; (size_t)i < (sizeof(signals) / sizeof(signals[0])); i++) {
                        if (!task_blocks_signal(getpid(), signals[i])) {
                                lxc_error("Failed to detect blocked signal "
                                          "(idx = %d, signal number = %d)\n",
index 64b1cb253d59592d64567017e914e41b4a24464b..f98370b4caa03181026979fa2d2000af38ea2396 100644 (file)
@@ -23,7 +23,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <lxc/lxccontainer.h>
-#include <lxc/list.h>
 #include <string.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
@@ -32,6 +31,7 @@
 
 #include "config.h"
 #include "lxctest.h"
+#include "list.h"
 #include "utils.h"
 
 #define NAME "mount_injection_test-"
index 990ce725693af1ce77702313f79c2e0a733bd177..1444799ca0dd059dacd362c400a8cfdabbd539a2 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "conf.h"
 #include "confile_utils.h"
-#include "lxc/state.h"
+#include "state.h"
 #include "lxctest.h"
 #include "utils.h"
 
index e16aabe2c5bac40d39696bf84e9ebb8c957be8c5..0a07bf467927f9d8dfd9f7d0c9911e93dcee83cb 100644 (file)
@@ -30,7 +30,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include "lxc/namespace.h"
+#include "namespace.h"
 
 #include <sched.h>
 #include <linux/sched.h>
index c46023f01866c5b1f20ae2f7ad7db166e9f9c6e3..fd070adadb294280d72b139231b9e2483dac594d 100644 (file)
@@ -288,7 +288,7 @@ int main(int argc, char *argv[])
 
                lxc_debug("Starting namespace sharing test iteration %d\n", j);
 
-               for (i = 0; i < nthreads; i++) {
+               for (i = 0; (size_t)i < nthreads; i++) {
                        memset(&args[i], 0, sizeof(struct thread_args));
                        memset(&threads[i], 0, sizeof(pthread_t));
 
@@ -303,7 +303,7 @@ int main(int argc, char *argv[])
                                goto on_error_stop;
                }
 
-               for (i = 0; i < nthreads; i++) {
+               for (i = 0; (size_t)i < nthreads; i++) {
                        ret = pthread_join(threads[i], NULL);
                        if (ret != 0)
                                goto on_error_stop;
index 62440fe28441636f64ae4bcfb58ba1d8c5d11e31..dfbf78e4591ad5a18faf68062c3a0bf02b641703 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/stat.h>
-#include "lxc/lxc.h"
+#include "lxc.h"
 
 #define MYNAME "snapxxx1"
 #define MYNAME2 "snapxxx3"