summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-17 14:29:41 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-17 14:29:41 +0200
commit746af6e0b5aaed999be912e48505d3edc2cf874a (patch)
treee683aa6525e4eee3d7621c2c4a85f6042184c8b0 /src/test
parentb50a16af8e3c353703d55f117077fcf60b8081e8 (diff)
parent24737c291738313fd67924172988a8986f60e958 (diff)
Merge pull request #3049 from keszybz/preset-fixes
Fixes for preset-all handling and a few related issues
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-install-root.c2
-rw-r--r--src/test/test-path-util.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c
index 2138655e29..998c345a1a 100644
--- a/src/test/test-install-root.c
+++ b/src/test/test-install-root.c
@@ -80,7 +80,7 @@ static void test_basic_mask_and_enable(const char *root) {
assert_se(unit_file_get_state(UNIT_FILE_SYSTEM, root, "d.service", &state) >= 0 && state == UNIT_FILE_MASKED);
/* Enabling a masked unit should fail! */
- assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), false, &changes, &n_changes) == -ESHUTDOWN);
+ assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("a.service"), false, &changes, &n_changes) == -ERFKILL);
unit_file_changes_free(changes, n_changes);
changes = NULL; n_changes = 0;
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
index d376dd56c5..5d77e2959c 100644
--- a/src/test/test-path-util.c
+++ b/src/test/test-path-util.c
@@ -90,6 +90,18 @@ static void test_path(void) {
assert_se(path_equal(path_kill_slashes(p2), "/aaa/./ccc"));
assert_se(path_equal(path_kill_slashes(p3), "/./"));
}
+
+ assert_se(PATH_IN_SET("/bin", "/", "/bin", "/foo"));
+ assert_se(PATH_IN_SET("/bin", "/bin"));
+ assert_se(PATH_IN_SET("/bin", "/foo/bar", "/bin"));
+ assert_se(PATH_IN_SET("/", "/", "/", "/foo/bar"));
+ assert_se(!PATH_IN_SET("/", "/abc", "/def"));
+
+ assert_se(path_equal_ptr(NULL, NULL));
+ assert_se(path_equal_ptr("/a", "/a"));
+ assert_se(!path_equal_ptr("/a", "/b"));
+ assert_se(!path_equal_ptr("/a", NULL));
+ assert_se(!path_equal_ptr(NULL, "/a"));
}
static void test_find_binary(const char *self) {