Просмотр исходного кода

libdpkg: Test command_exec() exit code

Do not expect the test program to just fail.
Guillem Jover лет назад: 12
Родитель
Сommit
01c11fcafd
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 0
      debian/changelog
  2. 3 1
      lib/dpkg/test/t-command.c

+ 1 - 0
debian/changelog

@@ -76,6 +76,7 @@ dpkg (1.17.7) UNRELEASED; urgency=low
     them to static variables.
   * Test suite cleanup:
     - Do not unnecessarily shut up stdout in t-subproc.
+    - Test command_exec() exit code.
 
   [ Updated dpkg translations ]
   * German (Sven Joachim).

+ 3 - 1
lib/dpkg/test/t-command.c

@@ -140,6 +140,7 @@ test_command_exec(void)
 {
 	struct command cmd;
 	pid_t pid;
+	int ret;
 
 	command_init(&cmd, "true", "exec test");
 
@@ -151,7 +152,8 @@ test_command_exec(void)
 	if (pid == 0)
 		command_exec(&cmd);
 
-	subproc_wait_check(pid, "command exec test", 0);
+	ret = subproc_wait_check(pid, "command exec test", 0);
+	test_pass(ret == 0);
 }
 
 static void