commit 9f726132ffbe027b9e938b3201602cd761cc4bbd
parent 700f2ccb17ce4572171048d78da81b288b874fe3
Author: Kyle Milz <kyle@0x30.net>
Date: Sun, 31 Jul 2016 20:09:54 -0600
Test: use an array to store pid values
Diffstat:
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/Test/Viewer.pm b/Test/Viewer.pm
@@ -34,8 +34,9 @@ sub accept {
# Protocol defined in lib/runtime.c function send_static().
#
my $buf = read_all($client, 1 + 1 + 4 + 4 + 12);
- ($self->{major}, $self->{minor}, $self->{num_tus}, $self->{lines_total}, $self->{pid},
- $self->{ppid}, $self->{pgrp}) = unpack("C2L5", $buf);
+ ($self->{major}, $self->{minor},
+ $self->{num_tus}, $self->{lines_total},
+ @{ $self->{pids} }) = unpack("C2L5", $buf);
my $progname_sz = unpack("S", read_all($client, 2));
$self->{progname} = read_all($client, $progname_sz);
@@ -44,12 +45,13 @@ sub accept {
$self->{cwd} = read_all($client, $cwd_sz);
# Always sanity check these.
- cmp_ok( $self->{pid}, ">", 1, "pid lower bound check" );
- cmp_ok( $self->{pid}, "<", 100000, "pid upper bound check" );
- cmp_ok( $self->{ppid}, ">", 1, "ppid lower bound check" );
- cmp_ok( $self->{ppid}, "<", 100000, "ppid upper bound check" );
- cmp_ok( $self->{pgrp}, ">", 1, "pgrp lower bound check" );
- cmp_ok( $self->{pgrp}, "<", 100000, "pgrp upper bound check" );
+ is( scalar @{ $self->{pids} }, 3, "number of pids" );
+ cmp_ok( $self->{pids}->[0], ">", 1, "pid check lower" );
+ cmp_ok( $self->{pids}->[0], "<", 100000, "pid check upper" );
+ cmp_ok( $self->{pids}->[1], ">", 1, "ppid check lower" );
+ cmp_ok( $self->{pids}->[1], "<", 100000, "ppid check upper" );
+ cmp_ok( $self->{pids}->[2], ">", 1, "pgrp check lower" );
+ cmp_ok( $self->{pids}->[2], "<", 100000, "pgrp check upper" );
# Read the static translation unit information.
my @tus;
diff --git a/t/rt_counters_increase.t b/t/rt_counters_increase.t
@@ -1,5 +1,5 @@
use strict;
-use Test::More tests => 19;
+use Test::More tests => 20;
use Test::Project;
use Test::Viewer;
diff --git a/t/rt_metadata.t b/t/rt_metadata.t
@@ -1,5 +1,5 @@
use strict;
-use Test::More tests => 13;
+use Test::More tests => 14;
use Test::Project;
use Test::Viewer;
diff --git a/t/rt_reconnect.t b/t/rt_reconnect.t
@@ -1,5 +1,5 @@
use strict;
-use Test::More tests => 13;
+use Test::More tests => 14;
use Test::Project;
use Test::Viewer;
diff --git a/t/rt_sanity.t b/t/rt_sanity.t
@@ -1,6 +1,6 @@
use strict;
use Cwd;
-use Test::More tests => 62;
+use Test::More tests => 63;
use Test::Project;
use Test::Viewer;