Browse Source

TT#24097 Use block form for map and grep

Change-Id: I6e2c68762c13bb89dcaf916f8e5ce476c34179dd
changes/06/16706/2
Guillem Jover 8 years ago
parent
commit
4f006a5cad
4 changed files with 13 additions and 13 deletions
  1. +7
    -7
      tests/3-way-connect-simulator
  2. +4
    -4
      tests/reinvite-simulator
  3. +1
    -1
      tests/simulator-ng.pl
  4. +1
    -1
      tests/simulator-udp.pl

+ 7
- 7
tests/3-way-connect-simulator View File

@ -51,7 +51,7 @@ sub udp_sock {
sub send_rcv {
my ($sendfd, $sendtoip, $sendtoport, $recvfd) = @_;
print("sending to $sendtoip:$sendtoport... ");
my $pkt = join('',map(rand,1..10));
my $pkt = join('', map { rand } 1..10);
send($sendfd, $pkt, 0, sockaddr_in($sendtoport, inet_aton($sendtoip))) or die;
my $inc;
{
@ -97,12 +97,12 @@ sub sim_lk {
my $callid1 = join('',map(rand,1..2));
my $fromtag1 = join('',map(rand,1..4));
my $totag1 = join('',map(rand,1..4));
my $callid2 = join('',map(rand,1..2));
my $fromtag2 = join('',map(rand,1..4));
my $totag2 = join('',map(rand,1..4));
my $callid1 = join('', map { rand } 1..2);
my $fromtag1 = join('', map { rand } 1..4);
my $totag1 = join('', map { rand } 1..4);
my $callid2 = join('', map { rand } 1..2);
my $fromtag2 = join('', map { rand } 1..4);
my $totag2 = join('', map { rand } 1..4);
my ($client1, $lp1) = udp_sock();
my ($client2, $lp2) = udp_sock();


+ 4
- 4
tests/reinvite-simulator View File

@ -53,7 +53,7 @@ sub send_rcv {
my $laddr = getsockname($sendfd);
my ($lport, $lip) = sockaddr_in($laddr);
print("local port $lport sending to $sendtoip:$sendtoport... ");
my $pkt = join('',map(rand,1..10));
my $pkt = join('', map { rand } 1..10);
send($sendfd, $pkt, 0, sockaddr_in($sendtoport, inet_aton($sendtoip))) or die;
my ($inc, $addr);
{
@ -108,9 +108,9 @@ sub sim_lk {
my $callid = join('',map(rand,1..2));
my $fromtag = join('',map(rand,1..4));
my $totag = join('',map(rand,1..4));
my $callid = join('', map { rand } 1..2);
my $fromtag = join('', map { rand } 1..4);
my $totag = join('', map { rand } 1..4);
my ($client1, $lp1) = udp_sock();
my ($client2, $lp2) = udp_sock();


+ 1
- 1
tests/simulator-ng.pl View File

@ -792,7 +792,7 @@ while (time() < $end) {
do_rtp($rtcp);
@calls = sort {rand() < .5} grep(defined, @calls);
@calls = sort { rand() < .5 } grep { defined } @calls;
if ($REINVITES && $now >= $last_reinv + 15) {
$last_reinv = $now;


+ 1
- 1
tests/simulator-udp.pl View File

@ -175,7 +175,7 @@ while (time() < $end) {
sleep(1);
do_rtp();
@calls = sort {rand() < .5} grep(defined, @calls);
@calls = sort { rand() < .5 } grep { defined } @calls;
if ($REINVITES) {
my $c = $calls[rand(@calls)];


Loading…
Cancel
Save