Changeset 764

Show
Ignore:
Timestamp:
03/25/08 08:25:15 (20 months ago)
Author:
dormando
Message:

Updating perl tests. Now works a little again. Fails 'Simple set/get'

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/binary/server/t/binary.t

    r682 r764  
    1515use constant CMD_DELETE  => 4; 
    1616use constant CMD_INCR    => 5; 
    17 use constant CMD_QUIT    => 6; 
    18 use constant CMD_FLUSH   => 7; 
    19 use constant CMD_GETQ    => 8; 
    20 use constant CMD_NOOP    => 9; 
    21 use constant CMD_VERSION => 10; 
     17use constant CMD_DECR    => 6; 
     18use constant CMD_QUIT    => 7; 
     19use constant CMD_FLUSH   => 8; 
     20use constant CMD_GETQ    => 9; 
     21use constant CMD_NOOP    => 10; 
     22use constant CMD_VERSION => 11; 
    2223 
    2324use constant CMD_GETS    => 50; 
     
    3637use constant INCRDECR_PKT_FMT => "NNNNN"; 
    3738 
    38 use constant REQ_MAGIC_BYTE => 0x0f; 
    39 use constant RES_MAGIC_BYTE => 0xf0; 
    40  
    41 use constant PKT_FMT => "CCCxNN"; 
     39use constant REQ_MAGIC_BYTE => 0x80; 
     40use constant RES_MAGIC_BYTE => 0x80; 
     41 
     42use constant PKT_FMT => "CCSCxxxNN"; 
    4243 
    4344#min recv packet size 
     
    7172}; 
    7273 
     74diag "Flushing..."; 
    7375$mc->flush; 
    7476 
     
    7678        diag "Test Version"; 
    7779        my $v = $mc->version; 
    78         ok(defined $v && length($v), "Proper version"); 
     80        ok(defined $v && length($v), "Proper version: $v"); 
    7981} 
    8082 
     
    243245 
    244246        my $host = shift || '127.0.0.1'; 
    245         my $port = shift || 11212; 
     247        my $port = shift || 11211; 
    246248 
    247249        my $sock = IO::Socket::INET->new(PeerHost => $host, PeerPort => $port); 
     
    275277        my $extralen = length($extraHeader); 
    276278 
    277         my $msg = pack(::PKT_FMT, ::REQ_MAGIC_BYTE, $cmd, $keylen, $opaque, $keylen + $vallen + $extralen); 
     279        my $msg = pack(::PKT_FMT, ::REQ_MAGIC_BYTE, $cmd, $keylen, $extralen, 
     280                    $keylen + $vallen + $extralen, $opaque); 
    278281        return $self->{socket}->send($msg . $extraHeader . $key . $val); 
    279282} 
     
    287290        Test::More::is(length($response), ::MIN_RECV_PACKET, "Expected read length"); 
    288291 
    289         my ($magic, $cmd, $errcode, $opaque, $remaining) = unpack(::PKT_FMT, $response); 
     292        my ($magic, $cmd, $errcode, $extralen, $remaining,  
     293        $opaque) = unpack(::PKT_FMT, $response); 
    290294 
    291295        Test::More::is($magic, ::RES_MAGIC_BYTE, "Got proper magic");