Merge lp:~brianaker/libmemcached/1220444 into lp:libmemcached
- 1220444
- Merge into 1.2
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tangent Trunk | Pending | ||
Review via email: mp+190539@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:05 +0000 | |||
5 | @@ -421,7 +421,11 @@ | |||
6 | 421 | # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV | 421 | # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV |
7 | 422 | case $HOST_OS in | 422 | case $HOST_OS in |
8 | 423 | *-darwin-*) | 423 | *-darwin-*) |
9 | 424 | <<<<<<< TREE | ||
10 | 424 | run CC=clang CXX=clang++ $top_srcdir/configure "$BUILD_CONFIGURE_ARG" || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG" | 425 | run CC=clang CXX=clang++ $top_srcdir/configure "$BUILD_CONFIGURE_ARG" || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG" |
11 | 426 | ======= | ||
12 | 427 | run CC=clang CXX=clang++ $CONFIGURE "$BUILD_CONFIGURE_ARG" || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG" | ||
13 | 428 | >>>>>>> MERGE-SOURCE | ||
14 | 425 | ret=$? | 429 | ret=$? |
15 | 426 | ;; | 430 | ;; |
16 | 427 | rhel-5*) | 431 | rhel-5*) |
17 | @@ -793,18 +797,14 @@ | |||
18 | 793 | 797 | ||
19 | 794 | CC=clang CXX=clang++ | 798 | CC=clang CXX=clang++ |
20 | 795 | export CC CXX | 799 | export CC CXX |
21 | 800 | CONFIGURE='scan-build ./configure' | ||
22 | 796 | CONFIGURE_ARGS='--enable-debug' | 801 | CONFIGURE_ARGS='--enable-debug' |
23 | 797 | 802 | ||
28 | 798 | make_skeleton | 803 | run_configure |
25 | 799 | ret=$? | ||
26 | 800 | |||
27 | 801 | make_target 'clean' 'warn' | ||
29 | 802 | 804 | ||
30 | 803 | scan-build -o clang-html make -j4 -k | 805 | scan-build -o clang-html make -j4 -k |
31 | 804 | 806 | ||
32 | 805 | restore_BUILD | 807 | restore_BUILD |
33 | 806 | |||
34 | 807 | return $ret | ||
35 | 808 | } | 808 | } |
36 | 809 | 809 | ||
37 | 810 | # If we are locally testing, we should make sure the environment is setup correctly | 810 | # If we are locally testing, we should make sure the environment is setup correctly |
38 | @@ -1010,6 +1010,9 @@ | |||
39 | 1010 | { | 1010 | { |
40 | 1011 | if command_exists 'rpmbuild'; then | 1011 | if command_exists 'rpmbuild'; then |
41 | 1012 | if [ -f 'rpm.am' -o -d 'rpm' ]; then | 1012 | if [ -f 'rpm.am' -o -d 'rpm' ]; then |
42 | 1013 | mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} | ||
43 | 1014 | mkdir -p ~/rpmbuild/RPMS/{i386,i486,i586,i686,noarch,athlon} | ||
44 | 1015 | |||
45 | 1013 | run_configure_if_required | 1016 | run_configure_if_required |
46 | 1014 | make_target 'rpm' | 1017 | make_target 'rpm' |
47 | 1015 | 1018 | ||
48 | @@ -1507,6 +1510,9 @@ | |||
49 | 1507 | 1510 | ||
50 | 1508 | execute_job () | 1511 | execute_job () |
51 | 1509 | { | 1512 | { |
52 | 1513 | # We should always have a target by this point | ||
53 | 1514 | assert MAKE_TARGET | ||
54 | 1515 | |||
55 | 1510 | determine_target_platform | 1516 | determine_target_platform |
56 | 1511 | 1517 | ||
57 | 1512 | determine_vcs | 1518 | determine_vcs |
58 | @@ -1518,11 +1524,15 @@ | |||
59 | 1518 | return 1 | 1524 | return 1 |
60 | 1519 | fi | 1525 | fi |
61 | 1520 | 1526 | ||
62 | 1527 | <<<<<<< TREE | ||
63 | 1521 | if [ -z "$MAKE_TARGET" ]; then | 1528 | if [ -z "$MAKE_TARGET" ]; then |
64 | 1522 | MAKE_TARGET="make_default" | 1529 | MAKE_TARGET="make_default" |
65 | 1523 | fi | 1530 | fi |
66 | 1524 | 1531 | ||
67 | 1525 | if $print_setup_opt -o $debug; then | 1532 | if $print_setup_opt -o $debug; then |
68 | 1533 | ======= | ||
69 | 1534 | if $print_setup_opt -o $debug; then | ||
70 | 1535 | >>>>>>> MERGE-SOURCE | ||
71 | 1526 | echo | 1536 | echo |
72 | 1527 | print_setup | 1537 | print_setup |
73 | 1528 | echo | 1538 | echo |
74 | @@ -1541,15 +1551,21 @@ | |||
75 | 1541 | PREFIX_ARG="--prefix=$PREFIX" | 1551 | PREFIX_ARG="--prefix=$PREFIX" |
76 | 1542 | fi | 1552 | fi |
77 | 1543 | 1553 | ||
87 | 1544 | # We should always have a target by this point | 1554 | if $CLEAN_OPTION; then |
88 | 1545 | assert MAKE_TARGET | 1555 | make_maintainer_clean |
89 | 1546 | 1556 | fi | |
90 | 1547 | if $CLEAN_OPTION; then | 1557 | |
91 | 1548 | make_maintainer_clean | 1558 | <<<<<<< TREE |
92 | 1549 | fi | 1559 | if $CLEAN_OPTION; then |
93 | 1550 | 1560 | make_maintainer_clean | |
94 | 1551 | local MAKE_TARGET_ARRAY | 1561 | fi |
95 | 1552 | MAKE_TARGET_ARRAY=( $MAKE_TARGET ) | 1562 | |
96 | 1563 | local MAKE_TARGET_ARRAY | ||
97 | 1564 | MAKE_TARGET_ARRAY=( $MAKE_TARGET ) | ||
98 | 1565 | ======= | ||
99 | 1566 | local MAKE_TARGET_ARRAY | ||
100 | 1567 | MAKE_TARGET_ARRAY=( $MAKE_TARGET ) | ||
101 | 1568 | >>>>>>> MERGE-SOURCE | ||
102 | 1553 | 1569 | ||
103 | 1554 | for target in "${MAKE_TARGET_ARRAY[@]}" | 1570 | for target in "${MAKE_TARGET_ARRAY[@]}" |
104 | 1555 | do | 1571 | do |
105 | @@ -1762,8 +1778,20 @@ | |||
106 | 1762 | fi | 1778 | fi |
107 | 1763 | fi | 1779 | fi |
108 | 1764 | 1780 | ||
111 | 1765 | execute_job | 1781 | <<<<<<< TREE |
112 | 1766 | local ret=$? | 1782 | execute_job |
113 | 1783 | local ret=$? | ||
114 | 1784 | ======= | ||
115 | 1785 | if [ -z "$MAKE_TARGET" ]; then | ||
116 | 1786 | MAKE_TARGET="make_default" | ||
117 | 1787 | fi | ||
118 | 1788 | |||
119 | 1789 | # We should always have a target by this point | ||
120 | 1790 | assert MAKE_TARGET | ||
121 | 1791 | |||
122 | 1792 | execute_job | ||
123 | 1793 | local ret=$? | ||
124 | 1794 | >>>>>>> MERGE-SOURCE | ||
125 | 1767 | 1795 | ||
126 | 1768 | jobs -l | 1796 | jobs -l |
127 | 1769 | wait | 1797 | wait |
128 | 1770 | 1798 | ||
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 | 22 | 22 | ||
134 | 23 | #include "clients/generator.h" | 23 | #include "clients/generator.h" |
135 | 24 | 24 | ||
136 | 25 | #define KEY_BYTES 20 | ||
137 | 26 | |||
138 | 25 | /* Use this for string generation */ | 27 | /* Use this for string generation */ |
139 | 26 | static const char ALPHANUMERICS[]= | 28 | static const char ALPHANUMERICS[]= |
140 | 27 | "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz"; | 29 | "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz"; |
141 | @@ -75,13 +77,13 @@ | |||
142 | 75 | 77 | ||
143 | 76 | for (uint64_t x= 0; x < number_of; x++) | 78 | for (uint64_t x= 0; x < number_of; x++) |
144 | 77 | { | 79 | { |
146 | 78 | pairs[x].key= (char *)calloc(100, sizeof(char)); | 80 | pairs[x].key= (char *)calloc(KEY_BYTES, sizeof(char)); |
147 | 79 | 81 | ||
148 | 80 | if (pairs[x].key == NULL) | 82 | if (pairs[x].key == NULL) |
149 | 81 | goto error; | 83 | goto error; |
150 | 82 | 84 | ||
153 | 83 | get_random_string(pairs[x].key, 100); | 85 | get_random_string(pairs[x].key, KEY_BYTES); |
154 | 84 | pairs[x].key_length= 100; | 86 | pairs[x].key_length= KEY_BYTES; |
155 | 85 | 87 | ||
156 | 86 | if (value_length) | 88 | if (value_length) |
157 | 87 | { | 89 | { |
158 | 88 | 90 | ||
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 | 1 | /* LibMemcached | 1 | /* LibMemcached |
165 | 2 | * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ | 2 | * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/ |
166 | 3 | * Copyright (C) 2006-2009 Brian Aker | 3 | * Copyright (C) 2006-2009 Brian Aker |
167 | 4 | * All rights reserved. | 4 | * All rights reserved. |
168 | 5 | * | 5 | * |
169 | 6 | 6 | ||
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 | 66 | #define DEFAULT_EXECUTE_NUMBER 10000 | 66 | #define DEFAULT_EXECUTE_NUMBER 10000 |
175 | 67 | #define DEFAULT_CONCURRENCY 1 | 67 | #define DEFAULT_CONCURRENCY 1 |
176 | 68 | 68 | ||
177 | 69 | #define VALUE_BYTES 4096 | ||
178 | 70 | |||
179 | 69 | #define PROGRAM_NAME "memslap" | 71 | #define PROGRAM_NAME "memslap" |
180 | 70 | #define PROGRAM_DESCRIPTION "Generates a load against a memcached custer of servers." | 72 | #define PROGRAM_DESCRIPTION "Generates a load against a memcached custer of servers." |
181 | 71 | 73 | ||
182 | @@ -336,7 +338,7 @@ | |||
183 | 336 | 338 | ||
184 | 337 | if (opt_test == SET_TEST) | 339 | if (opt_test == SET_TEST) |
185 | 338 | { | 340 | { |
187 | 339 | context->execute_pairs= pairs_generate(opt_execute_number, 400); | 341 | context->execute_pairs= pairs_generate(opt_execute_number, VALUE_BYTES); |
188 | 340 | context->execute_number= opt_execute_number; | 342 | context->execute_number= opt_execute_number; |
189 | 341 | } | 343 | } |
190 | 342 | 344 | ||
191 | @@ -432,7 +434,7 @@ | |||
192 | 432 | break; | 434 | break; |
193 | 433 | 435 | ||
194 | 434 | case OPT_DEBUG: /* --debug or -d */ | 436 | case OPT_DEBUG: /* --debug or -d */ |
196 | 435 | opt_verbose = OPT_DEBUG; | 437 | opt_verbose= OPT_DEBUG; |
197 | 436 | break; | 438 | break; |
198 | 437 | 439 | ||
199 | 438 | case OPT_VERSION: /* --version or -V */ | 440 | case OPT_VERSION: /* --version or -V */ |
200 | @@ -566,7 +568,7 @@ | |||
201 | 566 | /* We always used non-blocking IO for load since it is faster */ | 568 | /* We always used non-blocking IO for load since it is faster */ |
202 | 567 | memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); | 569 | memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_NO_BLOCK, 0); |
203 | 568 | 570 | ||
205 | 569 | pairs_st *pairs= pairs_generate(number_of, 400); | 571 | pairs_st *pairs= pairs_generate(number_of, VALUE_BYTES); |
206 | 570 | *actual_loaded= execute_set(memc_clone, pairs, number_of); | 572 | *actual_loaded= execute_set(memc_clone, pairs, number_of); |
207 | 571 | 573 | ||
208 | 572 | memcached_free(memc_clone); | 574 | memcached_free(memc_clone); |
209 | 573 | 575 | ||
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 | 99 | case EWOULDBLOCK: | 99 | case EWOULDBLOCK: |
215 | 100 | #endif | 100 | #endif |
216 | 101 | case EAGAIN: | 101 | case EAGAIN: |
218 | 102 | #ifdef TARGET_OS_LINUX | 102 | #ifdef __linux |
219 | 103 | case ERESTART: | 103 | case ERESTART: |
220 | 104 | #endif | 104 | #endif |
221 | 105 | break; // No IO is fine, we can just move on | 105 | break; // No IO is fine, we can just move on |
222 | @@ -265,7 +265,7 @@ | |||
223 | 265 | assert_msg(active_fd == -1 , "poll() returned an unexpected value"); | 265 | assert_msg(active_fd == -1 , "poll() returned an unexpected value"); |
224 | 266 | switch (local_errno) | 266 | switch (local_errno) |
225 | 267 | { | 267 | { |
227 | 268 | #ifdef TARGET_OS_LINUX | 268 | #ifdef __linux |
228 | 269 | case ERESTART: | 269 | case ERESTART: |
229 | 270 | #endif | 270 | #endif |
230 | 271 | case EINTR: | 271 | case EINTR: |
231 | @@ -430,7 +430,7 @@ | |||
232 | 430 | case EWOULDBLOCK: | 430 | case EWOULDBLOCK: |
233 | 431 | #endif | 431 | #endif |
234 | 432 | case EAGAIN: | 432 | case EAGAIN: |
236 | 433 | #ifdef TARGET_OS_LINUX | 433 | #ifdef __linux |
237 | 434 | case ERESTART: | 434 | case ERESTART: |
238 | 435 | #endif | 435 | #endif |
239 | 436 | { | 436 | { |
240 | @@ -568,7 +568,7 @@ | |||
241 | 568 | case EWOULDBLOCK: | 568 | case EWOULDBLOCK: |
242 | 569 | #endif | 569 | #endif |
243 | 570 | case EAGAIN: | 570 | case EAGAIN: |
245 | 571 | #ifdef TARGET_OS_LINUX | 571 | #ifdef __linux |
246 | 572 | case ERESTART: | 572 | case ERESTART: |
247 | 573 | #endif | 573 | #endif |
248 | 574 | if (memcached_success(io_wait(instance, MEM_READ))) | 574 | if (memcached_success(io_wait(instance, MEM_READ))) |
249 | 575 | 575 | ||
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 | 281 | { | 281 | { |
255 | 282 | char* value= NULL; | 282 | char* value= NULL; |
256 | 283 | 283 | ||
258 | 284 | if (memcached_string_length(self)) | 284 | assert_msg(self, "Invalid memcached_string_st"); |
259 | 285 | if (self) | ||
260 | 285 | { | 286 | { |
264 | 286 | assert_msg(self, "Invalid memcached_string_st"); | 287 | if (memcached_string_length(self)) |
262 | 287 | // If we fail at adding the null, we copy and move on | ||
263 | 288 | if (memcached_success(memcached_string_append_null(self))) | ||
265 | 289 | { | 288 | { |
267 | 290 | return memcached_string_c_copy(self); | 289 | // If we fail at adding the null, we copy and move on |
268 | 290 | if (memcached_failed(memcached_string_append_null(self))) | ||
269 | 291 | { | ||
270 | 292 | return NULL; | ||
271 | 293 | } | ||
272 | 294 | |||
273 | 295 | value= self->string; | ||
274 | 296 | _init_string(self); | ||
275 | 291 | } | 297 | } |
276 | 292 | |||
277 | 293 | value= self->string; | ||
278 | 294 | |||
279 | 295 | _init_string(self); | ||
280 | 296 | } | 298 | } |
281 | 297 | 299 | ||
282 | 298 | return value; | 300 | return value; |
283 | 299 | 301 | ||
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 | 359 | int error; | 359 | int error; |
289 | 360 | switch ((error= errno)) | 360 | switch ((error= errno)) |
290 | 361 | { | 361 | { |
292 | 362 | #ifdef TARGET_OS_LINUX | 362 | #ifdef __linux |
293 | 363 | case ERESTART: | 363 | case ERESTART: |
294 | 364 | #endif | 364 | #endif |
295 | 365 | case EINTR: | 365 | case EINTR: |
296 | 366 | 366 | ||
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 | 42 | 42 | ||
302 | 43 | void create_core(void) | 43 | void create_core(void) |
303 | 44 | { | 44 | { |
306 | 45 | #if defined(TARGET_OS_OSX) && TARGET_OS_OSX | 45 | #if defined(__APPLE__) && __APPLE__ |
307 | 46 | if (TARGET_OS_OSX) | 46 | if (__APPLE__) |
308 | 47 | { | 47 | { |
309 | 48 | return; | 48 | return; |
310 | 49 | } | 49 | } |
311 | 50 | 50 | ||
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 | 52 | 52 | ||
317 | 53 | uint32_t number_of_cpus() | 53 | uint32_t number_of_cpus() |
318 | 54 | { | 54 | { |
319 | 55 | <<<<<<< TREE | ||
320 | 55 | uint32_t number_of_cpu= 1; | 56 | uint32_t number_of_cpu= 1; |
321 | 56 | #ifdef linux | 57 | #ifdef linux |
322 | 58 | ======= | ||
323 | 59 | size_t number_of_cpu= 1; | ||
324 | 60 | #if defined(__linux) && __linux | ||
325 | 61 | >>>>>>> MERGE-SOURCE | ||
326 | 57 | number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN); | 62 | number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN); |
327 | 58 | #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU) | 63 | #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU) |
328 | 59 | int mib[4]; | 64 | int mib[4]; |
329 | 60 | 65 | ||
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 | 2 | * | 2 | * |
335 | 3 | * Data Differential YATL (i.e. libtest) library | 3 | * Data Differential YATL (i.e. libtest) library |
336 | 4 | * | 4 | * |
338 | 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ | 5 | * Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/ |
339 | 6 | * | 6 | * |
340 | 7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without |
341 | 8 | * modification, are permitted provided that the following conditions are | 8 | * modification, are permitted provided that the following conditions are |
342 | @@ -45,6 +45,13 @@ | |||
343 | 45 | #include <fnmatch.h> | 45 | #include <fnmatch.h> |
344 | 46 | #include <fstream> | 46 | #include <fstream> |
345 | 47 | #include <iostream> | 47 | #include <iostream> |
346 | 48 | <<<<<<< TREE | ||
347 | 49 | ======= | ||
348 | 50 | #ifdef HAVE_STRINGS_H | ||
349 | 51 | # include <strings.h> | ||
350 | 52 | #endif | ||
351 | 53 | #include <fstream> | ||
352 | 54 | >>>>>>> MERGE-SOURCE | ||
353 | 48 | #include <memory> | 55 | #include <memory> |
354 | 49 | #include <sys/stat.h> | 56 | #include <sys/stat.h> |
355 | 50 | #include <sys/time.h> | 57 | #include <sys/time.h> |
356 | @@ -113,7 +120,7 @@ | |||
357 | 113 | Valgrind does not currently work reliably, or sometimes at all, on OSX | 120 | Valgrind does not currently work reliably, or sometimes at all, on OSX |
358 | 114 | - Fri Jun 15 11:24:07 EDT 2012 | 121 | - Fri Jun 15 11:24:07 EDT 2012 |
359 | 115 | */ | 122 | */ |
361 | 116 | #if defined(TARGET_OS_OSX) && TARGET_OS_OSX | 123 | #if defined(__APPLE__) && __APPLE__ |
362 | 117 | if (valgrind_is_caller()) | 124 | if (valgrind_is_caller()) |
363 | 118 | { | 125 | { |
364 | 119 | return EXIT_SKIP; | 126 | return EXIT_SKIP; |
365 | 120 | 127 | ||
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 | 657 | const char *args[]= { "--fubar", 0 }; | 657 | const char *args[]= { "--fubar", 0 }; |
371 | 658 | #if defined(__APPLE__) && __APPLE__ | 658 | #if defined(__APPLE__) && __APPLE__ |
372 | 659 | ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); | 659 | ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); |
374 | 660 | #elif defined(TARGET_OS_FREEBSD) && TARGET_OS_FREEBSD | 660 | #elif defined(__FreeBSD__) && __FreeBSD__ |
375 | 661 | ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); | 661 | ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); |
376 | 662 | #else | 662 | #else |
377 | 663 | ASSERT_EQ(Application::SUCCESS, true_app.run(args)); | 663 | ASSERT_EQ(Application::SUCCESS, true_app.run(args)); |
378 | @@ -855,8 +855,8 @@ | |||
379 | 855 | static test_return_t gdb_wait_services_appliction_TEST(void *) | 855 | static test_return_t gdb_wait_services_appliction_TEST(void *) |
380 | 856 | { | 856 | { |
381 | 857 | test_skip(true, false); | 857 | test_skip(true, false); |
384 | 858 | #if defined(TARGET_OS_OSX) && TARGET_OS_OSX | 858 | #if defined(__APPLE__) && __APPLE__ |
385 | 859 | test_skip(0, TARGET_OS_OSX); | 859 | test_skip(0, __APPLE__); |
386 | 860 | #endif | 860 | #endif |
387 | 861 | 861 | ||
388 | 862 | test_skip(0, access("/etc/services", R_OK )); | 862 | test_skip(0, access("/etc/services", R_OK )); |
389 | @@ -879,8 +879,8 @@ | |||
390 | 879 | test_skip(0, access("libtest/abort", X_OK )); | 879 | test_skip(0, access("libtest/abort", X_OK )); |
391 | 880 | test_skip(true, false); | 880 | test_skip(true, false); |
392 | 881 | 881 | ||
395 | 882 | #if defined(TARGET_OS_OSX) && TARGET_OS_OSX | 882 | #if defined(__APPLE__) && __APPLE__ |
396 | 883 | test_skip(0, TARGET_OS_OSX); | 883 | test_skip(0, __APPLE__); |
397 | 884 | #endif | 884 | #endif |
398 | 885 | 885 | ||
399 | 886 | libtest::Application abort_app("libtest/abort", true); | 886 | libtest::Application abort_app("libtest/abort", true); |
400 | 887 | 887 | ||
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 | 43 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 43 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
406 | 44 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 44 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
407 | 45 | 45 | ||
409 | 46 | #serial 5 | 46 | #serial 6 |
410 | 47 | 47 | ||
411 | 48 | AC_DEFUN([AX_DEBUG], | 48 | AC_DEFUN([AX_DEBUG], |
412 | 49 | [AC_PREREQ([2.63])dnl | 49 | [AC_PREREQ([2.63])dnl |
413 | @@ -52,7 +52,9 @@ | |||
414 | 52 | [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], | 52 | [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], |
415 | 53 | [ax_enable_debug=yes | 53 | [ax_enable_debug=yes |
416 | 54 | AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.]) | 54 | AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.]) |
418 | 55 | AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])])], | 55 | AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])]) |
419 | 56 | AX_ADD_AM_MACRO([--debug],[AM_YFLAGS]) | ||
420 | 57 | AX_ADD_AM_MACRO([-D_GLIBCXX_DEBUG],[AM_CPPFLAGS])], | ||
421 | 56 | [ax_enable_debug=no | 58 | [ax_enable_debug=no |
422 | 57 | AC_SUBST([MCHECK]) | 59 | AC_SUBST([MCHECK]) |
423 | 58 | AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])]) | 60 | AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])]) |
424 | 59 | 61 | ||
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 | 53 | # -Wdeclaration-after-statement is counter to C99 | 53 | # -Wdeclaration-after-statement is counter to C99 |
430 | 54 | # _APPEND_COMPILE_FLAGS_ERROR([-pedantic]) | 54 | # _APPEND_COMPILE_FLAGS_ERROR([-pedantic]) |
431 | 55 | 55 | ||
432 | 56 | <<<<<<< TREE | ||
433 | 56 | #serial 12 | 57 | #serial 12 |
434 | 57 | 58 | ||
435 | 58 | AC_DEFUN([_SET_SANITIZE_FLAGS], | 59 | AC_DEFUN([_SET_SANITIZE_FLAGS], |
436 | @@ -86,6 +87,41 @@ | |||
437 | 86 | ]) | 87 | ]) |
438 | 87 | ]) | 88 | ]) |
439 | 88 | ]) | 89 | ]) |
440 | 90 | ======= | ||
441 | 91 | #serial 13 | ||
442 | 92 | |||
443 | 93 | AC_DEFUN([_SET_SANITIZE_FLAGS], | ||
444 | 94 | [AS_IF([test "x$MINGW" != xyes],[ | ||
445 | 95 | AS_IF([test "x$enable_shared" = "xyes"], | ||
446 | 96 | [AS_CASE([$ax_harden_sanitize], | ||
447 | 97 | [thread],[ | ||
448 | 98 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])], | ||
449 | 99 | [address],[ | ||
450 | 100 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])], | ||
451 | 101 | [rest],[ | ||
452 | 102 | _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer]) | ||
453 | 103 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer]) | ||
454 | 104 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory]) | ||
455 | 105 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment]) | ||
456 | 106 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool]) | ||
457 | 107 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds]) | ||
458 | 108 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum]) | ||
459 | 109 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow]) | ||
460 | 110 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero]) | ||
461 | 111 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero]) | ||
462 | 112 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null]) | ||
463 | 113 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size]) | ||
464 | 114 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return]) | ||
465 | 115 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift]) | ||
466 | 116 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow]) | ||
467 | 117 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable]) | ||
468 | 118 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow]) | ||
469 | 119 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound]) | ||
470 | 120 | _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])]) | ||
471 | 121 | ]) | ||
472 | 122 | ]) | ||
473 | 123 | ]) | ||
474 | 124 | >>>>>>> MERGE-SOURCE | ||
475 | 89 | 125 | ||
476 | 90 | AC_DEFUN([_WARNINGS_AS_ERRORS], | 126 | AC_DEFUN([_WARNINGS_AS_ERRORS], |
477 | 91 | [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors], | 127 | [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors], |
478 | 92 | 128 | ||
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 | 44 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 44 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
484 | 45 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 45 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
485 | 46 | 46 | ||
487 | 47 | #serial 4 | 47 | #serial 3 |
488 | 48 | 48 | ||
489 | 49 | AC_DEFUN([AX_PROG_MEMCACHED], | 49 | AC_DEFUN([AX_PROG_MEMCACHED], |
510 | 50 | [AX_WITH_PROG([MEMCACHED_BINARY],[memcached],[unknown]) | 50 | [AX_WITH_PROG([MEMCACHED_BINARY],[memcached]) |
511 | 51 | ax_memcached_success= | 51 | AS_IF([test -f "$ac_cv_path_MEMCACHED_BINARY"], |
512 | 52 | AS_IF([test x"$MEMCACHED_BINARY" != xunknown], | 52 | [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available]) |
513 | 53 | [AS_IF([test -x "$MEMCACHED_BINARY"], | 53 | AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$ac_cv_path_MEMCACHED_BINARY",[Name of the memcached binary used in make test]) |
514 | 54 | [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}'` | 54 | 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 | 55 | AS_IF([test -n "$ax_memcached_version"], | 55 | AC_MSG_RESULT([memcached version "$ax_memcached_version"]) |
516 | 56 | [ax_memcached_success='ok' | 56 | AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version]) |
517 | 57 | AC_MSG_RESULT([memcached version "$ax_memcached_version"]) | 57 | ]) |
518 | 58 | AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])]) | 58 | ]) |
499 | 59 | ]) | ||
500 | 60 | ]) | ||
501 | 61 | |||
502 | 62 | AS_IF([test -n "$ax_memcached_success"], | ||
503 | 63 | [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available]) | ||
504 | 64 | AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$MEMCACHED_BINARY",[Name of the memcached binary used in make test]) | ||
505 | 65 | ], | ||
506 | 66 | [AC_DEFINE([HAVE_MEMCACHED_BINARY], [0], [If Memcached binary is available]) | ||
507 | 67 | MEMCACHED_BINARY= | ||
508 | 68 | ]) | ||
509 | 69 | ]) | ||
519 | 70 | 59 | ||
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 @@ | |||
558 | 1 | dnl Copyright (C) 2011 Brian Aker (brian@tangent.org) | 1 | # Copyright (C) 2011 Brian Aker (brian@tangent.org) |
559 | 2 | 2 | # | |
560 | 3 | AC_DEFUN([_SEARCH_LIBHIREDIS],[ | 3 | # serial 2 |
561 | 4 | AC_REQUIRE([AX_CHECK_LIBRARY]) | 4 | |
562 | 5 | 5 | AC_DEFUN([_SEARCH_HIREDIS], | |
563 | 6 | AS_IF([test "x$ac_enable_hires" = "xyes"],[ | 6 | [AC_REQUIRE([AX_CHECK_LIBRARY]) |
564 | 7 | AX_CHECK_LIBRARY([LIBHIREDIS], [hiredis/hiredis.h], [hiredis], | 7 | |
565 | 8 | [ | 8 | AS_IF([test "x$ac_enable_hiredis" = "xyes"], |
566 | 9 | LIBHIREDIS_LDFLAGS="-lhiredis" | 9 | [hiredis_header="hiredis/hiredis.h"], |
567 | 10 | AC_DEFINE([HAVE_HIREDIS], [1], [If Hiredis available]) | 10 | [hiredis_header="does_not_exist"]) |
568 | 11 | ], | 11 | |
569 | 12 | [ | 12 | AX_CHECK_LIBRARY([HIREDIS],[$hiredis_header],[hiredis],, |
570 | 13 | AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available]) | 13 | [AC_DEFINE([HAVE_HIREDIS],[0],[Define to 1 if HIREDIS is found])]) |
571 | 14 | ac_enable_hires="no" | 14 | |
572 | 15 | ]) | 15 | AS_IF([test "x$ax_cv_have_HIREDIS" = xno],[ac_enable_hiredis="no"]) |
573 | 16 | 16 | ]) | |
574 | 17 | ], | 17 | |
575 | 18 | [ | 18 | AC_DEFUN([AX_ENABLE_LIBHIREDIS], |
576 | 19 | AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available]) | 19 | [AC_ARG_ENABLE([hiredis], |
577 | 20 | ]) | 20 | [AS_HELP_STRING([--disable-hiredis], |
578 | 21 | 21 | [Build with hiredis support @<:@default=on@:>@])], | |
579 | 22 | AM_CONDITIONAL(HAVE_HIREDIS, [test "x$ac_cv_lib_hiredis_main" = "xyes"]) | 22 | [ac_enable_hiredis="$enableval"], |
580 | 23 | ]) | 23 | [ac_enable_hiredis="yes"]) |
581 | 24 | 24 | ||
582 | 25 | AC_DEFUN([AX_HAVE_LIBHIREDIS],[ | 25 | _SEARCH_HIREDIS |
583 | 26 | 26 | ]) | |
550 | 27 | AC_ARG_ENABLE([hires], | ||
551 | 28 | [AS_HELP_STRING([--disable-hires], | ||
552 | 29 | [Build with hires support @<:@default=on@:>@])], | ||
553 | 30 | [ac_enable_hires="$enableval"], | ||
554 | 31 | [ac_enable_hires="yes"]) | ||
555 | 32 | |||
556 | 33 | _SEARCH_LIBHIREDIS | ||
557 | 34 | ]) | ||
584 | 35 | 27 | ||
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 | 181 | vector<char> return_value; | 181 | vector<char> return_value; |
590 | 182 | 182 | ||
591 | 183 | /* We need to empty the server before we continue the test */ | 183 | /* We need to empty the server before we continue the test */ |
592 | 184 | bool flush_res= memc.flush(); | ||
593 | 185 | if (flush_res == false) | ||
594 | 186 | { | ||
595 | 187 | std::string error_string; | ||
596 | 188 | ASSERT_TRUE(memc.error(error_string)); | ||
597 | 189 | Error << error_string; | ||
598 | 190 | } | ||
599 | 184 | test_true(memc.flush()); | 191 | test_true(memc.flush()); |
600 | 185 | 192 | ||
601 | 186 | test_true(memc.mget(keys)); | 193 | test_true(memc.mget(keys)); |
602 | 187 | 194 | ||
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 | 64 | static test_return_t cat_test(void *) | 64 | static test_return_t cat_test(void *) |
608 | 65 | { | 65 | { |
609 | 66 | char buffer[1024]; | 66 | char buffer[1024]; |
611 | 67 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 67 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
612 | 68 | const char *args[]= { buffer, "foo", 0 }; | 68 | const char *args[]= { buffer, "foo", 0 }; |
613 | 69 | 69 | ||
615 | 70 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 70 | memcached_st *memc= memcached(buffer, length); |
616 | 71 | test_true(memc); | 71 | test_true(memc); |
617 | 72 | 72 | ||
618 | 73 | test_compare(MEMCACHED_SUCCESS, | 73 | test_compare(MEMCACHED_SUCCESS, |
619 | @@ -77,6 +77,7 @@ | |||
620 | 77 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); | 77 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
621 | 78 | test_compare(MEMCACHED_SUCCESS, rc); | 78 | test_compare(MEMCACHED_SUCCESS, rc); |
622 | 79 | 79 | ||
623 | 80 | snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); | ||
624 | 80 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); | 81 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); |
625 | 81 | 82 | ||
626 | 82 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); | 83 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
627 | @@ -90,11 +91,11 @@ | |||
628 | 90 | static test_return_t NOT_FOUND_test(void *) | 91 | static test_return_t NOT_FOUND_test(void *) |
629 | 91 | { | 92 | { |
630 | 92 | char buffer[1024]; | 93 | char buffer[1024]; |
632 | 93 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 94 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
633 | 94 | const char *args[]= { buffer, "foo", 0 }; | 95 | const char *args[]= { buffer, "foo", 0 }; |
634 | 95 | 96 | ||
637 | 96 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 97 | memcached_st *memc= memcached(buffer, length); |
638 | 97 | test_true(memc); | 98 | ASSERT_TRUE(memc); |
639 | 98 | 99 | ||
640 | 99 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); | 100 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); |
641 | 100 | 101 | ||
642 | @@ -102,6 +103,7 @@ | |||
643 | 102 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); | 103 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
644 | 103 | test_compare(MEMCACHED_NOTFOUND, rc); | 104 | test_compare(MEMCACHED_NOTFOUND, rc); |
645 | 104 | 105 | ||
646 | 106 | snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); | ||
647 | 105 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); | 107 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); |
648 | 106 | 108 | ||
649 | 107 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); | 109 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
650 | 108 | 110 | ||
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 | 63 | return TEST_SUCCESS; | 63 | return TEST_SUCCESS; |
656 | 64 | } | 64 | } |
657 | 65 | 65 | ||
658 | 66 | #if 0 | ||
659 | 66 | static test_return_t server_test(void *) | 67 | static test_return_t server_test(void *) |
660 | 67 | { | 68 | { |
661 | 68 | int fd; | 69 | int fd; |
662 | @@ -82,10 +83,13 @@ | |||
663 | 82 | 83 | ||
664 | 83 | return TEST_SUCCESS; | 84 | return TEST_SUCCESS; |
665 | 84 | } | 85 | } |
666 | 86 | #endif | ||
667 | 85 | 87 | ||
668 | 86 | test_st memcp_tests[] ={ | 88 | test_st memcp_tests[] ={ |
669 | 87 | {"--help", true, help_test }, | 89 | {"--help", true, help_test }, |
670 | 90 | #if 0 | ||
671 | 88 | {"--server_test", true, server_test }, | 91 | {"--server_test", true, server_test }, |
672 | 92 | #endif | ||
673 | 89 | {0, 0, 0} | 93 | {0, 0, 0} |
674 | 90 | }; | 94 | }; |
675 | 91 | 95 | ||
676 | 92 | 96 | ||
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 | 75 | static test_return_t FOUND_test(void *) | 75 | static test_return_t FOUND_test(void *) |
682 | 76 | { | 76 | { |
683 | 77 | char buffer[1024]; | 77 | char buffer[1024]; |
685 | 78 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 78 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
686 | 79 | const char *args[]= { buffer, 0 }; | 79 | const char *args[]= { buffer, 0 }; |
687 | 80 | 80 | ||
689 | 81 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 81 | memcached_st *memc= memcached(buffer, length); |
690 | 82 | test_true(memc); | 82 | test_true(memc); |
691 | 83 | 83 | ||
692 | 84 | test_compare(MEMCACHED_SUCCESS, | 84 | test_compare(MEMCACHED_SUCCESS, |
693 | @@ -91,6 +91,7 @@ | |||
694 | 91 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); | 91 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
695 | 92 | test_compare(MEMCACHED_SUCCESS, rc); | 92 | test_compare(MEMCACHED_SUCCESS, rc); |
696 | 93 | 93 | ||
697 | 94 | length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); | ||
698 | 94 | test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); | 95 | test_true(exec_cmdline(executable, args, true) <= EXIT_FAILURE); |
699 | 95 | 96 | ||
700 | 96 | memcached_free(memc); | 97 | memcached_free(memc); |
701 | 97 | 98 | ||
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 | 64 | static test_return_t exist_test(void *) | 64 | static test_return_t exist_test(void *) |
707 | 65 | { | 65 | { |
708 | 66 | char buffer[1024]; | 66 | char buffer[1024]; |
710 | 67 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 67 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
711 | 68 | const char *args[]= { buffer, "foo", 0 }; | 68 | const char *args[]= { buffer, "foo", 0 }; |
712 | 69 | 69 | ||
714 | 70 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 70 | memcached_st *memc= memcached(buffer, length); |
715 | 71 | test_true(memc); | 71 | test_true(memc); |
716 | 72 | 72 | ||
717 | 73 | test_compare(MEMCACHED_SUCCESS, | 73 | test_compare(MEMCACHED_SUCCESS, |
718 | @@ -90,11 +90,11 @@ | |||
719 | 90 | static test_return_t NOT_FOUND_test(void *) | 90 | static test_return_t NOT_FOUND_test(void *) |
720 | 91 | { | 91 | { |
721 | 92 | char buffer[1024]; | 92 | char buffer[1024]; |
723 | 93 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 93 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
724 | 94 | const char *args[]= { buffer, "foo", 0 }; | 94 | const char *args[]= { buffer, "foo", 0 }; |
725 | 95 | 95 | ||
728 | 96 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 96 | memcached_st *memc= memcached(buffer, length); |
729 | 97 | test_true(memc); | 97 | ASSERT_TRUE(memc); |
730 | 98 | 98 | ||
731 | 99 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); | 99 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); |
732 | 100 | 100 | ||
733 | @@ -115,9 +115,9 @@ | |||
734 | 115 | static test_return_t check_version(void*) | 115 | static test_return_t check_version(void*) |
735 | 116 | { | 116 | { |
736 | 117 | char buffer[1024]; | 117 | char buffer[1024]; |
740 | 118 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 118 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
741 | 119 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 119 | memcached_st *memc= memcached(buffer, length); |
742 | 120 | test_true(memc); | 120 | ASSERT_TRUE(memc); |
743 | 121 | 121 | ||
744 | 122 | test_return_t result= TEST_SUCCESS; | 122 | test_return_t result= TEST_SUCCESS; |
745 | 123 | if (libmemcached_util_version_check(memc, 1, 4, 8) == false) | 123 | if (libmemcached_util_version_check(memc, 1, 4, 8) == false) |
746 | 124 | 124 | ||
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 | 64 | static test_return_t ping_TEST(void *) | 64 | static test_return_t ping_TEST(void *) |
752 | 65 | { | 65 | { |
753 | 66 | char buffer[1024]; | 66 | char buffer[1024]; |
755 | 67 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 67 | snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
756 | 68 | const char *args[]= { buffer, 0 }; | 68 | const char *args[]= { buffer, 0 }; |
757 | 69 | 69 | ||
758 | 70 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); | 70 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); |
759 | @@ -75,7 +75,7 @@ | |||
760 | 75 | static test_return_t NOT_FOUND_TEST(void *) | 75 | static test_return_t NOT_FOUND_TEST(void *) |
761 | 76 | { | 76 | { |
762 | 77 | char buffer[1024]; | 77 | char buffer[1024]; |
764 | 78 | snprintf(buffer, sizeof(buffer), "--server=nonexist.libmemcached.org:%d", int(default_port())); | 78 | snprintf(buffer, sizeof(buffer), "--servers=nonexist.libmemcached.org:%d", int(default_port())); |
765 | 79 | const char *args[]= { buffer, 0 }; | 79 | const char *args[]= { buffer, 0 }; |
766 | 80 | 80 | ||
767 | 81 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); | 81 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); |
768 | 82 | 82 | ||
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 | 84 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); | 84 | test_null(memcached_get(memc, test_literal_param("foo"), 0, 0, &rc)); |
774 | 85 | test_compare(MEMCACHED_SUCCESS, rc); | 85 | test_compare(MEMCACHED_SUCCESS, rc); |
775 | 86 | 86 | ||
776 | 87 | char memrm_buffer[1024]; | ||
777 | 88 | snprintf(memrm_buffer, sizeof(memrm_buffer), "--servers=localhost:%d", int(default_port())); | ||
778 | 87 | const char *args[]= { buffer, "foo", 0 }; | 89 | const char *args[]= { buffer, "foo", 0 }; |
779 | 88 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); | 90 | test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true)); |
780 | 89 | 91 | ||
781 | @@ -121,7 +123,7 @@ | |||
782 | 121 | static test_return_t multiple_NOT_FOUND_TEST(void *) | 123 | static test_return_t multiple_NOT_FOUND_TEST(void *) |
783 | 122 | { | 124 | { |
784 | 123 | char buffer[1024]; | 125 | char buffer[1024]; |
786 | 124 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 126 | snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
787 | 125 | const char *args[]= { buffer, "protocols", "foo", "mine", "bar", "dog", "cat", "foo", "mine", | 127 | const char *args[]= { buffer, "protocols", "foo", "mine", "bar", "dog", "cat", "foo", "mine", |
788 | 126 | "eye", "for", "the", "to", "not", "know", "what", "I", "should", "be", "doing", 0 }; | 128 | "eye", "for", "the", "to", "not", "know", "what", "I", "should", "be", "doing", 0 }; |
789 | 127 | 129 | ||
790 | 128 | 130 | ||
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 | 65 | static test_return_t touch_test(void *) | 65 | static test_return_t touch_test(void *) |
796 | 66 | { | 66 | { |
797 | 67 | char buffer[1024]; | 67 | char buffer[1024]; |
799 | 68 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 68 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
800 | 69 | 69 | ||
802 | 70 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 70 | memcached_st *memc= memcached(buffer, length); |
803 | 71 | test_true(memc); | 71 | test_true(memc); |
804 | 72 | 72 | ||
805 | 73 | test_compare(MEMCACHED_SUCCESS, | 73 | test_compare(MEMCACHED_SUCCESS, |
806 | @@ -89,15 +89,15 @@ | |||
807 | 89 | static test_return_t NOT_FOUND_test(void *) | 89 | static test_return_t NOT_FOUND_test(void *) |
808 | 90 | { | 90 | { |
809 | 91 | char buffer[1024]; | 91 | char buffer[1024]; |
812 | 92 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 92 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
813 | 93 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 93 | memcached_st *memc= memcached(buffer, length); |
814 | 94 | test_true(memc); | 94 | test_true(memc); |
815 | 95 | 95 | ||
816 | 96 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); | 96 | test_compare(MEMCACHED_SUCCESS, memcached_flush(memc, 0)); |
817 | 97 | 97 | ||
818 | 98 | test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo"))); | 98 | test_compare(MEMCACHED_NOTFOUND, memcached_exist(memc, test_literal_param("foo"))); |
819 | 99 | 99 | ||
821 | 100 | snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); | 100 | length= snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); |
822 | 101 | const char *args[]= { "--expire=30", buffer, "foo", 0 }; | 101 | const char *args[]= { "--expire=30", buffer, "foo", 0 }; |
823 | 102 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); | 102 | test_compare(EXIT_FAILURE, exec_cmdline(executable, args, true)); |
824 | 103 | 103 | ||
825 | @@ -111,8 +111,8 @@ | |||
826 | 111 | static test_return_t check_version(void*) | 111 | static test_return_t check_version(void*) |
827 | 112 | { | 112 | { |
828 | 113 | char buffer[1024]; | 113 | char buffer[1024]; |
831 | 114 | snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); | 114 | int length= snprintf(buffer, sizeof(buffer), "--server=localhost:%d", int(default_port())); |
832 | 115 | memcached_st *memc= memcached(buffer, strlen(buffer)); | 115 | memcached_st *memc= memcached(buffer, length); |
833 | 116 | test_true(memc); | 116 | test_true(memc); |
834 | 117 | 117 | ||
835 | 118 | test_return_t result= TEST_SUCCESS; | 118 | test_return_t result= TEST_SUCCESS; |