summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-06-05 19:08:31 +0200
committerSven Eden <yamakuzure@gmx.net>2018-06-05 19:08:54 +0200
commitada0ee56140cdb7150d047988d5ea9699217ffb8 (patch)
tree896888cdab5425250ed8ecbc1e1e41cc6ae79ffd /src/test
parent93de44d94d556fb91ee6e34ea42f818b8b41148c (diff)
Prep v238: Uncomment now needed headers and unmask now needed functions in src/test (6/6)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-conf-parser.c4
-rw-r--r--src/test/test-extract-word.c2
-rw-r--r--src/test/test-fd-util.c4
-rw-r--r--src/test/test-fs-util.c10
-rw-r--r--src/test/test-hash.c2
-rw-r--r--src/test/test-hexdecoct.c2
-rw-r--r--src/test/test-parse-util.c2
-rw-r--r--src/test/test-process-util.c2
-rw-r--r--src/test/test-procfs-util.c16
-rw-r--r--src/test/test-sizeof.c2
-rw-r--r--src/test/test-util.c4
11 files changed, 29 insertions, 21 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index 30ca7a8e7..c7f18b33f 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -240,7 +240,6 @@ static void test_config_parse_iec_uint64(void) {
assert_se(config_parse_iec_uint64(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4.5M", &offset, NULL) == 0);
}
-#endif // 0
static void test_config_parse_join_controllers(void) {
int r;
@@ -280,6 +279,7 @@ static void test_config_parse_join_controllers(void) {
assert_se(r < 0);
assert_se(c == c2);
}
+#endif // 0
#define x10(x) x x x x x x x x x x
#define x100(x) x10(x10(x))
@@ -425,8 +425,8 @@ int main(int argc, char **argv) {
#if 0 /// UNNEEDED by elogind
test_config_parse_nsec();
test_config_parse_iec_uint64();
-#endif // 0
test_config_parse_join_controllers();
+#endif // 0
for (i = 0; i < ELEMENTSOF(config_file); i++)
test_config_parse(i, config_file[i]);
diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c
index cff40a4fb..9b00cb596 100644
--- a/src/test/test-extract-word.c
+++ b/src/test/test-extract-word.c
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-//#include <errno.h>
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c
index 186fca733..3a53f80b3 100644
--- a/src/test/test-fd-util.c
+++ b/src/test/test-fd-util.c
@@ -25,8 +25,8 @@
#include "fd-util.h"
#include "fileio.h"
#include "macro.h"
-//#include "path-util.h"
-//#include "process-util.h"
+#include "path-util.h"
+#include "process-util.h"
#include "random-util.h"
#include "string-util.h"
#include "util.h"
diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c
index 507e24bdc..62a3f1622 100644
--- a/src/test/test-fs-util.c
+++ b/src/test/test-fs-util.c
@@ -25,15 +25,15 @@
//#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
-//#include "id128-util.h"
+#include "id128-util.h"
#include "macro.h"
#include "mkdir.h"
#include "path-util.h"
#include "rm-rf.h"
-//#include "stdio-util.h"
+#include "stdio-util.h"
#include "string-util.h"
#include "strv.h"
-//#include "user-util.h"
+#include "user-util.h"
#include "util.h"
static void test_chase_symlinks(void) {
@@ -443,7 +443,6 @@ static void test_access_fd(void) {
assert_se(access_fd(fd, W_OK) == -EACCES);
}
}
-#endif // 0
static void test_touch_file(void) {
uid_t test_uid, test_gid;
@@ -555,6 +554,7 @@ static void test_unlinkat_deallocate(void) {
assert_se(st.st_blocks == 0);
assert_se(st.st_nlink == 0);
}
+#endif // 0
static void test_fsync_directory_of_file(void) {
_cleanup_close_ int fd = -1;
@@ -576,9 +576,9 @@ int main(int argc, char *argv[]) {
test_dot_or_dot_dot();
#if 0 /// Uses functions that elogind does not need
test_access_fd();
-#endif // 0
test_touch_file();
test_unlinkat_deallocate();
+#endif // 0
test_fsync_directory_of_file();
return 0;
diff --git a/src/test/test-hash.c b/src/test/test-hash.c
index 0d627a425..d84a6a885 100644
--- a/src/test/test-hash.c
+++ b/src/test/test-hash.c
@@ -18,7 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-//#include <errno.h>
+#include <errno.h>
#include <stdio.h>
#include "alloc-util.h"
diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
index 5756340f3..b7e925fce 100644
--- a/src/test/test-hexdecoct.c
+++ b/src/test/test-hexdecoct.c
@@ -18,7 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-//#include <errno.h>
+#include <errno.h>
#include "alloc-util.h"
#include "hexdecoct.h"
diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
index 10348123f..95d29c378 100644
--- a/src/test/test-parse-util.c
+++ b/src/test/test-parse-util.c
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-//#include <errno.h>
+#include <errno.h>
#include <locale.h>
#include <math.h>
diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c
index 851d704e9..40b5c407c 100644
--- a/src/test/test-process-util.c
+++ b/src/test/test-process-util.c
@@ -38,7 +38,7 @@
#include "macro.h"
#include "parse-util.h"
#include "process-util.h"
-//#include "signal-util.h"
+#include "signal-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "terminal-util.h"
diff --git a/src/test/test-procfs-util.c b/src/test/test-procfs-util.c
index 433b06b05..811e312ec 100644
--- a/src/test/test-procfs-util.c
+++ b/src/test/test-procfs-util.c
@@ -1,20 +1,25 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-//#include <errno.h>
+#include <errno.h>
-//#include "log.h"
-//#include "parse-util.h"
-//#include "procfs-util.h"
+#include "log.h"
+#include "parse-util.h"
+#include "procfs-util.h"
int main(int argc, char *argv[]) {
+#if 0 /// elogind only needs v
char buf[CONST_MAX(FORMAT_TIMESPAN_MAX, FORMAT_BYTES_MAX)];
nsec_t nsec;
uint64_t v;
int r;
+#else
+ uint64_t v;
+#endif // 0
log_parse_environment();
log_open();
+#if 0 /// UNSUPPORTED by elogind (we aren't init)
assert_se(procfs_cpu_get_usage(&nsec) >= 0);
log_info("Current sytem CPU time: %s", format_timespan(buf, sizeof(buf), nsec/NSEC_PER_USEC, 1));
@@ -23,10 +28,12 @@ int main(int argc, char *argv[]) {
assert_se(procfs_tasks_get_current(&v) >= 0);
log_info("Current number of tasks: %" PRIu64, v);
+#endif // 0
assert_se(procfs_tasks_get_limit(&v) >= 0);
log_info("Limit of tasks: %" PRIu64, v);
assert_se(v > 0);
+#if 0 /// UNSUPPORTED by elogind (we aren't init)
assert_se(procfs_tasks_set_limit(v) >= 0);
if (v > 100) {
@@ -42,6 +49,7 @@ int main(int argc, char *argv[]) {
assert_se(procfs_tasks_get_limit(&w) >= 0);
assert_se(v == w);
}
+#endif // 0
return 0;
}
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index 0d96b02c2..ad0c2ceff 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -19,7 +19,7 @@
***/
#include <stdio.h>
-//#include <string.h>
+#include <string.h>
#include "time-util.h"
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 1bb39a69d..81dba9af4 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -28,8 +28,8 @@
#include "fileio.h"
#include "fs-util.h"
#include "parse-util.h"
-//#include "process-util.h"
-//#include "raw-clone.h"
+#include "process-util.h"
+#include "raw-clone.h"
#include "rm-rf.h"
#include "string-util.h"
#include "util.h"