Merge lp:~brianaker/libmemcached/1220444 into lp:libmemcached

Proposed by Brian Aker
Status: Merged
Merged at revision: 1109
Proposed branch: lp:~brianaker/libmemcached/1220444
Merge into: lp:libmemcached
Diff against target: 835 lines (+210/-129) (has conflicts)
23 files modified
bootstrap.sh (+45/-17)
clients/generator.cc (+5/-3)
clients/memcp.cc (+1/-1)
clients/memslap.cc (+5/-3)
libmemcached/io.cc (+4/-4)
libmemcached/string.cc (+11/-9)
libtest/cmdline.cc (+1/-1)
libtest/core.cc (+2/-2)
libtest/cpu.cc (+5/-0)
libtest/main.cc (+9/-2)
libtest/unittest.cc (+5/-5)
m4/ax_debug.m4 (+4/-2)
m4/ax_harden_compiler_flags.m4 (+36/-0)
m4/ax_memcached.m4 (+10/-21)
m4/hiredis.m4 (+26/-34)
tests/libmemcached-1.0/plus.cpp (+7/-0)
tests/memcat.cc (+7/-5)
tests/memcp.cc (+4/-0)
tests/memdump.cc (+3/-2)
tests/memexist.cc (+8/-8)
tests/memping.cc (+2/-2)
tests/memrm.cc (+3/-1)
tests/memtouch.cc (+7/-7)
Text conflict in bootstrap.sh
Text conflict in libtest/cpu.cc
Text conflict in libtest/main.cc
Text conflict in m4/ax_harden_compiler_flags.m4
To merge this branch: bzr merge lp:~brianaker/libmemcached/1220444
Reviewer Review Type Date Requested Status
Tangent Trunk Pending
Review via email: mp+190539@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2=== modified file 'bootstrap.sh'
3--- bootstrap.sh 2013-06-13 22:13:53 +0000
4+++ bootstrap.sh 2013-10-11 06:45:05 +0000
5@@ -421,7 +421,11 @@
6 # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
7 case $HOST_OS in
8 *-darwin-*)
9+<<<<<<< TREE
10 run CC=clang CXX=clang++ $top_srcdir/configure "$BUILD_CONFIGURE_ARG" || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG"
11+=======
12+ run CC=clang CXX=clang++ $CONFIGURE "$BUILD_CONFIGURE_ARG" || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG"
13+>>>>>>> MERGE-SOURCE
14 ret=$?
15 ;;
16 rhel-5*)
17@@ -793,18 +797,14 @@
18
19 CC=clang CXX=clang++
20 export CC CXX
21+ CONFIGURE='scan-build ./configure'
22 CONFIGURE_ARGS='--enable-debug'
23
24- make_skeleton
25- ret=$?
26-
27- make_target 'clean' 'warn'
28+ run_configure
29
30 scan-build -o clang-html make -j4 -k
31
32 restore_BUILD
33-
34- return $ret
35 }
36
37 # If we are locally testing, we should make sure the environment is setup correctly
38@@ -1010,6 +1010,9 @@
39 {
40 if command_exists 'rpmbuild'; then
41 if [ -f 'rpm.am' -o -d 'rpm' ]; then
42+ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
43+ mkdir -p ~/rpmbuild/RPMS/{i386,i486,i586,i686,noarch,athlon}
44+
45 run_configure_if_required
46 make_target 'rpm'
47
48@@ -1507,6 +1510,9 @@
49
50 execute_job ()
51 {
52+ # We should always have a target by this point
53+ assert MAKE_TARGET
54+
55 determine_target_platform
56
57 determine_vcs
58@@ -1518,11 +1524,15 @@
59 return 1
60 fi
61
62+<<<<<<< TREE
63 if [ -z "$MAKE_TARGET" ]; then
64 MAKE_TARGET="make_default"
65 fi
66
67 if $print_setup_opt -o $debug; then
68+=======
69+ if $print_setup_opt -o $debug; then
70+>>>>>>> MERGE-SOURCE
71 echo
72 print_setup
73 echo
74@@ -1541,15 +1551,21 @@
75 PREFIX_ARG="--prefix=$PREFIX"
76 fi
77
78- # We should always have a target by this point
79- assert MAKE_TARGET
80-
81- if $CLEAN_OPTION; then
82- make_maintainer_clean
83- fi
84-
85- local MAKE_TARGET_ARRAY
86- MAKE_TARGET_ARRAY=( $MAKE_TARGET )
87+ if $CLEAN_OPTION; then
88+ make_maintainer_clean
89+ fi
90+
91+<<<<<<< TREE
92+ if $CLEAN_OPTION; then
93+ make_maintainer_clean
94+ fi
95+
96+ local MAKE_TARGET_ARRAY
97+ MAKE_TARGET_ARRAY=( $MAKE_TARGET )
98+=======
99+ local MAKE_TARGET_ARRAY
100+ MAKE_TARGET_ARRAY=( $MAKE_TARGET )
101+>>>>>>> MERGE-SOURCE
102
103 for target in "${MAKE_TARGET_ARRAY[@]}"
104 do
105@@ -1762,8 +1778,20 @@
106 fi
107 fi
108
109- execute_job
110- local ret=$?
111+<<<<<<< TREE
112+ execute_job
113+ local ret=$?
114+=======
115+ if [ -z "$MAKE_TARGET" ]; then
116+ MAKE_TARGET="make_default"
117+ fi
118+
119+ # We should always have a target by this point
120+ assert MAKE_TARGET
121+
122+ execute_job
123+ local ret=$?
124+>>>>>>> MERGE-SOURCE
125
126 jobs -l
127 wait
128
129=== modified file 'clients/generator.cc'
130--- clients/generator.cc 2013-01-08 01:03:28 +0000
131+++ clients/generator.cc 2013-10-11 06:45:05 +0000
132@@ -22,6 +22,8 @@
133
134 #include "clients/generator.h"
135
136+#define KEY_BYTES 20
137+
138 /* Use this for string generation */
139 static const char ALPHANUMERICS[]=
140 "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz";
141@@ -75,13 +77,13 @@
142
143 for (uint64_t x= 0; x < number_of; x++)
144 {
145- pairs[x].key= (char *)calloc(100, sizeof(char));
146+ pairs[x].key= (char *)calloc(KEY_BYTES, sizeof(char));
147
148 if (pairs[x].key == NULL)
149 goto error;
150
151- get_random_string(pairs[x].key, 100);
152- pairs[x].key_length= 100;
153+ get_random_string(pairs[x].key, KEY_BYTES);
154+ pairs[x].key_length= KEY_BYTES;
155
156 if (value_length)
157 {
158
159=== modified file 'clients/memcp.cc'
160--- clients/memcp.cc 2013-06-11 12:31:47 +0000
161+++ clients/memcp.cc 2013-10-11 06:45:05 +0000
162@@ -1,5 +1,5 @@
163 /* LibMemcached
164- * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
165+ * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/
166 * Copyright (C) 2006-2009 Brian Aker
167 * All rights reserved.
168 *
169
170=== modified file 'clients/memslap.cc'
171--- clients/memslap.cc 2013-04-03 13:14:23 +0000
172+++ clients/memslap.cc 2013-10-11 06:45:05 +0000
173@@ -66,6 +66,8 @@
174 #define DEFAULT_EXECUTE_NUMBER 10000
175 #define DEFAULT_CONCURRENCY 1
176
177+#define VALUE_BYTES 4096
178+
179 #define PROGRAM_NAME "memslap"
180 #define PROGRAM_DESCRIPTION "Generates a load against a memcached custer of servers."
181
182@@ -336,7 +338,7 @@
183
184 if (opt_test == SET_TEST)
185 {
186- context->execute_pairs= pairs_generate(opt_execute_number, 400);
187+ context->execute_pairs= pairs_generate(opt_execute_number, VALUE_BYTES);
188 context->execute_number= opt_execute_number;
189 }
190
191@@ -432,7 +434,7 @@
192 break;
193
194 case OPT_DEBUG: /* --debug or -d */
195- opt_verbose = OPT_DEBUG;
196+ opt_verbose= OPT_DEBUG;
197 break;
198
199 case OPT_VERSION: /* --version or -V */
200@@ -566,7 +568,7 @@
201 /* We always used non-blocking IO for load since it is faster */
202 memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_NO_BLOCK, 0);
203
204- pairs_st *pairs= pairs_generate(number_of, 400);
205+ pairs_st *pairs= pairs_generate(number_of, VALUE_BYTES);
206 *actual_loaded= execute_set(memc_clone, pairs, number_of);
207
208 memcached_free(memc_clone);
209
210=== modified file 'libmemcached/io.cc'
211--- libmemcached/io.cc 2013-03-31 23:24:29 +0000
212+++ libmemcached/io.cc 2013-10-11 06:45:05 +0000
213@@ -99,7 +99,7 @@
214 case EWOULDBLOCK:
215 #endif
216 case EAGAIN:
217-#ifdef TARGET_OS_LINUX
218+#ifdef __linux
219 case ERESTART:
220 #endif
221 break; // No IO is fine, we can just move on
222@@ -265,7 +265,7 @@
223 assert_msg(active_fd == -1 , "poll() returned an unexpected value");
224 switch (local_errno)
225 {
226-#ifdef TARGET_OS_LINUX
227+#ifdef __linux
228 case ERESTART:
229 #endif
230 case EINTR:
231@@ -430,7 +430,7 @@
232 case EWOULDBLOCK:
233 #endif
234 case EAGAIN:
235-#ifdef TARGET_OS_LINUX
236+#ifdef __linux
237 case ERESTART:
238 #endif
239 {
240@@ -568,7 +568,7 @@
241 case EWOULDBLOCK:
242 #endif
243 case EAGAIN:
244-#ifdef TARGET_OS_LINUX
245+#ifdef __linux
246 case ERESTART:
247 #endif
248 if (memcached_success(io_wait(instance, MEM_READ)))
249
250=== modified file 'libmemcached/string.cc'
251--- libmemcached/string.cc 2013-01-23 21:28:45 +0000
252+++ libmemcached/string.cc 2013-10-11 06:45:05 +0000
253@@ -281,18 +281,20 @@
254 {
255 char* value= NULL;
256
257- if (memcached_string_length(self))
258+ assert_msg(self, "Invalid memcached_string_st");
259+ if (self)
260 {
261- assert_msg(self, "Invalid memcached_string_st");
262- // If we fail at adding the null, we copy and move on
263- if (memcached_success(memcached_string_append_null(self)))
264+ if (memcached_string_length(self))
265 {
266- return memcached_string_c_copy(self);
267+ // If we fail at adding the null, we copy and move on
268+ if (memcached_failed(memcached_string_append_null(self)))
269+ {
270+ return NULL;
271+ }
272+
273+ value= self->string;
274+ _init_string(self);
275 }
276-
277- value= self->string;
278-
279- _init_string(self);
280 }
281
282 return value;
283
284=== modified file 'libtest/cmdline.cc'
285--- libtest/cmdline.cc 2013-06-12 07:11:22 +0000
286+++ libtest/cmdline.cc 2013-10-11 06:45:05 +0000
287@@ -359,7 +359,7 @@
288 int error;
289 switch ((error= errno))
290 {
291-#ifdef TARGET_OS_LINUX
292+#ifdef __linux
293 case ERESTART:
294 #endif
295 case EINTR:
296
297=== modified file 'libtest/core.cc'
298--- libtest/core.cc 2012-12-09 11:40:11 +0000
299+++ libtest/core.cc 2013-10-11 06:45:05 +0000
300@@ -42,8 +42,8 @@
301
302 void create_core(void)
303 {
304-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
305- if (TARGET_OS_OSX)
306+#if defined(__APPLE__) && __APPLE__
307+ if (__APPLE__)
308 {
309 return;
310 }
311
312=== modified file 'libtest/cpu.cc'
313--- libtest/cpu.cc 2013-06-12 07:11:22 +0000
314+++ libtest/cpu.cc 2013-10-11 06:45:05 +0000
315@@ -52,8 +52,13 @@
316
317 uint32_t number_of_cpus()
318 {
319+<<<<<<< TREE
320 uint32_t number_of_cpu= 1;
321 #ifdef linux
322+=======
323+ size_t number_of_cpu= 1;
324+#if defined(__linux) && __linux
325+>>>>>>> MERGE-SOURCE
326 number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN);
327 #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU)
328 int mib[4];
329
330=== modified file 'libtest/main.cc'
331--- libtest/main.cc 2013-06-12 07:11:22 +0000
332+++ libtest/main.cc 2013-10-11 06:45:05 +0000
333@@ -2,7 +2,7 @@
334 *
335 * Data Differential YATL (i.e. libtest) library
336 *
337- * Copyright (C) 2012 Data Differential, http://datadifferential.com/
338+ * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
339 *
340 * Redistribution and use in source and binary forms, with or without
341 * modification, are permitted provided that the following conditions are
342@@ -45,6 +45,13 @@
343 #include <fnmatch.h>
344 #include <fstream>
345 #include <iostream>
346+<<<<<<< TREE
347+=======
348+#ifdef HAVE_STRINGS_H
349+# include <strings.h>
350+#endif
351+#include <fstream>
352+>>>>>>> MERGE-SOURCE
353 #include <memory>
354 #include <sys/stat.h>
355 #include <sys/time.h>
356@@ -113,7 +120,7 @@
357 Valgrind does not currently work reliably, or sometimes at all, on OSX
358 - Fri Jun 15 11:24:07 EDT 2012
359 */
360-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
361+#if defined(__APPLE__) && __APPLE__
362 if (valgrind_is_caller())
363 {
364 return EXIT_SKIP;
365
366=== modified file 'libtest/unittest.cc'
367--- libtest/unittest.cc 2013-06-12 07:11:22 +0000
368+++ libtest/unittest.cc 2013-10-11 06:45:05 +0000
369@@ -657,7 +657,7 @@
370 const char *args[]= { "--fubar", 0 };
371 #if defined(__APPLE__) && __APPLE__
372 ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args));
373-#elif defined(TARGET_OS_FREEBSD) && TARGET_OS_FREEBSD
374+#elif defined(__FreeBSD__) && __FreeBSD__
375 ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args));
376 #else
377 ASSERT_EQ(Application::SUCCESS, true_app.run(args));
378@@ -855,8 +855,8 @@
379 static test_return_t gdb_wait_services_appliction_TEST(void *)
380 {
381 test_skip(true, false);
382-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
383- test_skip(0, TARGET_OS_OSX);
384+#if defined(__APPLE__) && __APPLE__
385+ test_skip(0, __APPLE__);
386 #endif
387
388 test_skip(0, access("/etc/services", R_OK ));
389@@ -879,8 +879,8 @@
390 test_skip(0, access("libtest/abort", X_OK ));
391 test_skip(true, false);
392
393-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
394- test_skip(0, TARGET_OS_OSX);
395+#if defined(__APPLE__) && __APPLE__
396+ test_skip(0, __APPLE__);
397 #endif
398
399 libtest::Application abort_app("libtest/abort", true);
400
401=== modified file 'm4/ax_debug.m4'
402--- m4/ax_debug.m4 2013-01-08 01:03:28 +0000
403+++ m4/ax_debug.m4 2013-10-11 06:45:05 +0000
404@@ -43,7 +43,7 @@
405 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
406 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
407
408-#serial 5
409+#serial 6
410
411 AC_DEFUN([AX_DEBUG],
412 [AC_PREREQ([2.63])dnl
413@@ -52,7 +52,9 @@
414 [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
415 [ax_enable_debug=yes
416 AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])
417- AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])])],
418+ AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])])
419+ AX_ADD_AM_MACRO([--debug],[AM_YFLAGS])
420+ AX_ADD_AM_MACRO([-D_GLIBCXX_DEBUG],[AM_CPPFLAGS])],
421 [ax_enable_debug=no
422 AC_SUBST([MCHECK])
423 AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])
424
425=== modified file 'm4/ax_harden_compiler_flags.m4'
426--- m4/ax_harden_compiler_flags.m4 2013-10-01 23:52:41 +0000
427+++ m4/ax_harden_compiler_flags.m4 2013-10-11 06:45:05 +0000
428@@ -53,6 +53,7 @@
429 # -Wdeclaration-after-statement is counter to C99
430 # _APPEND_COMPILE_FLAGS_ERROR([-pedantic])
431
432+<<<<<<< TREE
433 #serial 12
434
435 AC_DEFUN([_SET_SANITIZE_FLAGS],
436@@ -86,6 +87,41 @@
437 ])
438 ])
439 ])
440+=======
441+#serial 13
442+
443+AC_DEFUN([_SET_SANITIZE_FLAGS],
444+ [AS_IF([test "x$MINGW" != xyes],[
445+ AS_IF([test "x$enable_shared" = "xyes"],
446+ [AS_CASE([$ax_harden_sanitize],
447+ [thread],[
448+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])],
449+ [address],[
450+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])],
451+ [rest],[
452+ _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
453+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
454+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
455+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
456+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
457+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
458+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
459+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
460+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
461+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
462+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
463+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
464+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
465+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
466+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
467+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
468+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
469+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
470+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])])
471+ ])
472+ ])
473+ ])
474+>>>>>>> MERGE-SOURCE
475
476 AC_DEFUN([_WARNINGS_AS_ERRORS],
477 [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],
478
479=== modified file 'm4/ax_memcached.m4'
480--- m4/ax_memcached.m4 2013-04-29 15:24:05 +0000
481+++ m4/ax_memcached.m4 2013-10-11 06:45:05 +0000
482@@ -44,26 +44,15 @@
483 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
484 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
485
486-#serial 4
487+#serial 3
488
489 AC_DEFUN([AX_PROG_MEMCACHED],
490- [AX_WITH_PROG([MEMCACHED_BINARY],[memcached],[unknown])
491- ax_memcached_success=
492- AS_IF([test x"$MEMCACHED_BINARY" != xunknown],
493- [AS_IF([test -x "$MEMCACHED_BINARY"],
494- [ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
495- AS_IF([test -n "$ax_memcached_version"],
496- [ax_memcached_success='ok'
497- AC_MSG_RESULT([memcached version "$ax_memcached_version"])
498- AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])])
499- ])
500- ])
501-
502- AS_IF([test -n "$ax_memcached_success"],
503- [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
504- AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$MEMCACHED_BINARY",[Name of the memcached binary used in make test])
505- ],
506- [AC_DEFINE([HAVE_MEMCACHED_BINARY], [0], [If Memcached binary is available])
507- MEMCACHED_BINARY=
508- ])
509- ])
510+ [AX_WITH_PROG([MEMCACHED_BINARY],[memcached])
511+ AS_IF([test -f "$ac_cv_path_MEMCACHED_BINARY"],
512+ [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
513+ AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$ac_cv_path_MEMCACHED_BINARY",[Name of the memcached binary used in make test])
514+ ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
515+ AC_MSG_RESULT([memcached version "$ax_memcached_version"])
516+ AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])
517+ ])
518+ ])
519
520=== modified file 'm4/hiredis.m4'
521--- m4/hiredis.m4 2012-09-05 05:20:56 +0000
522+++ m4/hiredis.m4 2013-10-11 06:45:05 +0000
523@@ -1,34 +1,26 @@
524-dnl Copyright (C) 2011 Brian Aker (brian@tangent.org)
525-
526-AC_DEFUN([_SEARCH_LIBHIREDIS],[
527- AC_REQUIRE([AX_CHECK_LIBRARY])
528-
529- AS_IF([test "x$ac_enable_hires" = "xyes"],[
530- AX_CHECK_LIBRARY([LIBHIREDIS], [hiredis/hiredis.h], [hiredis],
531- [
532- LIBHIREDIS_LDFLAGS="-lhiredis"
533- AC_DEFINE([HAVE_HIREDIS], [1], [If Hiredis available])
534- ],
535- [
536- AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available])
537- ac_enable_hires="no"
538- ])
539-
540- ],
541- [
542- AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available])
543- ])
544-
545- AM_CONDITIONAL(HAVE_HIREDIS, [test "x$ac_cv_lib_hiredis_main" = "xyes"])
546- ])
547-
548-AC_DEFUN([AX_HAVE_LIBHIREDIS],[
549-
550- AC_ARG_ENABLE([hires],
551- [AS_HELP_STRING([--disable-hires],
552- [Build with hires support @<:@default=on@:>@])],
553- [ac_enable_hires="$enableval"],
554- [ac_enable_hires="yes"])
555-
556- _SEARCH_LIBHIREDIS
557-])
558+# Copyright (C) 2011 Brian Aker (brian@tangent.org)
559+#
560+# serial 2
561+
562+AC_DEFUN([_SEARCH_HIREDIS],
563+ [AC_REQUIRE([AX_CHECK_LIBRARY])
564+
565+ AS_IF([test "x$ac_enable_hiredis" = "xyes"],
566+ [hiredis_header="hiredis/hiredis.h"],
567+ [hiredis_header="does_not_exist"])
568+
569+ AX_CHECK_LIBRARY([HIREDIS],[$hiredis_header],[hiredis],,
570+ [AC_DEFINE([HAVE_HIREDIS],[0],[Define to 1 if HIREDIS is found])])
571+
572+ AS_IF([test "x$ax_cv_have_HIREDIS" = xno],[ac_enable_hiredis="no"])
573+ ])
574+
575+ AC_DEFUN([AX_ENABLE_LIBHIREDIS],
576+ [AC_ARG_ENABLE([hiredis],
577+ [AS_HELP_STRING([--disable-hiredis],
578+ [Build with hiredis support @<:@default=on@:>@])],
579+ [ac_enable_hiredis="$enableval"],
580+ [ac_enable_hiredis="yes"])
581+
582+ _SEARCH_HIREDIS
583+ ])
584
585=== modified file 'tests/libmemcached-1.0/plus.cpp'
586--- tests/libmemcached-1.0/plus.cpp 2013-04-03 13:14:23 +0000
587+++ tests/libmemcached-1.0/plus.cpp 2013-10-11 06:45:05 +0000
588@@ -181,6 +181,13 @@
589 vector<char> return_value;
590
591 /* We need to empty the server before we continue the test */
592+ bool flush_res= memc.flush();
593+ if (flush_res == false)
594+ {
595+ std::string error_string;
596+ ASSERT_TRUE(memc.error(error_string));
597+ Error << error_string;
598+ }
599 test_true(memc.flush());
600
601 test_true(memc.mget(keys));
602
603=== modified file 'tests/memcat.cc'
604--- tests/memcat.cc 2013-01-28 22:51:05 +0000
605+++ tests/memcat.cc 2013-10-11 06:45:05 +0000
606@@ -64,10 +64,10 @@
607 static test_return_t cat_test(void *)
608 {
609 char buffer[1024];
610- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
611+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
612 const char *args[]= { buffer, "foo", 0 };
613
614- memcached_st *memc= memcached(buffer, strlen(buffer));
615+ memcached_st *memc= memcached(buffer, length);
616 test_true(memc);
617
618 test_compare(MEMCACHED_SUCCESS,
619@@ -77,6 +77,7 @@
620 test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
621 test_compare(MEMCACHED_SUCCESS, rc);
622
623+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
624 test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
625
626 test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
627@@ -90,11 +91,11 @@
628 static test_return_t NOT_FOUND_test(void *)
629 {
630 char buffer[1024];
631- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
632+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
633 const char *args[]= { buffer, "foo", 0 };
634
635- memcached_st *memc= memcached(buffer, strlen(buffer));
636- test_true(memc);
637+ memcached_st *memc= memcached(buffer, length);
638+ ASSERT_TRUE(memc);
639
640 test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0));
641
642@@ -102,6 +103,7 @@
643 test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
644 test_compare(MEMCACHED_NOTFOUND, rc);
645
646+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
647 test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
648
649 test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
650
651=== modified file 'tests/memcp.cc'
652--- tests/memcp.cc 2013-06-12 07:11:22 +0000
653+++ tests/memcp.cc 2013-10-11 06:45:05 +0000
654@@ -63,6 +63,7 @@
655 return TEST_SUCCESS;
656 }
657
658+#if 0
659 static test_return_t server_test(void *)
660 {
661 int fd;
662@@ -82,10 +83,13 @@
663
664 return TEST_SUCCESS;
665 }
666+#endif
667
668 test_st memcp_tests[] ={
669 {"--help", true, help_test },
670+#if 0
671 {"--server_test", true, server_test },
672+#endif
673 {0, 0, 0}
674 };
675
676
677=== modified file 'tests/memdump.cc'
678--- tests/memdump.cc 2013-01-28 22:51:05 +0000
679+++ tests/memdump.cc 2013-10-11 06:45:05 +0000
680@@ -75,10 +75,10 @@
681 static test_return_t FOUND_test(void *)
682 {
683 char buffer[1024];
684- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
685+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
686 const char *args[]= { buffer, 0 };
687
688- memcached_st *memc= memcached(buffer, strlen(buffer));
689+ memcached_st *memc= memcached(buffer, length);
690 test_true(memc);
691
692 test_compare(MEMCACHED_SUCCESS,
693@@ -91,6 +91,7 @@
694 test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
695 test_compare(MEMCACHED_SUCCESS, rc);
696
697+ length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
698 test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE);
699
700 memcached_free(memc);
701
702=== modified file 'tests/memexist.cc'
703--- tests/memexist.cc 2013-01-28 22:51:05 +0000
704+++ tests/memexist.cc 2013-10-11 06:45:05 +0000
705@@ -64,10 +64,10 @@
706 static test_return_t exist_test(void *)
707 {
708 char buffer[1024];
709- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
710+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
711 const char *args[]= { buffer, "foo", 0 };
712
713- memcached_st *memc= memcached(buffer, strlen(buffer));
714+ memcached_st *memc= memcached(buffer, length);
715 test_true(memc);
716
717 test_compare(MEMCACHED_SUCCESS,
718@@ -90,11 +90,11 @@
719 static test_return_t NOT_FOUND_test(void *)
720 {
721 char buffer[1024];
722- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
723+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
724 const char *args[]= { buffer, "foo", 0 };
725
726- memcached_st *memc= memcached(buffer, strlen(buffer));
727- test_true(memc);
728+ memcached_st *memc= memcached(buffer, length);
729+ ASSERT_TRUE(memc);
730
731 test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0));
732
733@@ -115,9 +115,9 @@
734 static test_return_t check_version(void*)
735 {
736 char buffer[1024];
737- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
738- memcached_st *memc= memcached(buffer, strlen(buffer));
739- test_true(memc);
740+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
741+ memcached_st *memc= memcached(buffer, length);
742+ ASSERT_TRUE(memc);
743
744 test_return_t result= TEST_SUCCESS;
745 if (libmemcached_util_version_check(memc, 1, 4, 8) == false)
746
747=== modified file 'tests/memping.cc'
748--- tests/memping.cc 2013-04-03 13:14:23 +0000
749+++ tests/memping.cc 2013-10-11 06:45:05 +0000
750@@ -64,7 +64,7 @@
751 static test_return_t ping_TEST(void *)
752 {
753 char buffer[1024];
754- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
755+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
756 const char *args[]= { buffer, 0 };
757
758 test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
759@@ -75,7 +75,7 @@
760 static test_return_t NOT_FOUND_TEST(void *)
761 {
762 char buffer[1024];
763- snprintf(buffer, sizeof(buffer), "--server=nonexist.libmemcached.org:%d", int(default_port()));
764+ snprintf(buffer, sizeof(buffer), "--servers=nonexist.libmemcached.org:%d", int(default_port()));
765 const char *args[]= { buffer, 0 };
766
767 test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
768
769=== modified file 'tests/memrm.cc'
770--- tests/memrm.cc 2013-01-28 22:51:05 +0000
771+++ tests/memrm.cc 2013-10-11 06:45:05 +0000
772@@ -84,6 +84,8 @@
773 test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc));
774 test_compare(MEMCACHED_SUCCESS, rc);
775
776+ char memrm_buffer[1024];
777+ snprintf(memrm_buffer, sizeof(memrm_buffer), "--servers=localhost:%d", int(default_port()));
778 const char *args[]= { buffer, "foo", 0 };
779 test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
780
781@@ -121,7 +123,7 @@
782 static test_return_t multiple_NOT_FOUND_TEST(void *)
783 {
784 char buffer[1024];
785- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
786+ snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
787 const char *args[]= { buffer, "protocols", "foo", "mine", "bar", "dog", "cat", "foo", "mine",
788 "eye", "for", "the", "to", "not", "know", "what", "I", "should", "be", "doing", 0 };
789
790
791=== modified file 'tests/memtouch.cc'
792--- tests/memtouch.cc 2013-01-28 22:51:05 +0000
793+++ tests/memtouch.cc 2013-10-11 06:45:05 +0000
794@@ -65,9 +65,9 @@
795 static test_return_t touch_test(void *)
796 {
797 char buffer[1024];
798- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
799+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
800
801- memcached_st *memc= memcached(buffer, strlen(buffer));
802+ memcached_st *memc= memcached(buffer, length);
803 test_true(memc);
804
805 test_compare(MEMCACHED_SUCCESS,
806@@ -89,15 +89,15 @@
807 static test_return_t NOT_FOUND_test(void *)
808 {
809 char buffer[1024];
810- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
811- memcached_st *memc= memcached(buffer, strlen(buffer));
812+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
813+ memcached_st *memc= memcached(buffer, length);
814 test_true(memc);
815
816 test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0));
817
818 test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo")));
819
820- snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
821+ length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port()));
822 const char *args[]= { "--expire=30", buffer, "foo", 0 };
823 test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true));
824
825@@ -111,8 +111,8 @@
826 static test_return_t check_version(void*)
827 {
828 char buffer[1024];
829- snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
830- memcached_st *memc= memcached(buffer, strlen(buffer));
831+ int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port()));
832+ memcached_st *memc= memcached(buffer, length);
833 test_true(memc);
834
835 test_return_t result= TEST_SUCCESS;

Subscribers

People subscribed via source and target branches

to all changes: