Merge lp:~brianaker/libmemcached/1224951 into lp:libmemcached
- 1224951
- Merge into 1.2
Proposed by
Brian Aker
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1109 | ||||
Proposed branch: | lp:~brianaker/libmemcached/1224951 | ||||
Merge into: | lp:libmemcached | ||||
Diff against target: |
765 lines (+200/-123) (has conflicts) 21 files modified
bootstrap.sh (+45/-17) clients/memcp.cc (+1/-1) 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/1224951 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tangent Trunk | Pending | ||
Review via email: mp+190540@code.launchpad.net |
Commit message
Description of the change
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:13 +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/memcp.cc' |
130 | --- clients/memcp.cc 2013-06-11 12:31:47 +0000 |
131 | +++ clients/memcp.cc 2013-10-11 06:45:13 +0000 |
132 | @@ -1,5 +1,5 @@ |
133 | /* LibMemcached |
134 | - * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ |
135 | + * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/ |
136 | * Copyright (C) 2006-2009 Brian Aker |
137 | * All rights reserved. |
138 | * |
139 | |
140 | === modified file 'libmemcached/io.cc' |
141 | --- libmemcached/io.cc 2013-03-31 23:24:29 +0000 |
142 | +++ libmemcached/io.cc 2013-10-11 06:45:13 +0000 |
143 | @@ -99,7 +99,7 @@ |
144 | case EWOULDBLOCK: |
145 | #endif |
146 | case EAGAIN: |
147 | -#ifdef TARGET_OS_LINUX |
148 | +#ifdef __linux |
149 | case ERESTART: |
150 | #endif |
151 | break; // No IO is fine, we can just move on |
152 | @@ -265,7 +265,7 @@ |
153 | assert_msg(active_fd == -1 , "poll() returned an unexpected value"); |
154 | switch (local_errno) |
155 | { |
156 | -#ifdef TARGET_OS_LINUX |
157 | +#ifdef __linux |
158 | case ERESTART: |
159 | #endif |
160 | case EINTR: |
161 | @@ -430,7 +430,7 @@ |
162 | case EWOULDBLOCK: |
163 | #endif |
164 | case EAGAIN: |
165 | -#ifdef TARGET_OS_LINUX |
166 | +#ifdef __linux |
167 | case ERESTART: |
168 | #endif |
169 | { |
170 | @@ -568,7 +568,7 @@ |
171 | case EWOULDBLOCK: |
172 | #endif |
173 | case EAGAIN: |
174 | -#ifdef TARGET_OS_LINUX |
175 | +#ifdef __linux |
176 | case ERESTART: |
177 | #endif |
178 | if (memcached_success(io_wait(instance, MEM_READ))) |
179 | |
180 | === modified file 'libmemcached/string.cc' |
181 | --- libmemcached/string.cc 2013-01-23 21:28:45 +0000 |
182 | +++ libmemcached/string.cc 2013-10-11 06:45:13 +0000 |
183 | @@ -281,18 +281,20 @@ |
184 | { |
185 | char* value= NULL; |
186 | |
187 | - if (memcached_string_length(self)) |
188 | + assert_msg(self, "Invalid memcached_string_st"); |
189 | + if (self) |
190 | { |
191 | - assert_msg(self, "Invalid memcached_string_st"); |
192 | - // If we fail at adding the null, we copy and move on |
193 | - if (memcached_success(memcached_string_append_null(self))) |
194 | + if (memcached_string_length(self)) |
195 | { |
196 | - return memcached_string_c_copy(self); |
197 | + // If we fail at adding the null, we copy and move on |
198 | + if (memcached_failed(memcached_string_append_null(self))) |
199 | + { |
200 | + return NULL; |
201 | + } |
202 | + |
203 | + value= self->string; |
204 | + _init_string(self); |
205 | } |
206 | - |
207 | - value= self->string; |
208 | - |
209 | - _init_string(self); |
210 | } |
211 | |
212 | return value; |
213 | |
214 | === modified file 'libtest/cmdline.cc' |
215 | --- libtest/cmdline.cc 2013-06-12 07:11:22 +0000 |
216 | +++ libtest/cmdline.cc 2013-10-11 06:45:13 +0000 |
217 | @@ -359,7 +359,7 @@ |
218 | int error; |
219 | switch ((error= errno)) |
220 | { |
221 | -#ifdef TARGET_OS_LINUX |
222 | +#ifdef __linux |
223 | case ERESTART: |
224 | #endif |
225 | case EINTR: |
226 | |
227 | === modified file 'libtest/core.cc' |
228 | --- libtest/core.cc 2012-12-09 11:40:11 +0000 |
229 | +++ libtest/core.cc 2013-10-11 06:45:13 +0000 |
230 | @@ -42,8 +42,8 @@ |
231 | |
232 | void create_core(void) |
233 | { |
234 | -#if defined(TARGET_OS_OSX) && TARGET_OS_OSX |
235 | - if (TARGET_OS_OSX) |
236 | +#if defined(__APPLE__) && __APPLE__ |
237 | + if (__APPLE__) |
238 | { |
239 | return; |
240 | } |
241 | |
242 | === modified file 'libtest/cpu.cc' |
243 | --- libtest/cpu.cc 2013-06-12 07:11:22 +0000 |
244 | +++ libtest/cpu.cc 2013-10-11 06:45:13 +0000 |
245 | @@ -52,8 +52,13 @@ |
246 | |
247 | uint32_t number_of_cpus() |
248 | { |
249 | +<<<<<<< TREE |
250 | uint32_t number_of_cpu= 1; |
251 | #ifdef linux |
252 | +======= |
253 | + size_t number_of_cpu= 1; |
254 | +#if defined(__linux) && __linux |
255 | +>>>>>>> MERGE-SOURCE |
256 | number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN); |
257 | #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU) |
258 | int mib[4]; |
259 | |
260 | === modified file 'libtest/main.cc' |
261 | --- libtest/main.cc 2013-06-12 07:11:22 +0000 |
262 | +++ libtest/main.cc 2013-10-11 06:45:13 +0000 |
263 | @@ -2,7 +2,7 @@ |
264 | * |
265 | * Data Differential YATL (i.e. libtest) library |
266 | * |
267 | - * Copyright (C) 2012 Data Differential, http://datadifferential.com/ |
268 | + * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/ |
269 | * |
270 | * Redistribution and use in source and binary forms, with or without |
271 | * modification, are permitted provided that the following conditions are |
272 | @@ -45,6 +45,13 @@ |
273 | #include <fnmatch.h> |
274 | #include <fstream> |
275 | #include <iostream> |
276 | +<<<<<<< TREE |
277 | +======= |
278 | +#ifdef HAVE_STRINGS_H |
279 | +# include <strings.h> |
280 | +#endif |
281 | +#include <fstream> |
282 | +>>>>>>> MERGE-SOURCE |
283 | #include <memory> |
284 | #include <sys/stat.h> |
285 | #include <sys/time.h> |
286 | @@ -113,7 +120,7 @@ |
287 | Valgrind does not currently work reliably, or sometimes at all, on OSX |
288 | - Fri Jun 15 11:24:07 EDT 2012 |
289 | */ |
290 | -#if defined(TARGET_OS_OSX) && TARGET_OS_OSX |
291 | +#if defined(__APPLE__) && __APPLE__ |
292 | if (valgrind_is_caller()) |
293 | { |
294 | return EXIT_SKIP; |
295 | |
296 | === modified file 'libtest/unittest.cc' |
297 | --- libtest/unittest.cc 2013-06-12 07:11:22 +0000 |
298 | +++ libtest/unittest.cc 2013-10-11 06:45:13 +0000 |
299 | @@ -657,7 +657,7 @@ |
300 | const char *args[]= { "--fubar", 0 }; |
301 | #if defined(__APPLE__) && __APPLE__ |
302 | ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); |
303 | -#elif defined(TARGET_OS_FREEBSD) && TARGET_OS_FREEBSD |
304 | +#elif defined(__FreeBSD__) && __FreeBSD__ |
305 | ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); |
306 | #else |
307 | ASSERT_EQ(Application::SUCCESS, true_app.run(args)); |
308 | @@ -855,8 +855,8 @@ |
309 | static test_return_t gdb_wait_services_appliction_TEST(void *) |
310 | { |
311 | test_skip(true, false); |
312 | -#if defined(TARGET_OS_OSX) && TARGET_OS_OSX |
313 | - test_skip(0, TARGET_OS_OSX); |
314 | +#if defined(__APPLE__) && __APPLE__ |
315 | + test_skip(0, __APPLE__); |
316 | #endif |
317 | |
318 | test_skip(0, access("/etc/services", R_OK )); |
319 | @@ -879,8 +879,8 @@ |
320 | test_skip(0, access("libtest/abort", X_OK )); |
321 | test_skip(true, false); |
322 | |
323 | -#if defined(TARGET_OS_OSX) && TARGET_OS_OSX |
324 | - test_skip(0, TARGET_OS_OSX); |
325 | +#if defined(__APPLE__) && __APPLE__ |
326 | + test_skip(0, __APPLE__); |
327 | #endif |
328 | |
329 | libtest::Application abort_app("libtest/abort", true); |
330 | |
331 | === modified file 'm4/ax_debug.m4' |
332 | --- m4/ax_debug.m4 2013-01-08 01:03:28 +0000 |
333 | +++ m4/ax_debug.m4 2013-10-11 06:45:13 +0000 |
334 | @@ -43,7 +43,7 @@ |
335 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
336 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
337 | |
338 | -#serial 5 |
339 | +#serial 6 |
340 | |
341 | AC_DEFUN([AX_DEBUG], |
342 | [AC_PREREQ([2.63])dnl |
343 | @@ -52,7 +52,9 @@ |
344 | [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], |
345 | [ax_enable_debug=yes |
346 | AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.]) |
347 | - AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])])], |
348 | + AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])]) |
349 | + AX_ADD_AM_MACRO([--debug],[AM_YFLAGS]) |
350 | + AX_ADD_AM_MACRO([-D_GLIBCXX_DEBUG],[AM_CPPFLAGS])], |
351 | [ax_enable_debug=no |
352 | AC_SUBST([MCHECK]) |
353 | AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])]) |
354 | |
355 | === modified file 'm4/ax_harden_compiler_flags.m4' |
356 | --- m4/ax_harden_compiler_flags.m4 2013-10-01 23:52:41 +0000 |
357 | +++ m4/ax_harden_compiler_flags.m4 2013-10-11 06:45:13 +0000 |
358 | @@ -53,6 +53,7 @@ |
359 | # -Wdeclaration-after-statement is counter to C99 |
360 | # _APPEND_COMPILE_FLAGS_ERROR([-pedantic]) |
361 | |
362 | +<<<<<<< TREE |
363 | #serial 12 |
364 | |
365 | AC_DEFUN([_SET_SANITIZE_FLAGS], |
366 | @@ -86,6 +87,41 @@ |
367 | ]) |
368 | ]) |
369 | ]) |
370 | +======= |
371 | +#serial 13 |
372 | + |
373 | +AC_DEFUN([_SET_SANITIZE_FLAGS], |
374 | + [AS_IF([test "x$MINGW" != xyes],[ |
375 | + AS_IF([test "x$enable_shared" = "xyes"], |
376 | + [AS_CASE([$ax_harden_sanitize], |
377 | + [thread],[ |
378 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])], |
379 | + [address],[ |
380 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])], |
381 | + [rest],[ |
382 | + _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer]) |
383 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer]) |
384 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory]) |
385 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment]) |
386 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool]) |
387 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds]) |
388 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum]) |
389 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow]) |
390 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero]) |
391 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero]) |
392 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null]) |
393 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size]) |
394 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return]) |
395 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift]) |
396 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow]) |
397 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable]) |
398 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow]) |
399 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound]) |
400 | + _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])]) |
401 | + ]) |
402 | + ]) |
403 | + ]) |
404 | +>>>>>>> MERGE-SOURCE |
405 | |
406 | AC_DEFUN([_WARNINGS_AS_ERRORS], |
407 | [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors], |
408 | |
409 | === modified file 'm4/ax_memcached.m4' |
410 | --- m4/ax_memcached.m4 2013-04-29 15:24:05 +0000 |
411 | +++ m4/ax_memcached.m4 2013-10-11 06:45:13 +0000 |
412 | @@ -44,26 +44,15 @@ |
413 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
414 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
415 | |
416 | -#serial 4 |
417 | +#serial 3 |
418 | |
419 | AC_DEFUN([AX_PROG_MEMCACHED], |
420 | - [AX_WITH_PROG([MEMCACHED_BINARY],[memcached],[unknown]) |
421 | - ax_memcached_success= |
422 | - AS_IF([test x"$MEMCACHED_BINARY" != xunknown], |
423 | - [AS_IF([test -x "$MEMCACHED_BINARY"], |
424 | - [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}'` |
425 | - AS_IF([test -n "$ax_memcached_version"], |
426 | - [ax_memcached_success='ok' |
427 | - AC_MSG_RESULT([memcached version "$ax_memcached_version"]) |
428 | - AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])]) |
429 | - ]) |
430 | - ]) |
431 | - |
432 | - AS_IF([test -n "$ax_memcached_success"], |
433 | - [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available]) |
434 | - AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$MEMCACHED_BINARY",[Name of the memcached binary used in make test]) |
435 | - ], |
436 | - [AC_DEFINE([HAVE_MEMCACHED_BINARY], [0], [If Memcached binary is available]) |
437 | - MEMCACHED_BINARY= |
438 | - ]) |
439 | - ]) |
440 | + [AX_WITH_PROG([MEMCACHED_BINARY],[memcached]) |
441 | + AS_IF([test -f "$ac_cv_path_MEMCACHED_BINARY"], |
442 | + [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available]) |
443 | + AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$ac_cv_path_MEMCACHED_BINARY",[Name of the memcached binary used in make test]) |
444 | + 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}'` |
445 | + AC_MSG_RESULT([memcached version "$ax_memcached_version"]) |
446 | + AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version]) |
447 | + ]) |
448 | + ]) |
449 | |
450 | === modified file 'm4/hiredis.m4' |
451 | --- m4/hiredis.m4 2012-09-05 05:20:56 +0000 |
452 | +++ m4/hiredis.m4 2013-10-11 06:45:13 +0000 |
453 | @@ -1,34 +1,26 @@ |
454 | -dnl Copyright (C) 2011 Brian Aker (brian@tangent.org) |
455 | - |
456 | -AC_DEFUN([_SEARCH_LIBHIREDIS],[ |
457 | - AC_REQUIRE([AX_CHECK_LIBRARY]) |
458 | - |
459 | - AS_IF([test "x$ac_enable_hires" = "xyes"],[ |
460 | - AX_CHECK_LIBRARY([LIBHIREDIS], [hiredis/hiredis.h], [hiredis], |
461 | - [ |
462 | - LIBHIREDIS_LDFLAGS="-lhiredis" |
463 | - AC_DEFINE([HAVE_HIREDIS], [1], [If Hiredis available]) |
464 | - ], |
465 | - [ |
466 | - AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available]) |
467 | - ac_enable_hires="no" |
468 | - ]) |
469 | - |
470 | - ], |
471 | - [ |
472 | - AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available]) |
473 | - ]) |
474 | - |
475 | - AM_CONDITIONAL(HAVE_HIREDIS, [test "x$ac_cv_lib_hiredis_main" = "xyes"]) |
476 | - ]) |
477 | - |
478 | -AC_DEFUN([AX_HAVE_LIBHIREDIS],[ |
479 | - |
480 | - AC_ARG_ENABLE([hires], |
481 | - [AS_HELP_STRING([--disable-hires], |
482 | - [Build with hires support @<:@default=on@:>@])], |
483 | - [ac_enable_hires="$enableval"], |
484 | - [ac_enable_hires="yes"]) |
485 | - |
486 | - _SEARCH_LIBHIREDIS |
487 | -]) |
488 | +# Copyright (C) 2011 Brian Aker (brian@tangent.org) |
489 | +# |
490 | +# serial 2 |
491 | + |
492 | +AC_DEFUN([_SEARCH_HIREDIS], |
493 | + [AC_REQUIRE([AX_CHECK_LIBRARY]) |
494 | + |
495 | + AS_IF([test "x$ac_enable_hiredis" = "xyes"], |
496 | + [hiredis_header="hiredis/hiredis.h"], |
497 | + [hiredis_header="does_not_exist"]) |
498 | + |
499 | + AX_CHECK_LIBRARY([HIREDIS],[$hiredis_header],[hiredis],, |
500 | + [AC_DEFINE([HAVE_HIREDIS],[0],[Define to 1 if HIREDIS is found])]) |
501 | + |
502 | + AS_IF([test "x$ax_cv_have_HIREDIS" = xno],[ac_enable_hiredis="no"]) |
503 | + ]) |
504 | + |
505 | + AC_DEFUN([AX_ENABLE_LIBHIREDIS], |
506 | + [AC_ARG_ENABLE([hiredis], |
507 | + [AS_HELP_STRING([--disable-hiredis], |
508 | + [Build with hiredis support @<:@default=on@:>@])], |
509 | + [ac_enable_hiredis="$enableval"], |
510 | + [ac_enable_hiredis="yes"]) |
511 | + |
512 | + _SEARCH_HIREDIS |
513 | + ]) |
514 | |
515 | === modified file 'tests/libmemcached-1.0/plus.cpp' |
516 | --- tests/libmemcached-1.0/plus.cpp 2013-04-03 13:14:23 +0000 |
517 | +++ tests/libmemcached-1.0/plus.cpp 2013-10-11 06:45:13 +0000 |
518 | @@ -181,6 +181,13 @@ |
519 | vector<char> return_value; |
520 | |
521 | /* We need to empty the server before we continue the test */ |
522 | + bool flush_res= memc.flush(); |
523 | + if (flush_res == false) |
524 | + { |
525 | + std::string error_string; |
526 | + ASSERT_TRUE(memc.error(error_string)); |
527 | + Error << error_string; |
528 | + } |
529 | test_true(memc.flush()); |
530 | |
531 | test_true(memc.mget(keys)); |
532 | |
533 | === modified file 'tests/memcat.cc' |
534 | --- tests/memcat.cc 2013-01-28 22:51:05 +0000 |
535 | +++ tests/memcat.cc 2013-10-11 06:45:13 +0000 |
536 | @@ -64,10 +64,10 @@ |
537 | static test_return_t cat_test(void *) |
538 | { |
539 | char buffer[1024]; |
540 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
541 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
542 | const char *args[]= { buffer, "foo", 0 }; |
543 | |
544 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
545 | + memcached_st *memc= memcached(buffer, length); |
546 | test_true(memc); |
547 | |
548 | test_compare(MEMCACHED_SUCCESS, |
549 | @@ -77,6 +77,7 @@ |
550 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
551 | test_compare(MEMCACHED_SUCCESS, rc); |
552 | |
553 | + snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
554 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); |
555 | |
556 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
557 | @@ -90,11 +91,11 @@ |
558 | static test_return_t NOT_FOUND_test(void *) |
559 | { |
560 | char buffer[1024]; |
561 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
562 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
563 | const char *args[]= { buffer, "foo", 0 }; |
564 | |
565 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
566 | - test_true(memc); |
567 | + memcached_st *memc= memcached(buffer, length); |
568 | + ASSERT_TRUE(memc); |
569 | |
570 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); |
571 | |
572 | @@ -102,6 +103,7 @@ |
573 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
574 | test_compare(MEMCACHED_NOTFOUND, rc); |
575 | |
576 | + snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
577 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); |
578 | |
579 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
580 | |
581 | === modified file 'tests/memcp.cc' |
582 | --- tests/memcp.cc 2013-06-12 07:11:22 +0000 |
583 | +++ tests/memcp.cc 2013-10-11 06:45:13 +0000 |
584 | @@ -63,6 +63,7 @@ |
585 | return TEST_SUCCESS; |
586 | } |
587 | |
588 | +#if 0 |
589 | static test_return_t server_test(void *) |
590 | { |
591 | int fd; |
592 | @@ -82,10 +83,13 @@ |
593 | |
594 | return TEST_SUCCESS; |
595 | } |
596 | +#endif |
597 | |
598 | test_st memcp_tests[] ={ |
599 | {"--help", true, help_test }, |
600 | +#if 0 |
601 | {"--server_test", true, server_test }, |
602 | +#endif |
603 | {0, 0, 0} |
604 | }; |
605 | |
606 | |
607 | === modified file 'tests/memdump.cc' |
608 | --- tests/memdump.cc 2013-01-28 22:51:05 +0000 |
609 | +++ tests/memdump.cc 2013-10-11 06:45:13 +0000 |
610 | @@ -75,10 +75,10 @@ |
611 | static test_return_t FOUND_test(void *) |
612 | { |
613 | char buffer[1024]; |
614 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
615 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
616 | const char *args[]= { buffer, 0 }; |
617 | |
618 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
619 | + memcached_st *memc= memcached(buffer, length); |
620 | test_true(memc); |
621 | |
622 | test_compare(MEMCACHED_SUCCESS, |
623 | @@ -91,6 +91,7 @@ |
624 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
625 | test_compare(MEMCACHED_SUCCESS, rc); |
626 | |
627 | + length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
628 | test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); |
629 | |
630 | memcached_free(memc); |
631 | |
632 | === modified file 'tests/memexist.cc' |
633 | --- tests/memexist.cc 2013-01-28 22:51:05 +0000 |
634 | +++ tests/memexist.cc 2013-10-11 06:45:13 +0000 |
635 | @@ -64,10 +64,10 @@ |
636 | static test_return_t exist_test(void *) |
637 | { |
638 | char buffer[1024]; |
639 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
640 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
641 | const char *args[]= { buffer, "foo", 0 }; |
642 | |
643 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
644 | + memcached_st *memc= memcached(buffer, length); |
645 | test_true(memc); |
646 | |
647 | test_compare(MEMCACHED_SUCCESS, |
648 | @@ -90,11 +90,11 @@ |
649 | static test_return_t NOT_FOUND_test(void *) |
650 | { |
651 | char buffer[1024]; |
652 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
653 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
654 | const char *args[]= { buffer, "foo", 0 }; |
655 | |
656 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
657 | - test_true(memc); |
658 | + memcached_st *memc= memcached(buffer, length); |
659 | + ASSERT_TRUE(memc); |
660 | |
661 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); |
662 | |
663 | @@ -115,9 +115,9 @@ |
664 | static test_return_t check_version(void*) |
665 | { |
666 | char buffer[1024]; |
667 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
668 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
669 | - test_true(memc); |
670 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
671 | + memcached_st *memc= memcached(buffer, length); |
672 | + ASSERT_TRUE(memc); |
673 | |
674 | test_return_t result= TEST_SUCCESS; |
675 | if (libmemcached_util_version_check(memc, 1, 4, 8) == false) |
676 | |
677 | === modified file 'tests/memping.cc' |
678 | --- tests/memping.cc 2013-04-03 13:14:23 +0000 |
679 | +++ tests/memping.cc 2013-10-11 06:45:13 +0000 |
680 | @@ -64,7 +64,7 @@ |
681 | static test_return_t ping_TEST(void *) |
682 | { |
683 | char buffer[1024]; |
684 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
685 | + snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
686 | const char *args[]= { buffer, 0 }; |
687 | |
688 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); |
689 | @@ -75,7 +75,7 @@ |
690 | static test_return_t NOT_FOUND_TEST(void *) |
691 | { |
692 | char buffer[1024]; |
693 | - snprintf(buffer, sizeof(buffer), "--server=nonexist.libmemcached.org:%d", int(default_port())); |
694 | + snprintf(buffer, sizeof(buffer), "--servers=nonexist.libmemcached.org:%d", int(default_port())); |
695 | const char *args[]= { buffer, 0 }; |
696 | |
697 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); |
698 | |
699 | === modified file 'tests/memrm.cc' |
700 | --- tests/memrm.cc 2013-01-28 22:51:05 +0000 |
701 | +++ tests/memrm.cc 2013-10-11 06:45:13 +0000 |
702 | @@ -84,6 +84,8 @@ |
703 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
704 | test_compare(MEMCACHED_SUCCESS, rc); |
705 | |
706 | + char memrm_buffer[1024]; |
707 | + snprintf(memrm_buffer, sizeof(memrm_buffer), "--servers=localhost:%d", int(default_port())); |
708 | const char *args[]= { buffer, "foo", 0 }; |
709 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); |
710 | |
711 | @@ -121,7 +123,7 @@ |
712 | static test_return_t multiple_NOT_FOUND_TEST(void *) |
713 | { |
714 | char buffer[1024]; |
715 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
716 | + snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
717 | const char *args[]= { buffer, "protocols", "foo", "mine", "bar", "dog", "cat", "foo", "mine", |
718 | "eye", "for", "the", "to", "not", "know", "what", "I", "should", "be", "doing", 0 }; |
719 | |
720 | |
721 | === modified file 'tests/memtouch.cc' |
722 | --- tests/memtouch.cc 2013-01-28 22:51:05 +0000 |
723 | +++ tests/memtouch.cc 2013-10-11 06:45:13 +0000 |
724 | @@ -65,9 +65,9 @@ |
725 | static test_return_t touch_test(void *) |
726 | { |
727 | char buffer[1024]; |
728 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
729 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
730 | |
731 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
732 | + memcached_st *memc= memcached(buffer, length); |
733 | test_true(memc); |
734 | |
735 | test_compare(MEMCACHED_SUCCESS, |
736 | @@ -89,15 +89,15 @@ |
737 | static test_return_t NOT_FOUND_test(void *) |
738 | { |
739 | char buffer[1024]; |
740 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
741 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
742 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
743 | + memcached_st *memc= memcached(buffer, length); |
744 | test_true(memc); |
745 | |
746 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); |
747 | |
748 | test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo"))); |
749 | |
750 | - snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
751 | + length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
752 | const char *args[]= { "--expire=30", buffer, "foo", 0 }; |
753 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); |
754 | |
755 | @@ -111,8 +111,8 @@ |
756 | static test_return_t check_version(void*) |
757 | { |
758 | char buffer[1024]; |
759 | - snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
760 | - memcached_st *memc= memcached(buffer, strlen(buffer)); |
761 | + int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
762 | + memcached_st *memc= memcached(buffer, length); |
763 | test_true(memc); |
764 | |
765 | test_return_t result= TEST_SUCCESS; |