chiark / gitweb /
Prep v238: Uncomment now needed headers and unmask now needed functions in src/test...
authorSven Eden <yamakuzure@gmx.net>
Tue, 5 Jun 2018 17:08:31 +0000 (19:08 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 5 Jun 2018 17:08:54 +0000 (19:08 +0200)
src/test/test-conf-parser.c
src/test/test-extract-word.c
src/test/test-fd-util.c
src/test/test-fs-util.c
src/test/test-hash.c
src/test/test-hexdecoct.c
src/test/test-parse-util.c
src/test/test-process-util.c
src/test/test-procfs-util.c
src/test/test-sizeof.c
src/test/test-util.c

index 30ca7a8e741fe6aba510f8a3babd5a68a44e23e0..c7f18b33f54d41dd8dd76a963c0a8692e517b9a3 100644 (file)
@@ -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]);
index cff40a4fb3e531a0a8330700d2560f7096062ccc..9b00cb5967d1048405cd84315f653b64463934ba 100644 (file)
@@ -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>
 
index 186fca733f1e50cb0f31a717451ae196cd3e7f64..3a53f80b32e5a2f595f15b4fcabb4526ff7200e0 100644 (file)
@@ -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"
index 507e24bdc2186c16cc5bedc50845c6343d5143a4..62a3f162263e11f3922f4731efdb9c2a08f964ec 100644 (file)
 //#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;
index 0d627a4257642c2774c11e3ee9a414c4c3516403..d84a6a8859930f68b03dba196a47b6392bc818cb 100644 (file)
@@ -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"
index 5756340f38755c28b6d6b70012181026fb818855..b7e925fce0cf6c4edf20e9c126978febd2fdacef 100644 (file)
@@ -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"
index 10348123f6b4fbe1fa5fcd7854a271968d4af1cb..95d29c378c45a77f2ab307be92722160f344a1c6 100644 (file)
@@ -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>
 
index 851d704e9372cccf46f727c41443a5bf21fdb8e8..40b5c407c6ca48ce7b5282b9d9e66b33e6c36a69 100644 (file)
@@ -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"
index 433b06b0542ba1a2b629ade78912346c65e801be..811e312ec8468931edc303f6b61a09acc9548ad5 100644 (file)
@@ -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;
 }
index 0d96b02c2a4c1225ff4ba3ad5f8f14fab6cb60b8..ad0c2ceffeecbe76a9fee44689858744d91b3dd5 100644 (file)
@@ -19,7 +19,7 @@
 ***/
 
 #include <stdio.h>
-//#include <string.h>
+#include <string.h>
 
 #include "time-util.h"
 
index 1bb39a69d987024c75e04ab20cb2fdf61f506912..81dba9af49462b572fe72abf033e29562c479c1f 100644 (file)
@@ -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"