The following commit has been merged in the master branch:
commit 4cb6ae5d9e239c42c123910aa8407fbfed266ebf
Author: Guillem Jover <guil...@debian.org>
Date:   Sun Jul 25 19:43:30 2010 +0200

    libdpkg: Add test case for command_exec

diff --git a/lib/dpkg/test/t-command.c b/lib/dpkg/test/t-command.c
index 5256913..881cab7 100644
--- a/lib/dpkg/test/t-command.c
+++ b/lib/dpkg/test/t-command.c
@@ -22,6 +22,7 @@
 #include <compat.h>
 
 #include <dpkg/test.h>
+#include <dpkg/subproc.h>
 #include <dpkg/command.h>
 
 static void
@@ -133,11 +134,31 @@ test_command_add_args(void)
 }
 
 static void
+test_command_exec(void)
+{
+       struct command cmd;
+       pid_t pid;
+
+       command_init(&cmd, "/bin/true", "exec test");
+
+       command_add_arg(&cmd, "arg 0");
+       command_add_arg(&cmd, "arg 1");
+
+       pid = subproc_fork();
+
+       if (pid == 0)
+               command_exec(&cmd);
+
+       subproc_wait_check(pid, "command exec test", 0);
+}
+
+static void
 test(void)
 {
        test_command_init();
        test_command_add_arg();
        test_command_add_argl();
        test_command_add_args();
+       test_command_exec();
 }
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to