summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-11-11 23:14:12 +0100
committerTom Gundersen <teg@jklm.no>2015-11-11 23:14:12 +0100
commitfb5c8184a99ed3379d6a48eed2b83f6f7ee9ee18 (patch)
treef8144b0ba312e12a221ec9b1c0f7f937fb5aec9d /src/test
parenta9ae08421eac6080d68c03c503c1673eea9f37b3 (diff)
parentee735086f8670be1591fa9593e80dd60163a7a2f (diff)
Merge pull request #1854 from poettering/unit-deps
Dependency engine improvements
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-conf-files.c3
-rw-r--r--src/test/test-extract-word.c12
2 files changed, 14 insertions, 1 deletions
diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c
index a69698d4ea..86ac513d4f 100644
--- a/src/test/test-conf-files.c
+++ b/src/test/test-conf-files.c
@@ -26,6 +26,7 @@
#include "conf-files.h"
#include "fs-util.h"
#include "macro.h"
+#include "parse-util.h"
#include "rm-rf.h"
#include "string-util.h"
#include "strv.h"
@@ -40,7 +41,7 @@ static void setup_test_dir(char *tmp_dir, const char *files, ...) {
va_start(ap, files);
while (files != NULL) {
_cleanup_free_ char *path = strappend(tmp_dir, files);
- assert_se(touch_file(path, true, USEC_INFINITY, UID_INVALID, GID_INVALID, 0) == 0);
+ assert_se(touch_file(path, true, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID) == 0);
files = va_arg(ap, const char *);
}
va_end(ap);
diff --git a/src/test/test-extract-word.c b/src/test/test-extract-word.c
index 09698c07c7..65d3a0a96e 100644
--- a/src/test/test-extract-word.c
+++ b/src/test/test-extract-word.c
@@ -325,6 +325,18 @@ static void test_extract_first_word(void) {
assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 0);
assert_se(!t);
assert_se(!p);
+
+ p = "foo\\xbar";
+ assert_se(extract_first_word(&p, &t, NULL, 0) > 0);
+ assert_se(streq(t, "fooxbar"));
+ free(t);
+ assert_se(p == NULL);
+
+ p = "foo\\xbar";
+ assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) > 0);
+ assert_se(streq(t, "foo\\xbar"));
+ free(t);
+ assert_se(p == NULL);
}
static void test_extract_first_word_and_warn(void) {