~yolanda.robla/ubuntu/trusty/memcached/add_distribution

« back to all changes in this revision

Viewing changes to t/issue_14.t

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2009-08-01 23:26:45 UTC
  • mto: (3.3.1 squeeze) (1.4.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20090801232645-g57xdaf3zal53qcl
Tags: upstream-1.4.0
Import upstream version 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use Test::More tests => 21;
 
5
use FindBin qw($Bin);
 
6
use lib "$Bin/lib";
 
7
use MemcachedTest;
 
8
 
 
9
my $server = new_memcached();
 
10
my $sock = $server->sock;
 
11
my $value = "B"x66560;
 
12
my $key = 0;
 
13
 
 
14
for ($key = 0; $key < 10; $key++) {
 
15
    print $sock "set key$key 0 2 66560\r\n$value\r\n";
 
16
    is (scalar <$sock>, "STORED\r\n", "stored key$key");
 
17
}
 
18
 
 
19
#print $sock "stats slabs"
 
20
my $first_stats  = mem_stats($sock, "slabs");
 
21
my $first_malloc = $first_stats->{total_malloced};
 
22
 
 
23
sleep(4);
 
24
 
 
25
for ($key = 10; $key < 20; $key++) {
 
26
    print $sock "set key$key 0 2 66560\r\n$value\r\n";
 
27
    is (scalar <$sock>, "STORED\r\n", "stored key$key");
 
28
}
 
29
 
 
30
my $second_stats  = mem_stats($sock, "slabs");
 
31
my $second_malloc = $second_stats->{total_malloced};
 
32
 
 
33
 
 
34
is ($second_malloc, $first_malloc, "Memory grows..")