]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/analyze/test-verify.c
network: compare with peer address if it is specified
[thirdparty/systemd.git] / src / analyze / test-verify.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #include "analyze-verify.h"
3 #include "tests.h"
4
5 static void test_verify_nonexistent(void) {
6 /* Negative cases */
7 assert_se(verify_executable(NULL, &(ExecCommand) {.flags = EXEC_COMMAND_IGNORE_FAILURE, .path = (char*) "/non/existent"}) == 0);
8 assert_se(verify_executable(NULL, &(ExecCommand) {.path = (char*) "/non/existent"}) < 0);
9
10 /* Ordinary cases */
11 assert_se(verify_executable(NULL, &(ExecCommand) {.path = (char*) "/bin/echo"}) == 0);
12 assert_se(verify_executable(NULL, &(ExecCommand) {.flags = EXEC_COMMAND_IGNORE_FAILURE, .path = (char*) "/bin/echo"}) == 0);
13 }
14
15 int main(int argc, char *argv[]) {
16 test_setup_logging(LOG_DEBUG);
17
18 test_verify_nonexistent();
19 }