summaryrefslogtreecommitdiff
path: root/src/test/test-procfs-util.c
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/test-procfs-util.c
parent93de44d94d556fb91ee6e34ea42f818b8b41148c (diff)
Prep v238: Uncomment now needed headers and unmask now needed functions in src/test (6/6)
Diffstat (limited to 'src/test/test-procfs-util.c')
-rw-r--r--src/test/test-procfs-util.c16
1 files changed, 12 insertions, 4 deletions
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;
}