aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-12-16 19:55:35 +0000
committerYang Tse <yangsita@gmail.com>2009-12-16 19:55:35 +0000
commit002ed5f29800282b16c2d9df8480aa7386c93dea (patch)
tree37ad2d891cb37bbb9c796f9eb35b7f2055ca2c32 /tests
parent044ba6dad2cb0d891baf40ddcd611a4b9aca3921 (diff)
Test harness process control enhancements
Diffstat (limited to 'tests')
-rw-r--r--tests/ftp.pm6
-rwxr-xr-xtests/runtests.pl2
-rw-r--r--tests/server/sws.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/tests/ftp.pm b/tests/ftp.pm
index 28bbb4ea6..1b45014a6 100644
--- a/tests/ftp.pm
+++ b/tests/ftp.pm
@@ -85,7 +85,11 @@ sub killpid {
# stop it, otherwise reap it if this has not been done yet.
my @signalled;
my $prev = 0;
- my @pids = sort({$a <=> $b} split(/\s+/, $pidlist));
+ my @pids = split(' ', $pidlist);
+ if(scalar(@pids) > 2) {
+ my @sorted = sort({$a <=> $b} @pids);
+ @pids = @sorted;
+ }
foreach my $tmp (@pids) {
chomp $tmp;
if($tmp =~ /^(\d+)$/) {
diff --git a/tests/runtests.pl b/tests/runtests.pl
index ace609f72..33def4d91 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -2518,7 +2518,7 @@ sub stopservers {
my $pid;
my $prev;
- foreach $pid (split(/\s+/, $pids)) {
+ foreach $pid (split(' ', $pids)) {
if($pid != $prev) {
# no need to kill same pid twice!
logmsg sprintf("* kill pid for %s => %d\n",
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 00fd74fe1..5970f470c 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -927,7 +927,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
logmsg("Sent off %zd bytes", written);
}
/* write to file as well */
- fwrite(buffer, 1, written, dump);
+ fwrite(buffer, 1, (size_t)written, dump);
if(got_exit_signal)
break;