From 1b4a42a27fd179e88ddbcd252f519e4ac6b7dc5c Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Tue, 17 Mar 2009 23:24:33 -0700 Subject: Fixed -C and -b: (with tests). Using the settings stats, we can verify the startup effects -C and -b: bring and validate that they were both broken by a recent change. --- memcached.c | 4 ++-- t/00-startup.t | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/memcached.c b/memcached.c index 1612668..c872979 100644 --- a/memcached.c +++ b/memcached.c @@ -4215,8 +4215,8 @@ int main (int argc, char **argv) { "D:" /* prefix delimiter? */ "L" /* Large memory pages */ "R:" /* max requests per event */ - "C:" /* Disable use of CAS */ - "b" /* backlog queue limit */ + "C" /* Disable use of CAS */ + "b:" /* backlog queue limit */ ))) { switch (c) { case 'a': diff --git a/t/00-startup.t b/t/00-startup.t index a0fda0c..9a55563 100755 --- a/t/00-startup.t +++ b/t/00-startup.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; -use Test::More tests => 4; +use Test::More tests => 8; use FindBin qw($Bin); use lib "$Bin/lib"; use MemcachedTest; @@ -21,3 +21,17 @@ eval { my $server = new_memcached("-l 127.0.0.1"); }; is($@,'', "-l 127.0.0.1 works"); + +eval { + my $server = new_memcached('-C'); + my $stats = mem_stats($server->sock, 'settings'); + is('no', $stats->{'cas_enabled'}); +}; +is($@, '', "-C works"); + +eval { + my $server = new_memcached('-b 8675'); + my $stats = mem_stats($server->sock, 'settings'); + is('8675', $stats->{'tcp_backlog'}); +}; +is($@, '', "-b works"); -- cgit v1.2.1