summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-12 14:04:47 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-14 17:01:54 +0100
commitaa8fbc74e3eadf57a15b84cce5778a8eab1d97e6 (patch)
treeea8b676c0cfc8d35dd9977d16a6fcf214704200d /src/test
parent01771226c202183ff447da712f43d2fad8874484 (diff)
downloadsystemd-aa8fbc74e3eadf57a15b84cce5778a8eab1d97e6.tar.gz
systemd-aa8fbc74e3eadf57a15b84cce5778a8eab1d97e6.tar.bz2
systemd-aa8fbc74e3eadf57a15b84cce5778a8eab1d97e6.zip
fileio: drop "newline" parameter for env file parsers
Now that we don't (mis-)use the env file parser to parse kernel command lines there's no need anymore to override the used newline character set. Let's hence drop the argument and just "\n\r" always. This nicely simplifies our code.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-fileio.c12
-rw-r--r--src/test/test-unit-file.c10
2 files changed, 11 insertions, 11 deletions
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index cabaef6ab8..8719ec26bb 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -55,7 +55,7 @@ static void test_parse_env_file(void) {
fflush(f);
fclose(f);
- r = load_env_file(NULL, t, NULL, &a);
+ r = load_env_file(NULL, t, &a);
assert_se(r >= 0);
STRV_FOREACH(i, a)
@@ -82,7 +82,7 @@ static void test_parse_env_file(void) {
}
r = parse_env_file(
- NULL, t, NULL,
+ NULL, t,
"one", &one,
"two", &two,
"three", &three,
@@ -128,7 +128,7 @@ static void test_parse_env_file(void) {
r = write_env_file(p, a);
assert_se(r >= 0);
- r = load_env_file(NULL, p, NULL, &b);
+ r = load_env_file(NULL, p, &b);
assert_se(r >= 0);
}
@@ -157,7 +157,7 @@ static void test_parse_multiline_env_file(void) {
fflush(f);
fclose(f);
- r = load_env_file(NULL, t, NULL, &a);
+ r = load_env_file(NULL, t, &a);
assert_se(r >= 0);
STRV_FOREACH(i, a)
@@ -176,7 +176,7 @@ static void test_parse_multiline_env_file(void) {
r = write_env_file(p, a);
assert_se(r >= 0);
- r = load_env_file(NULL, p, NULL, &b);
+ r = load_env_file(NULL, p, &b);
assert_se(r >= 0);
}
@@ -467,7 +467,7 @@ static void test_load_env_file_pairs(void) {
f = fdopen(fd, "r");
assert_se(f);
- r = load_env_file_pairs(f, fn, NULL, &l);
+ r = load_env_file_pairs(f, fn, &l);
assert_se(r >= 0);
assert_se(strv_length(l) == 14);
diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
index fe6da4fe2d..493ca50220 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -531,7 +531,7 @@ static void test_load_env_file_1(void) {
assert_se(fd >= 0);
assert_se(write(fd, env_file_1, sizeof(env_file_1)) == sizeof(env_file_1));
- r = load_env_file(NULL, name, NULL, &data);
+ r = load_env_file(NULL, name, &data);
assert_se(r == 0);
assert_se(streq(data[0], "a=a"));
assert_se(streq(data[1], "b=bc"));
@@ -553,7 +553,7 @@ static void test_load_env_file_2(void) {
assert_se(fd >= 0);
assert_se(write(fd, env_file_2, sizeof(env_file_2)) == sizeof(env_file_2));
- r = load_env_file(NULL, name, NULL, &data);
+ r = load_env_file(NULL, name, &data);
assert_se(r == 0);
assert_se(streq(data[0], "a=a"));
assert_se(data[1] == NULL);
@@ -570,7 +570,7 @@ static void test_load_env_file_3(void) {
assert_se(fd >= 0);
assert_se(write(fd, env_file_3, sizeof(env_file_3)) == sizeof(env_file_3));
- r = load_env_file(NULL, name, NULL, &data);
+ r = load_env_file(NULL, name, &data);
assert_se(r == 0);
assert_se(data == NULL);
}
@@ -585,7 +585,7 @@ static void test_load_env_file_4(void) {
assert_se(fd >= 0);
assert_se(write(fd, env_file_4, sizeof(env_file_4)) == sizeof(env_file_4));
- r = load_env_file(NULL, name, NULL, &data);
+ r = load_env_file(NULL, name, &data);
assert_se(r == 0);
assert_se(streq(data[0], "HWMON_MODULES=coretemp f71882fg"));
assert_se(streq(data[1], "MODULE_0=coretemp"));
@@ -604,7 +604,7 @@ static void test_load_env_file_5(void) {
assert_se(fd >= 0);
assert_se(write(fd, env_file_5, sizeof(env_file_5)) == sizeof(env_file_5));
- r = load_env_file(NULL, name, NULL, &data);
+ r = load_env_file(NULL, name, &data);
assert_se(r == 0);
assert_se(streq(data[0], "a="));
assert_se(streq(data[1], "b="));