Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 45 lines (34 sloc) 1.138 kB
a44f547 @bradfitz adding stub tests
bradfitz authored
1 #!/usr/bin/perl
2
3 use strict;
0140fa4 @bradfitz start of work on 64-bit hosts. at least identifying 32-bit builds
bradfitz authored
4 use Test::More;
a44f547 @bradfitz adding stub tests
bradfitz authored
5 use FindBin qw($Bin);
6 use lib "$Bin/lib";
7 use MemcachedTest;
8
cc672e4 @bradfitz update test so it still works, but can also work with the 1.1.x branch
bradfitz authored
9 $ENV{T_MEMD_INITIAL_MALLOC} = "4294967328"; # 2**32 + 32 , just over 4GB
0140fa4 @bradfitz start of work on 64-bit hosts. at least identifying 32-bit builds
bradfitz authored
10 $ENV{T_MEMD_SLABS_ALLOC} = 0; # don't preallocate slabs
11
cc672e4 @bradfitz update test so it still works, but can also work with the 1.1.x branch
bradfitz authored
12 my $server = new_memcached("-m 4098 -M");
a44f547 @bradfitz adding stub tests
bradfitz authored
13 my $sock = $server->sock;
9325b3c @bradfitz make memcached reports its pointer size, so test suite needs less ove…
bradfitz authored
14
15 my ($stats, $slabs) = @_;
16
17 $stats = mem_stats($sock);
18
19 if ($stats->{'pointer_size'} eq "32") {
0969ed4 @bradfitz more 64 bit tests
bradfitz authored
20 plan skip_all => 'Skipping 64-bit tests on 32-bit build';
21 exit 0;
22 } else {
23 plan tests => 6;
0140fa4 @bradfitz start of work on 64-bit hosts. at least identifying 32-bit builds
bradfitz authored
24 }
0969ed4 @bradfitz more 64 bit tests
bradfitz authored
25
9325b3c @bradfitz make memcached reports its pointer size, so test suite needs less ove…
bradfitz authored
26 is($stats->{'pointer_size'}, 64, "is 64 bit");
cc672e4 @bradfitz update test so it still works, but can also work with the 1.1.x branch
bradfitz authored
27 is($stats->{'limit_maxbytes'}, "4297064448", "max bytes is 4098 MB");
9325b3c @bradfitz make memcached reports its pointer size, so test suite needs less ove…
bradfitz authored
28
29 $slabs = mem_stats($sock, 'slabs');
30 is($slabs->{'total_malloced'}, "4294967328", "expected (faked) value of total_malloced");
31 is($slabs->{'active_slabs'}, 0, "no active slabs");
0969ed4 @bradfitz more 64 bit tests
bradfitz authored
32
33 my $hit_limit = 0;
cc672e4 @bradfitz update test so it still works, but can also work with the 1.1.x branch
bradfitz authored
34 for (1..5) {
0969ed4 @bradfitz more 64 bit tests
bradfitz authored
35 my $size = 400 * 1024;
36 my $data = "a" x $size;
37 print $sock "set big$_ 0 0 $size\r\n$data\r\n";
38 my $res = <$sock>;
39 $hit_limit = 1 if $res ne "STORED\r\n";
40 }
41 ok($hit_limit, "hit size limit");
42
9325b3c @bradfitz make memcached reports its pointer size, so test suite needs less ove…
bradfitz authored
43 $slabs = mem_stats($sock, 'slabs');
44 is($slabs->{'active_slabs'}, 1, "1 active slab");
Something went wrong with that request. Please try again.