]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: move conf-parser related tests to test-conf-parser.c
authorRonny Chevalier <chevalier.ronny@gmail.com>
Wed, 2 Mar 2016 23:08:10 +0000 (00:08 +0100)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Thu, 3 Mar 2016 18:04:06 +0000 (19:04 +0100)
src/test/test-conf-parser.c
src/test/test-util.c

index b3a4c403394fedfdf1e3e6e7f6456aa1dd6e67e1..be5d2611f89e8a155bfd21d0fa20b9d47a7caae4 100644 (file)
@@ -215,6 +215,14 @@ static void test_config_parse_nsec(void) {
         test_config_parse_nsec_one("garbage", 0);
 }
 
+static void test_config_parse_iec_uint64(void) {
+        uint64_t offset = 0;
+        assert_se(config_parse_iec_uint64(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4M", &offset, NULL) == 0);
+        assert_se(offset == 4 * 1024 * 1024);
+
+        assert_se(config_parse_iec_uint64(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4.5M", &offset, NULL) == 0);
+}
+
 int main(int argc, char **argv) {
         log_parse_environment();
         log_open();
@@ -230,6 +238,7 @@ int main(int argc, char **argv) {
         test_config_parse_mode();
         test_config_parse_sec();
         test_config_parse_nsec();
+        test_config_parse_iec_uint64();
 
         return 0;
 }
index 30444e122ace282991af41a88377c3cb907b4ff4..7226e9b76f8b7a2f391b4ed928ab75d294f12581 100644 (file)
@@ -27,7 +27,6 @@
 #include <unistd.h>
 
 #include "alloc-util.h"
-#include "conf-parser.h"
 #include "def.h"
 #include "fd-util.h"
 #include "fileio.h"
@@ -190,14 +189,6 @@ static void test_protect_errno(void) {
         assert_se(errno == 12);
 }
 
-static void test_config_parse_iec_uint64(void) {
-        uint64_t offset = 0;
-        assert_se(config_parse_iec_uint64(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4M", &offset, NULL) == 0);
-        assert_se(offset == 4 * 1024 * 1024);
-
-        assert_se(config_parse_iec_uint64(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4.5M", &offset, NULL) == 0);
-}
-
 static void test_fstab_node_to_udev_node(void) {
         char *n;
 
@@ -487,7 +478,6 @@ int main(int argc, char *argv[]) {
         test_div_round_up();
         test_u64log2();
         test_protect_errno();
-        test_config_parse_iec_uint64();
         test_fstab_node_to_udev_node();
         test_get_files_in_directory();
         test_in_set();