diff options
author | Ivan Kruglov <mail@ikruglov.com> | 2024-04-10 13:19:39 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-04-15 08:13:50 +0200 |
commit | c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a (patch) | |
tree | 88c426bab7e104bc11ff4289e878bb676c083a9a /src/test/test-install-root.c | |
parent | Merge pull request #32266 from yuwata/libsystemd-network-trivial-cleanups (diff) | |
download | systemd-c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a.tar.xz systemd-c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a.zip |
ASSERT_STREQ for simple cases
Diffstat (limited to 'src/test/test-install-root.c')
-rw-r--r-- | src/test/test-install-root.c | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c index c55445079c..1e7ed27f63 100644 --- a/src/test/test-install-root.c +++ b/src/test/test-install-root.c @@ -60,9 +60,9 @@ TEST(basic_mask_and_enable) { assert_se(unit_file_mask(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("a.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/dev/null")); + ASSERT_STREQ(changes[0].source, "/dev/null"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -81,16 +81,16 @@ TEST(basic_mask_and_enable) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("a.service"), &changes, &n_changes) == 1); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/a.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/a.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -109,7 +109,7 @@ TEST(basic_mask_and_enable) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -128,9 +128,9 @@ TEST(basic_mask_and_enable) { assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("d.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/a.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/a.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -145,10 +145,10 @@ TEST(basic_mask_and_enable) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[1].source, "/usr/lib/systemd/system/a.service")); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].source, "/usr/lib/systemd/system/a.service"); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -186,13 +186,13 @@ TEST(basic_mask_and_enable) { assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("f.service"), &changes, &n_changes) == 1); assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/f.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/f.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/x.target.wants/f.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); assert_se(changes[1].type == INSTALL_CHANGE_DESTINATION_NOT_PRESENT); p = strjoina(root, "/usr/lib/systemd/system/f.service"); - assert_se(streq(changes[1].source, p)); - assert_se(streq(changes[1].path, "x.target")); + ASSERT_STREQ(changes[1].source, p); + ASSERT_STREQ(changes[1].path, "x.target"); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -255,9 +255,9 @@ TEST(linked_units) { assert_se(unit_file_link(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("/opt/linked.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/opt/linked.service")); + ASSERT_STREQ(changes[0].source, "/opt/linked.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/linked.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -268,7 +268,7 @@ TEST(linked_units) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/linked.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -285,9 +285,9 @@ TEST(linked_units) { if (s && streq(changes[i].path, s)) /* The alias symlink should point within the search path. */ - assert_se(streq(changes[i].source, SYSTEM_CONFIG_UNIT_DIR"/linked.service")); + ASSERT_STREQ(changes[i].source, SYSTEM_CONFIG_UNIT_DIR"/linked.service"); else - assert_se(streq(changes[i].source, "/opt/linked.service")); + ASSERT_STREQ(changes[i].source, "/opt/linked.service"); if (p && streq(changes[i].path, p)) p = NULL; @@ -335,7 +335,7 @@ TEST(linked_units) { q = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/linked2.service"); for (i = 0 ; i < n_changes; i++) { assert_se(changes[i].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[i].source, "/opt/linked2.service")); + ASSERT_STREQ(changes[i].source, "/opt/linked2.service"); if (p && streq(changes[i].path, p)) p = NULL; @@ -353,7 +353,7 @@ TEST(linked_units) { assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(startswith(changes[0].path, root)); assert_se(endswith(changes[0].path, "linked3.service")); - assert_se(streq(changes[0].source, "/opt/linked3.service")); + ASSERT_STREQ(changes[0].source, "/opt/linked3.service"); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; } @@ -375,7 +375,7 @@ TEST(default) { assert_se(unit_file_set_default(RUNTIME_SCOPE_SYSTEM, 0, root, "idontexist.target", &changes, &n_changes) == -ENOENT); assert_se(n_changes == 1); assert_se(changes[0].type == -ENOENT); - assert_se(streq_ptr(changes[0].path, "idontexist.target")); + ASSERT_STREQ(changes[0].path, "idontexist.target"); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -384,14 +384,14 @@ TEST(default) { assert_se(unit_file_set_default(RUNTIME_SCOPE_SYSTEM, 0, root, "test-default.target", &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/test-default-real.target")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/test-default-real.target"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR "/" SPECIAL_DEFAULT_TARGET); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; assert_se(unit_file_get_default(RUNTIME_SCOPE_SYSTEM, root, &def) >= 0); - assert_se(streq_ptr(def, "test-default-real.target")); + ASSERT_STREQ(def, "test-default-real.target"); } TEST(add_dependency) { @@ -414,9 +414,9 @@ TEST(add_dependency) { assert_se(unit_file_add_dependency(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("add-dependency-test-service.service"), "add-dependency-test-target.target", UNIT_WANTS, &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/real-add-dependency-test-service.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/real-add-dependency-test-service.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/real-add-dependency-test-target.target.wants/real-add-dependency-test-service.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; } @@ -455,9 +455,9 @@ TEST(template_enable) { assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("template@.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/template@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/template@def.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -471,7 +471,7 @@ TEST(template_enable) { assert_se(unit_file_disable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("template@.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -486,9 +486,9 @@ TEST(template_enable) { assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("template@foo.service"), &changes, &n_changes) >= 0); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/template@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/template@foo.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -502,7 +502,7 @@ TEST(template_enable) { assert_se(unit_file_disable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("template@foo.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -519,9 +519,9 @@ TEST(template_enable) { assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("template-symlink@quux.service"), &changes, &n_changes) >= 0); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/template@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/template@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/template@quux.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -565,9 +565,9 @@ TEST(indirect) { assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("indirectc.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/indirectb.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/indirectb.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/indirectb.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -579,7 +579,7 @@ TEST(indirect) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/indirectb.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; } @@ -627,9 +627,9 @@ TEST(preset_and_list) { assert_se(unit_file_preset(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("preset-yes.service"), UNIT_FILE_PRESET_FULL, &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/preset-yes.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/preset-yes.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/preset-yes.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -641,7 +641,7 @@ TEST(preset_and_list) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/preset-yes.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -667,8 +667,8 @@ TEST(preset_and_list) { for (i = 0; i < n_changes; i++) { if (changes[i].type == INSTALL_CHANGE_SYMLINK) { - assert_se(streq(changes[i].source, "/usr/lib/systemd/system/preset-yes.service")); - assert_se(streq(changes[i].path, p)); + ASSERT_STREQ(changes[i].source, "/usr/lib/systemd/system/preset-yes.service"); + ASSERT_STREQ(changes[i].path, p); } else assert_se(changes[i].type == INSTALL_CHANGE_UNLINK); } @@ -735,7 +735,7 @@ TEST(revert) { assert_se(unit_file_revert(RUNTIME_SCOPE_SYSTEM, root, STRV_MAKE("xx.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -746,11 +746,11 @@ TEST(revert) { assert_se(unit_file_revert(RUNTIME_SCOPE_SYSTEM, root, STRV_MAKE("xx.service"), &changes, &n_changes) >= 0); assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/xx.service.d"); assert_se(changes[1].type == INSTALL_CHANGE_UNLINK); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; } @@ -786,9 +786,9 @@ TEST(preset_order) { assert_se(unit_file_preset(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("prefix-1.service"), UNIT_FILE_PRESET_FULL, &changes, &n_changes) >= 0); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/prefix-1.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/prefix-1.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/prefix-1.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -895,12 +895,12 @@ TEST(with_dropin) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-1.service")); - assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-1.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-1.service"); + ASSERT_STREQ(changes[1].source, "/usr/lib/systemd/system/with-dropin-1.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-1.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-1.service"); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -909,12 +909,12 @@ TEST(with_dropin) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, SYSTEM_CONFIG_UNIT_DIR"/with-dropin-2.service")); - assert_se(streq(changes[1].source, SYSTEM_CONFIG_UNIT_DIR"/with-dropin-2.service")); + ASSERT_STREQ(changes[0].source, SYSTEM_CONFIG_UNIT_DIR"/with-dropin-2.service"); + ASSERT_STREQ(changes[1].source, SYSTEM_CONFIG_UNIT_DIR"/with-dropin-2.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-2.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-2.service"); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -923,12 +923,12 @@ TEST(with_dropin) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-3.service")); - assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-3.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-3.service"); + ASSERT_STREQ(changes[1].source, "/usr/lib/systemd/system/with-dropin-3.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-3.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-3.service"); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -937,12 +937,12 @@ TEST(with_dropin) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-4a.service")); - assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-4b.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-4a.service"); + ASSERT_STREQ(changes[1].source, "/usr/lib/systemd/system/with-dropin-4b.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-4a.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-4b.service"); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -1004,12 +1004,12 @@ TEST(with_dropin_template) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-1@.service")); - assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-1@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-1@.service"); + ASSERT_STREQ(changes[1].source, "/usr/lib/systemd/system/with-dropin-1@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-1@instance-1.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-1@instance-1.service"); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -1017,30 +1017,30 @@ TEST(with_dropin_template) { assert_se(n_changes == 2); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); assert_se(changes[1].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-2@.service")); - assert_se(streq(changes[1].source, "/usr/lib/systemd/system/with-dropin-2@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-2@.service"); + ASSERT_STREQ(changes[1].source, "/usr/lib/systemd/system/with-dropin-2@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-2@instance-1.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/graphical.target.wants/with-dropin-2@instance-1.service"); - assert_se(streq(changes[1].path, p)); + ASSERT_STREQ(changes[1].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("with-dropin-2@instance-2.service"), &changes, &n_changes) == 1); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-2@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-2@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-2@instance-2.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; assert_se(unit_file_enable(RUNTIME_SCOPE_SYSTEM, 0, root, STRV_MAKE("with-dropin-3@.service"), &changes, &n_changes) == 1); assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); - assert_se(streq(changes[0].source, "/usr/lib/systemd/system/with-dropin-3@.service")); + ASSERT_STREQ(changes[0].source, "/usr/lib/systemd/system/with-dropin-3@.service"); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/with-dropin-3@instance-2.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -1080,7 +1080,7 @@ TEST(preset_multiple_instances) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_SYMLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/foo@bar0.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -1088,7 +1088,7 @@ TEST(preset_multiple_instances) { assert_se(n_changes == 1); assert_se(changes[0].type == INSTALL_CHANGE_UNLINK); p = strjoina(root, SYSTEM_CONFIG_UNIT_DIR"/multi-user.target.wants/foo@bar0.service"); - assert_se(streq(changes[0].path, p)); + ASSERT_STREQ(changes[0].path, p); install_changes_free(changes, n_changes); changes = NULL; n_changes = 0; @@ -1131,7 +1131,7 @@ static void verify_one( * RequiredBy= settings, and less so for Alias=. The only case where it should happen is when we have * an Alias=alias@.service an instantiated template template@instance. In that case the instance name * should be propagated into the alias as alias@instance. */ - assert_se(streq_ptr(alias2, updated_name)); + ASSERT_STREQ(alias2, updated_name); } TEST(verify_alias) { |