summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-17 23:24:33 -0700
committerDustin Sallings <dustin@spy.net>2009-03-19 03:27:04 -0700
commit1b4a42a27fd179e88ddbcd252f519e4ac6b7dc5c (patch)
treebc7d0d11a63e82b4a2e2c89605fd68fd931ae500
parent52778791807b6678295495f90006a251de1a2ba3 (diff)
downloadmemcached-1b4a42a27fd179e88ddbcd252f519e4ac6b7dc5c.tar.gz
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.
-rw-r--r--memcached.c4
-rwxr-xr-xt/00-startup.t16
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");