From: Brian Aker Date: Thu, 8 Sep 2011 19:41:50 +0000 (-0700) Subject: Update for OSX Lion build. X-Git-Tag: 0.52~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3645e647825396693c46a4de5d9e45dfde54dabd;p=m6w6%2Flibmemcached Update for OSX Lion build. --- diff --git a/config/autorun.sh b/config/autorun.sh index 79d6629e..febee48a 100755 --- a/config/autorun.sh +++ b/config/autorun.sh @@ -1,2 +1,2 @@ #!/bin/sh -autoreconf -ivf -Wall +autoreconf --install --force --verbose -Wall diff --git a/configure.ac b/configure.ac index 045b562f..2b0ac0a3 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,12 @@ AC_SUBST(MEMCACHED_LIBRARY_VERSION) HASHKIT_LIBRARY_VERSION=1:0:0 AC_SUBST(HASHKIT_LIBRARY_VERSION) -LT_INIT +LT_PREREQ([2.2]) +LT_INIT() +LT_LANG([C++]) +LT_LANG([C]) +gl_VISIBILITY + m4_include([m4/memcached.m4]) m4_include([m4/memcached_sasl.m4]) m4_include([m4/gearmand.m4]) @@ -80,7 +85,7 @@ case "$target_os" in esac dnl Specialty checks -ACX_PTHREAD +AX_PTHREAD CONFIG_EXTRA DETECT_BYTEORDER ENABLE_UTILLIB diff --git a/libmemcached/array.h b/libmemcached/array.h index 22b61ac3..0f6e8d0c 100644 --- a/libmemcached/array.h +++ b/libmemcached/array.h @@ -42,10 +42,10 @@ extern "C" { #endif LIBMEMCACHED_LOCAL -memcached_array_st *memcached_array_clone(memcached_st *memc, const memcached_array_st *original); +memcached_array_st *memcached_array_clone(struct memcached_st *memc, const memcached_array_st *original); LIBMEMCACHED_LOCAL -memcached_array_st *memcached_strcpy(memcached_st *memc, const char *str, size_t str_length); +memcached_array_st *memcached_strcpy(struct memcached_st *memc, const char *str, size_t str_length); LIBMEMCACHED_LOCAL void memcached_array_free(memcached_array_st *array); diff --git a/libmemcached/callback.cc b/libmemcached/callback.cc index bb13a87b..84f99359 100644 --- a/libmemcached/callback.cc +++ b/libmemcached/callback.cc @@ -12,7 +12,9 @@ #include #include +#ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif /* These functions provide data and function callback support diff --git a/libmemcached/csl/parser.cc b/libmemcached/csl/parser.cc index 5bcfac1e..63d92e8e 100644 --- a/libmemcached/csl/parser.cc +++ b/libmemcached/csl/parser.cc @@ -85,7 +85,9 @@ #include #include +#ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" +#endif int conf_lex(YYSTYPE* lvalp, void* scanner); @@ -114,7 +116,7 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro /* Line 189 of yacc.c */ -#line 118 "libmemcached/csl/parser.cc" +#line 120 "libmemcached/csl/parser.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -226,7 +228,7 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro /* Line 264 of yacc.c */ -#line 230 "libmemcached/csl/parser.cc" +#line 232 "libmemcached/csl/parser.cc" #ifdef short # undef short @@ -535,13 +537,13 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 170, 170, 171, 175, 177, 179, 181, 186, 191, - 195, 199, 210, 218, 226, 233, 237, 241, 245, 249, - 256, 263, 274, 281, 288, 295, 301, 305, 309, 313, - 317, 321, 325, 329, 333, 337, 341, 345, 352, 356, - 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, - 403, 404, 409, 410, 415, 419, 423, 427, 431, 435, - 439, 443, 447, 454, 458, 465, 469, 473 + 0, 172, 172, 173, 177, 179, 181, 183, 188, 193, + 197, 201, 212, 220, 228, 235, 239, 243, 247, 251, + 258, 265, 276, 283, 290, 297, 303, 307, 311, 315, + 319, 323, 327, 331, 335, 339, 343, 347, 354, 358, + 362, 366, 370, 374, 378, 382, 386, 390, 394, 398, + 405, 406, 411, 412, 417, 421, 425, 429, 433, 437, + 441, 445, 449, 456, 460, 467, 471, 475 }; #endif @@ -1533,28 +1535,28 @@ yyreduce: case 4: /* Line 1464 of yacc.c */ -#line 176 "libmemcached/csl/parser.yy" +#line 178 "libmemcached/csl/parser.yy" { ;} break; case 5: /* Line 1464 of yacc.c */ -#line 178 "libmemcached/csl/parser.yy" +#line 180 "libmemcached/csl/parser.yy" { ;} break; case 6: /* Line 1464 of yacc.c */ -#line 180 "libmemcached/csl/parser.yy" +#line 182 "libmemcached/csl/parser.yy" { ;} break; case 7: /* Line 1464 of yacc.c */ -#line 182 "libmemcached/csl/parser.yy" +#line 184 "libmemcached/csl/parser.yy" { context->set_end(); YYACCEPT; @@ -1564,7 +1566,7 @@ yyreduce: case 8: /* Line 1464 of yacc.c */ -#line 187 "libmemcached/csl/parser.yy" +#line 189 "libmemcached/csl/parser.yy" { context->rc= MEMCACHED_PARSE_USER_ERROR; parser_abort(context, NULL); @@ -1574,7 +1576,7 @@ yyreduce: case 9: /* Line 1464 of yacc.c */ -#line 192 "libmemcached/csl/parser.yy" +#line 194 "libmemcached/csl/parser.yy" { memcached_reset(context->memc); ;} @@ -1583,7 +1585,7 @@ yyreduce: case 10: /* Line 1464 of yacc.c */ -#line 196 "libmemcached/csl/parser.yy" +#line 198 "libmemcached/csl/parser.yy" { yydebug= 1; ;} @@ -1592,7 +1594,7 @@ yyreduce: case 11: /* Line 1464 of yacc.c */ -#line 200 "libmemcached/csl/parser.yy" +#line 202 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_parse_configure_file(*context->memc, (yyvsp[(3) - (3)].string).c_str, (yyvsp[(3) - (3)].string).size)) != MEMCACHED_SUCCESS) { @@ -1604,7 +1606,7 @@ yyreduce: case 12: /* Line 1464 of yacc.c */ -#line 211 "libmemcached/csl/parser.yy" +#line 213 "libmemcached/csl/parser.yy" { if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)))) { @@ -1617,7 +1619,7 @@ yyreduce: case 13: /* Line 1464 of yacc.c */ -#line 219 "libmemcached/csl/parser.yy" +#line 221 "libmemcached/csl/parser.yy" { if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)))) { @@ -1630,7 +1632,7 @@ yyreduce: case 14: /* Line 1464 of yacc.c */ -#line 227 "libmemcached/csl/parser.yy" +#line 229 "libmemcached/csl/parser.yy" { if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, (yyvsp[(2) - (3)].string).c_str, (yyvsp[(3) - (3)].number)))) { @@ -1642,7 +1644,7 @@ yyreduce: case 15: /* Line 1464 of yacc.c */ -#line 234 "libmemcached/csl/parser.yy" +#line 236 "libmemcached/csl/parser.yy" { memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size); ;} @@ -1651,7 +1653,7 @@ yyreduce: case 16: /* Line 1464 of yacc.c */ -#line 238 "libmemcached/csl/parser.yy" +#line 240 "libmemcached/csl/parser.yy" { context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number); ;} @@ -1660,7 +1662,7 @@ yyreduce: case 17: /* Line 1464 of yacc.c */ -#line 242 "libmemcached/csl/parser.yy" +#line 244 "libmemcached/csl/parser.yy" { context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number); ;} @@ -1669,7 +1671,7 @@ yyreduce: case 19: /* Line 1464 of yacc.c */ -#line 250 "libmemcached/csl/parser.yy" +#line 252 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_set_namespace(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size)) != MEMCACHED_SUCCESS) { @@ -1681,7 +1683,7 @@ yyreduce: case 20: /* Line 1464 of yacc.c */ -#line 257 "libmemcached/csl/parser.yy" +#line 259 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) { @@ -1693,7 +1695,7 @@ yyreduce: case 21: /* Line 1464 of yacc.c */ -#line 264 "libmemcached/csl/parser.yy" +#line 266 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS) { @@ -1709,7 +1711,7 @@ yyreduce: case 22: /* Line 1464 of yacc.c */ -#line 275 "libmemcached/csl/parser.yy" +#line 277 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS) { @@ -1721,7 +1723,7 @@ yyreduce: case 23: /* Line 1464 of yacc.c */ -#line 282 "libmemcached/csl/parser.yy" +#line 284 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS) { @@ -1733,7 +1735,7 @@ yyreduce: case 24: /* Line 1464 of yacc.c */ -#line 289 "libmemcached/csl/parser.yy" +#line 291 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS) { @@ -1745,7 +1747,7 @@ yyreduce: case 25: /* Line 1464 of yacc.c */ -#line 296 "libmemcached/csl/parser.yy" +#line 298 "libmemcached/csl/parser.yy" { ;} break; @@ -1753,7 +1755,7 @@ yyreduce: case 26: /* Line 1464 of yacc.c */ -#line 302 "libmemcached/csl/parser.yy" +#line 304 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS; ;} @@ -1762,7 +1764,7 @@ yyreduce: case 27: /* Line 1464 of yacc.c */ -#line 306 "libmemcached/csl/parser.yy" +#line 308 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT; ;} @@ -1771,7 +1773,7 @@ yyreduce: case 28: /* Line 1464 of yacc.c */ -#line 310 "libmemcached/csl/parser.yy" +#line 312 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK; ;} @@ -1780,7 +1782,7 @@ yyreduce: case 29: /* Line 1464 of yacc.c */ -#line 314 "libmemcached/csl/parser.yy" +#line 316 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK; ;} @@ -1789,7 +1791,7 @@ yyreduce: case 30: /* Line 1464 of yacc.c */ -#line 318 "libmemcached/csl/parser.yy" +#line 320 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH; ;} @@ -1798,7 +1800,7 @@ yyreduce: case 31: /* Line 1464 of yacc.c */ -#line 322 "libmemcached/csl/parser.yy" +#line 324 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS; ;} @@ -1807,7 +1809,7 @@ yyreduce: case 32: /* Line 1464 of yacc.c */ -#line 326 "libmemcached/csl/parser.yy" +#line 328 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT; ;} @@ -1816,7 +1818,7 @@ yyreduce: case 33: /* Line 1464 of yacc.c */ -#line 330 "libmemcached/csl/parser.yy" +#line 332 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT; ;} @@ -1825,7 +1827,7 @@ yyreduce: case 34: /* Line 1464 of yacc.c */ -#line 334 "libmemcached/csl/parser.yy" +#line 336 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT; ;} @@ -1834,7 +1836,7 @@ yyreduce: case 35: /* Line 1464 of yacc.c */ -#line 338 "libmemcached/csl/parser.yy" +#line 340 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT; ;} @@ -1843,7 +1845,7 @@ yyreduce: case 36: /* Line 1464 of yacc.c */ -#line 342 "libmemcached/csl/parser.yy" +#line 344 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE; ;} @@ -1852,7 +1854,7 @@ yyreduce: case 37: /* Line 1464 of yacc.c */ -#line 346 "libmemcached/csl/parser.yy" +#line 348 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE; ;} @@ -1861,7 +1863,7 @@ yyreduce: case 38: /* Line 1464 of yacc.c */ -#line 353 "libmemcached/csl/parser.yy" +#line 355 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL; ;} @@ -1870,7 +1872,7 @@ yyreduce: case 39: /* Line 1464 of yacc.c */ -#line 357 "libmemcached/csl/parser.yy" +#line 359 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS; ;} @@ -1879,7 +1881,7 @@ yyreduce: case 40: /* Line 1464 of yacc.c */ -#line 361 "libmemcached/csl/parser.yy" +#line 363 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY; ;} @@ -1888,7 +1890,7 @@ yyreduce: case 41: /* Line 1464 of yacc.c */ -#line 365 "libmemcached/csl/parser.yy" +#line 367 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY; ;} @@ -1897,7 +1899,7 @@ yyreduce: case 42: /* Line 1464 of yacc.c */ -#line 369 "libmemcached/csl/parser.yy" +#line 371 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ; ;} @@ -1906,7 +1908,7 @@ yyreduce: case 43: /* Line 1464 of yacc.c */ -#line 373 "libmemcached/csl/parser.yy" +#line 375 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS; ;} @@ -1915,7 +1917,7 @@ yyreduce: case 44: /* Line 1464 of yacc.c */ -#line 377 "libmemcached/csl/parser.yy" +#line 379 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS; ;} @@ -1924,7 +1926,7 @@ yyreduce: case 45: /* Line 1464 of yacc.c */ -#line 381 "libmemcached/csl/parser.yy" +#line 383 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY; ;} @@ -1933,7 +1935,7 @@ yyreduce: case 46: /* Line 1464 of yacc.c */ -#line 385 "libmemcached/csl/parser.yy" +#line 387 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE; ;} @@ -1942,7 +1944,7 @@ yyreduce: case 47: /* Line 1464 of yacc.c */ -#line 389 "libmemcached/csl/parser.yy" +#line 391 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE; ;} @@ -1951,7 +1953,7 @@ yyreduce: case 48: /* Line 1464 of yacc.c */ -#line 393 "libmemcached/csl/parser.yy" +#line 395 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP; ;} @@ -1960,7 +1962,7 @@ yyreduce: case 49: /* Line 1464 of yacc.c */ -#line 397 "libmemcached/csl/parser.yy" +#line 399 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY; ;} @@ -1969,35 +1971,35 @@ yyreduce: case 50: /* Line 1464 of yacc.c */ -#line 403 "libmemcached/csl/parser.yy" +#line 405 "libmemcached/csl/parser.yy" { (yyval.number)= MEMCACHED_DEFAULT_PORT;;} break; case 51: /* Line 1464 of yacc.c */ -#line 405 "libmemcached/csl/parser.yy" +#line 407 "libmemcached/csl/parser.yy" { ;} break; case 52: /* Line 1464 of yacc.c */ -#line 409 "libmemcached/csl/parser.yy" +#line 411 "libmemcached/csl/parser.yy" { (yyval.number)= 1; ;} break; case 53: /* Line 1464 of yacc.c */ -#line 411 "libmemcached/csl/parser.yy" +#line 413 "libmemcached/csl/parser.yy" { ;} break; case 54: /* Line 1464 of yacc.c */ -#line 416 "libmemcached/csl/parser.yy" +#line 418 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MD5; ;} @@ -2006,7 +2008,7 @@ yyreduce: case 55: /* Line 1464 of yacc.c */ -#line 420 "libmemcached/csl/parser.yy" +#line 422 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_CRC; ;} @@ -2015,7 +2017,7 @@ yyreduce: case 56: /* Line 1464 of yacc.c */ -#line 424 "libmemcached/csl/parser.yy" +#line 426 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_64; ;} @@ -2024,7 +2026,7 @@ yyreduce: case 57: /* Line 1464 of yacc.c */ -#line 428 "libmemcached/csl/parser.yy" +#line 430 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_64; ;} @@ -2033,7 +2035,7 @@ yyreduce: case 58: /* Line 1464 of yacc.c */ -#line 432 "libmemcached/csl/parser.yy" +#line 434 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_32; ;} @@ -2042,7 +2044,7 @@ yyreduce: case 59: /* Line 1464 of yacc.c */ -#line 436 "libmemcached/csl/parser.yy" +#line 438 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_32; ;} @@ -2051,7 +2053,7 @@ yyreduce: case 60: /* Line 1464 of yacc.c */ -#line 440 "libmemcached/csl/parser.yy" +#line 442 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_HSIEH; ;} @@ -2060,7 +2062,7 @@ yyreduce: case 61: /* Line 1464 of yacc.c */ -#line 444 "libmemcached/csl/parser.yy" +#line 446 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MURMUR; ;} @@ -2069,7 +2071,7 @@ yyreduce: case 62: /* Line 1464 of yacc.c */ -#line 448 "libmemcached/csl/parser.yy" +#line 450 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_JENKINS; ;} @@ -2078,7 +2080,7 @@ yyreduce: case 63: /* Line 1464 of yacc.c */ -#line 455 "libmemcached/csl/parser.yy" +#line 457 "libmemcached/csl/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); ;} @@ -2087,7 +2089,7 @@ yyreduce: case 64: /* Line 1464 of yacc.c */ -#line 459 "libmemcached/csl/parser.yy" +#line 461 "libmemcached/csl/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); ;} @@ -2096,7 +2098,7 @@ yyreduce: case 65: /* Line 1464 of yacc.c */ -#line 466 "libmemcached/csl/parser.yy" +#line 468 "libmemcached/csl/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT; ;} @@ -2105,7 +2107,7 @@ yyreduce: case 66: /* Line 1464 of yacc.c */ -#line 470 "libmemcached/csl/parser.yy" +#line 472 "libmemcached/csl/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA; ;} @@ -2114,7 +2116,7 @@ yyreduce: case 67: /* Line 1464 of yacc.c */ -#line 474 "libmemcached/csl/parser.yy" +#line 476 "libmemcached/csl/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM; ;} @@ -2123,7 +2125,7 @@ yyreduce: /* Line 1464 of yacc.c */ -#line 2127 "libmemcached/csl/parser.cc" +#line 2129 "libmemcached/csl/parser.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2335,7 +2337,7 @@ yyreturn: /* Line 1684 of yacc.c */ -#line 479 "libmemcached/csl/parser.yy" +#line 481 "libmemcached/csl/parser.yy" void Context::start() diff --git a/libmemcached/csl/parser.yy b/libmemcached/csl/parser.yy index fd8d0c26..08441987 100644 --- a/libmemcached/csl/parser.yy +++ b/libmemcached/csl/parser.yy @@ -42,7 +42,9 @@ #include #include +#ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" +#endif int conf_lex(YYSTYPE* lvalp, void* scanner); diff --git a/libmemcached/csl/scanner.cc b/libmemcached/csl/scanner.cc index c476019a..9d952463 100644 --- a/libmemcached/csl/scanner.cc +++ b/libmemcached/csl/scanner.cc @@ -6,16 +6,18 @@ #include #include +#ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif #define YY_EXTRA_TYPE Context* -#line 19 "libmemcached/csl/scanner.cc" +#line 21 "libmemcached/csl/scanner.cc" #define YY_INT_ALIGNED short int @@ -227,6 +229,11 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + /* %if-not-reentrant */ /* %endif */ @@ -257,11 +264,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -284,7 +286,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -381,7 +383,7 @@ static void config__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanne YY_BUFFER_STATE config__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE config__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE config__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE config__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); /* %endif */ @@ -1089,13 +1091,13 @@ static yyconst flex_int16_t yy_chk[1786] = static yyconst flex_int16_t yy_rule_linenum[65] = { 0, - 77, 79, 81, 83, 85, 88, 92, 94, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 125, 126, 128, 130, - 131, 132, 133, 134, 135, 137, 138, 141, 146, 147, - 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 160, 169, 187, 194 + 79, 81, 83, 85, 87, 90, 94, 96, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 127, 128, 130, 132, + 133, 134, 135, 136, 137, 139, 140, 143, 148, 149, + 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 162, 171, 189, 196 } ; /* The intent behind this definition is that it'll catch @@ -1126,7 +1128,7 @@ static yyconst flex_int16_t yy_rule_linenum[65] = * along with this program. If not, see . */ -#line 38 "libmemcached/csl/scanner.l" +#line 40 "libmemcached/csl/scanner.l" #include #include @@ -1150,7 +1152,7 @@ static yyconst flex_int16_t yy_rule_linenum[65] = #define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM) -#line 1154 "libmemcached/csl/scanner.cc" +#line 1156 "libmemcached/csl/scanner.cc" #define INITIAL 0 @@ -1186,8 +1188,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -1250,7 +1252,7 @@ FILE *config_get_out (yyscan_t yyscanner ); void config_set_out (FILE * out_str ,yyscan_t yyscanner ); -int config_get_leng (yyscan_t yyscanner ); +yy_size_t config_get_leng (yyscan_t yyscanner ); char *config_get_text (yyscan_t yyscanner ); @@ -1258,10 +1260,6 @@ int config_get_lineno (yyscan_t yyscanner ); void config_set_lineno (int line_number ,yyscan_t yyscanner ); -int config_get_column (yyscan_t yyscanner ); - -void config_set_column (int column_no ,yyscan_t yyscanner ); - /* %if-bison-bridge */ YYSTYPE * config_get_lval (yyscan_t yyscanner ); @@ -1325,7 +1323,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -1340,7 +1338,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1453,11 +1451,11 @@ YY_DECL struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* %% [7.0] user's declarations go here */ -#line 74 "libmemcached/csl/scanner.l" +#line 76 "libmemcached/csl/scanner.l" -#line 1461 "libmemcached/csl/scanner.cc" +#line 1459 "libmemcached/csl/scanner.cc" yylval = yylval_param; @@ -1576,28 +1574,28 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 77 "libmemcached/csl/scanner.l" +#line 79 "libmemcached/csl/scanner.l" { return yytext[0];} YY_BREAK case 2: YY_RULE_SETUP -#line 79 "libmemcached/csl/scanner.l" +#line 81 "libmemcached/csl/scanner.l" { yylval->number= atoi(yytext); return (NUMBER); } YY_BREAK case 3: YY_RULE_SETUP -#line 81 "libmemcached/csl/scanner.l" +#line 83 "libmemcached/csl/scanner.l" { yylval->number= atoi(yytext +1); return PORT; } YY_BREAK case 4: YY_RULE_SETUP -#line 83 "libmemcached/csl/scanner.l" +#line 85 "libmemcached/csl/scanner.l" { yylval->number= atoi(yytext +2); return WEIGHT_START; } YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP -#line 85 "libmemcached/csl/scanner.l" +#line 87 "libmemcached/csl/scanner.l" ; /* skip whitespace */ YY_BREAK case 6: @@ -1605,219 +1603,219 @@ case 6: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 88 "libmemcached/csl/scanner.l" +#line 90 "libmemcached/csl/scanner.l" { return COMMENT; } YY_BREAK case 7: YY_RULE_SETUP -#line 92 "libmemcached/csl/scanner.l" +#line 94 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; yyextra->set_server(); return yyextra->previous_token= SERVER; } YY_BREAK case 8: YY_RULE_SETUP -#line 94 "libmemcached/csl/scanner.l" +#line 96 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET; } YY_BREAK case 9: YY_RULE_SETUP -#line 96 "libmemcached/csl/scanner.l" +#line 98 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= BINARY_PROTOCOL; } YY_BREAK case 10: YY_RULE_SETUP -#line 97 "libmemcached/csl/scanner.l" +#line 99 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= BUFFER_REQUESTS; } YY_BREAK case 11: YY_RULE_SETUP -#line 98 "libmemcached/csl/scanner.l" +#line 100 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= CONFIGURE_FILE; } YY_BREAK case 12: YY_RULE_SETUP -#line 99 "libmemcached/csl/scanner.l" +#line 101 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= CONNECT_TIMEOUT; } YY_BREAK case 13: YY_RULE_SETUP -#line 100 "libmemcached/csl/scanner.l" +#line 102 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= DISTRIBUTION; } YY_BREAK case 14: YY_RULE_SETUP -#line 101 "libmemcached/csl/scanner.l" +#line 103 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= HASH_WITH_NAMESPACE; } YY_BREAK case 15: YY_RULE_SETUP -#line 102 "libmemcached/csl/scanner.l" +#line 104 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= HASH; } YY_BREAK case 16: YY_RULE_SETUP -#line 103 "libmemcached/csl/scanner.l" +#line 105 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= IO_BYTES_WATERMARK; } YY_BREAK case 17: YY_RULE_SETUP -#line 104 "libmemcached/csl/scanner.l" +#line 106 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= IO_KEY_PREFETCH; } YY_BREAK case 18: YY_RULE_SETUP -#line 105 "libmemcached/csl/scanner.l" +#line 107 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= IO_MSG_WATERMARK; } YY_BREAK case 19: YY_RULE_SETUP -#line 106 "libmemcached/csl/scanner.l" +#line 108 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= NOREPLY; } YY_BREAK case 20: YY_RULE_SETUP -#line 107 "libmemcached/csl/scanner.l" +#line 109 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= NUMBER_OF_REPLICAS; } YY_BREAK case 21: YY_RULE_SETUP -#line 108 "libmemcached/csl/scanner.l" +#line 110 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= POLL_TIMEOUT; } YY_BREAK case 22: YY_RULE_SETUP -#line 109 "libmemcached/csl/scanner.l" +#line 111 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= RANDOMIZE_REPLICA_READ; } YY_BREAK case 23: YY_RULE_SETUP -#line 110 "libmemcached/csl/scanner.l" +#line 112 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= RCV_TIMEOUT; } YY_BREAK case 24: YY_RULE_SETUP -#line 111 "libmemcached/csl/scanner.l" +#line 113 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= REMOVE_FAILED_SERVERS; } YY_BREAK case 25: YY_RULE_SETUP -#line 112 "libmemcached/csl/scanner.l" +#line 114 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= RETRY_TIMEOUT; } YY_BREAK case 26: YY_RULE_SETUP -#line 113 "libmemcached/csl/scanner.l" +#line 115 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SND_TIMEOUT; } YY_BREAK case 27: YY_RULE_SETUP -#line 114 "libmemcached/csl/scanner.l" +#line 116 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET_RECV_SIZE; } YY_BREAK case 28: YY_RULE_SETUP -#line 115 "libmemcached/csl/scanner.l" +#line 117 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SOCKET_SEND_SIZE; } YY_BREAK case 29: YY_RULE_SETUP -#line 116 "libmemcached/csl/scanner.l" +#line 118 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SORT_HOSTS; } YY_BREAK case 30: YY_RULE_SETUP -#line 117 "libmemcached/csl/scanner.l" +#line 119 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SUPPORT_CAS; } YY_BREAK case 31: YY_RULE_SETUP -#line 118 "libmemcached/csl/scanner.l" +#line 120 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_KEEPALIVE; } YY_BREAK case 32: YY_RULE_SETUP -#line 119 "libmemcached/csl/scanner.l" +#line 121 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_KEEPIDLE; } YY_BREAK case 33: YY_RULE_SETUP -#line 120 "libmemcached/csl/scanner.l" +#line 122 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= _TCP_NODELAY; } YY_BREAK case 34: YY_RULE_SETUP -#line 121 "libmemcached/csl/scanner.l" +#line 123 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= USE_UDP; } YY_BREAK case 35: YY_RULE_SETUP -#line 122 "libmemcached/csl/scanner.l" +#line 124 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= USER_DATA; } YY_BREAK case 36: YY_RULE_SETUP -#line 123 "libmemcached/csl/scanner.l" +#line 125 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= VERIFY_KEY; } YY_BREAK case 37: YY_RULE_SETUP -#line 125 "libmemcached/csl/scanner.l" +#line 127 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= POOL_MIN; } YY_BREAK case 38: YY_RULE_SETUP -#line 126 "libmemcached/csl/scanner.l" +#line 128 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= POOL_MAX; } YY_BREAK case 39: YY_RULE_SETUP -#line 128 "libmemcached/csl/scanner.l" +#line 130 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= NAMESPACE; } YY_BREAK case 40: YY_RULE_SETUP -#line 130 "libmemcached/csl/scanner.l" +#line 132 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= INCLUDE; } YY_BREAK case 41: YY_RULE_SETUP -#line 131 "libmemcached/csl/scanner.l" +#line 133 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= RESET; } YY_BREAK case 42: YY_RULE_SETUP -#line 132 "libmemcached/csl/scanner.l" +#line 134 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= PARSER_DEBUG; } YY_BREAK case 43: YY_RULE_SETUP -#line 133 "libmemcached/csl/scanner.l" +#line 135 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= SERVERS; } YY_BREAK case 44: YY_RULE_SETUP -#line 134 "libmemcached/csl/scanner.l" +#line 136 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= END; } YY_BREAK case 45: YY_RULE_SETUP -#line 135 "libmemcached/csl/scanner.l" +#line 137 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return yyextra->previous_token= ERROR; } YY_BREAK case 46: YY_RULE_SETUP -#line 137 "libmemcached/csl/scanner.l" +#line 139 "libmemcached/csl/scanner.l" { return yyextra->previous_token= TRUE; } YY_BREAK case 47: YY_RULE_SETUP -#line 138 "libmemcached/csl/scanner.l" +#line 140 "libmemcached/csl/scanner.l" { return yyextra->previous_token= FALSE; } YY_BREAK case 48: YY_RULE_SETUP -#line 141 "libmemcached/csl/scanner.l" +#line 143 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return UNKNOWN_OPTION; @@ -1825,67 +1823,67 @@ YY_RULE_SETUP YY_BREAK case 49: YY_RULE_SETUP -#line 146 "libmemcached/csl/scanner.l" +#line 148 "libmemcached/csl/scanner.l" { return CONSISTENT; } YY_BREAK case 50: YY_RULE_SETUP -#line 147 "libmemcached/csl/scanner.l" +#line 149 "libmemcached/csl/scanner.l" { return MODULA; } YY_BREAK case 51: YY_RULE_SETUP -#line 148 "libmemcached/csl/scanner.l" +#line 150 "libmemcached/csl/scanner.l" { return RANDOM; } YY_BREAK case 52: YY_RULE_SETUP -#line 150 "libmemcached/csl/scanner.l" +#line 152 "libmemcached/csl/scanner.l" { return MD5; } YY_BREAK case 53: YY_RULE_SETUP -#line 151 "libmemcached/csl/scanner.l" +#line 153 "libmemcached/csl/scanner.l" { return CRC; } YY_BREAK case 54: YY_RULE_SETUP -#line 152 "libmemcached/csl/scanner.l" +#line 154 "libmemcached/csl/scanner.l" { return FNV1_64; } YY_BREAK case 55: YY_RULE_SETUP -#line 153 "libmemcached/csl/scanner.l" +#line 155 "libmemcached/csl/scanner.l" { return FNV1A_64; } YY_BREAK case 56: YY_RULE_SETUP -#line 154 "libmemcached/csl/scanner.l" +#line 156 "libmemcached/csl/scanner.l" { return FNV1_32; } YY_BREAK case 57: YY_RULE_SETUP -#line 155 "libmemcached/csl/scanner.l" +#line 157 "libmemcached/csl/scanner.l" { return FNV1A_32; } YY_BREAK case 58: YY_RULE_SETUP -#line 156 "libmemcached/csl/scanner.l" +#line 158 "libmemcached/csl/scanner.l" { return HSIEH; } YY_BREAK case 59: YY_RULE_SETUP -#line 157 "libmemcached/csl/scanner.l" +#line 159 "libmemcached/csl/scanner.l" { return MURMUR; } YY_BREAK case 60: YY_RULE_SETUP -#line 158 "libmemcached/csl/scanner.l" +#line 160 "libmemcached/csl/scanner.l" { return JENKINS; } YY_BREAK case 61: YY_RULE_SETUP -#line 160 "libmemcached/csl/scanner.l" +#line 162 "libmemcached/csl/scanner.l" { yylval->server.port= MEMCACHED_DEFAULT_PORT; yylval->server.weight= 1; @@ -1897,7 +1895,7 @@ YY_RULE_SETUP YY_BREAK case 62: YY_RULE_SETUP -#line 169 "libmemcached/csl/scanner.l" +#line 171 "libmemcached/csl/scanner.l" { if (yyextra->is_server()) { @@ -1919,7 +1917,7 @@ YY_RULE_SETUP case 63: /* rule 63 can match eol */ YY_RULE_SETUP -#line 187 "libmemcached/csl/scanner.l" +#line 189 "libmemcached/csl/scanner.l" { config_get_text(yyscanner)[yyleng -1]= 0; yylval->string.c_str= yytext +1; @@ -1929,7 +1927,7 @@ YY_RULE_SETUP YY_BREAK case 64: YY_RULE_SETUP -#line 194 "libmemcached/csl/scanner.l" +#line 196 "libmemcached/csl/scanner.l" { yyextra->begin= yytext; return UNKNOWN; @@ -1937,10 +1935,10 @@ YY_RULE_SETUP YY_BREAK case 65: YY_RULE_SETUP -#line 199 "libmemcached/csl/scanner.l" +#line 201 "libmemcached/csl/scanner.l" ECHO; YY_BREAK -#line 1944 "libmemcached/csl/scanner.cc" +#line 1942 "libmemcached/csl/scanner.cc" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2140,7 +2138,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2154,7 +2152,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2185,7 +2183,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -2332,7 +2330,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2356,7 +2354,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( config_wrap(yyscanner ) ) - return EOF; + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -2678,7 +2676,7 @@ static void config_ensure_buffer_stack (yyscan_t yyscanner) /* %if-c++-only */ /* %endif */ { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -2782,12 +2780,11 @@ YY_BUFFER_STATE config__scan_string (yyconst char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE config__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE config__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2907,7 +2904,7 @@ FILE *config_get_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int config_get_leng (yyscan_t yyscanner) +yy_size_t config_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -3206,7 +3203,7 @@ void config_free (void * ptr , yyscan_t yyscanner) /* %ok-for-header */ -#line 199 "libmemcached/csl/scanner.l" +#line 201 "libmemcached/csl/scanner.l" diff --git a/libmemcached/csl/scanner.h b/libmemcached/csl/scanner.h index 20aba812..9262e5f8 100644 --- a/libmemcached/csl/scanner.h +++ b/libmemcached/csl/scanner.h @@ -10,16 +10,18 @@ #include #include +#ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif #define YY_EXTRA_TYPE Context* -#line 23 "libmemcached/csl/scanner.h" +#line 25 "libmemcached/csl/scanner.h" #define YY_INT_ALIGNED short int @@ -188,6 +190,11 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + /* %if-not-reentrant */ /* %endif */ @@ -196,11 +203,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; /* %endif */ /* %endif */ -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -223,7 +225,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -279,7 +281,7 @@ void config_pop_buffer_state (yyscan_t yyscanner ); YY_BUFFER_STATE config__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE config__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE config__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE config__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); /* %endif */ @@ -360,7 +362,7 @@ FILE *config_get_out (yyscan_t yyscanner ); void config_set_out (FILE * out_str ,yyscan_t yyscanner ); -int config_get_leng (yyscan_t yyscanner ); +yy_size_t config_get_leng (yyscan_t yyscanner ); char *config_get_text (yyscan_t yyscanner ); @@ -368,10 +370,6 @@ int config_get_lineno (yyscan_t yyscanner ); void config_set_lineno (int line_number ,yyscan_t yyscanner ); -int config_get_column (yyscan_t yyscanner ); - -void config_set_column (int column_no ,yyscan_t yyscanner ); - /* %if-bison-bridge */ YYSTYPE * config_get_lval (yyscan_t yyscanner ); @@ -471,9 +469,9 @@ extern int config_lex \ #undef YY_DECL #endif -#line 199 "libmemcached/csl/scanner.l" +#line 201 "libmemcached/csl/scanner.l" -#line 478 "libmemcached/csl/scanner.h" +#line 476 "libmemcached/csl/scanner.h" #undef config_IN_HEADER #endif /* config_HEADER_H */ diff --git a/libmemcached/csl/scanner.l b/libmemcached/csl/scanner.l index b52a316c..2c109509 100644 --- a/libmemcached/csl/scanner.l +++ b/libmemcached/csl/scanner.l @@ -25,9 +25,11 @@ #include #include +#ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif #define YY_EXTRA_TYPE Context* diff --git a/libtest/blobslap_worker.cc b/libtest/blobslap_worker.cc index 378f8268..7c7975ed 100644 --- a/libtest/blobslap_worker.cc +++ b/libtest/blobslap_worker.cc @@ -23,9 +23,6 @@ #include #include -#include - -using namespace libtest; #include #include @@ -44,7 +41,7 @@ using namespace libtest; #pragma GCC diagnostic ignored "-Wold-style-cast" #endif -using namespace libtest; +namespace libtest { class BlobslapWorker : public Server { @@ -170,11 +167,9 @@ bool BlobslapWorker::build(int argc, const char *argv[]) return true; } -namespace libtest { - Server *build_blobslap_worker(in_port_t try_port) { return new BlobslapWorker(try_port); } -} +} // namespace libtest diff --git a/libtest/common.h b/libtest/common.h index df271c8a..1e50bf08 100644 --- a/libtest/common.h +++ b/libtest/common.h @@ -53,10 +53,9 @@ #include #endif -static inline bool is_pid_valid(const pid_t pid) -{ - return (pid > 1) ? true : false; -} +#include + +#include #include #include @@ -64,5 +63,6 @@ static inline bool is_pid_valid(const pid_t pid) #include #include +#include +#include -#include diff --git a/libtest/comparison.hpp b/libtest/comparison.hpp index 09106d9f..a04038b6 100644 --- a/libtest/comparison.hpp +++ b/libtest/comparison.hpp @@ -22,7 +22,6 @@ #pragma once #include -#include #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED #include @@ -35,7 +34,7 @@ namespace libtest { template -bool _compare_true_hint(const char *file, int line, const char *func, T_comparable __expected, const char *assertation_label, T_hint __hint) +bool _compare_truth_hint(const char *file, int line, const char *func, T_comparable __expected, const char *assertation_label, T_hint __hint) { if (__expected == false) { @@ -102,6 +101,18 @@ bool _compare_zero(const char *file, int line, const char *func, T_comparable __ return true; } +template +bool _truth(const char *file, int line, const char *func, T_comparable __truth) +{ + if (bool(__truth)) + { + libtest::stream::make_cerr(file, line, func) << "Assertion failed for " << func << "() with \"" << __truth << "\""; + return false; + } + + return true; +} + template bool _compare_hint(const char *file, int line, const char *func, T_comparable __expected, T_comparable __actual, T_hint __hint) { diff --git a/libtest/core.cc b/libtest/core.cc new file mode 100644 index 00000000..3e30444a --- /dev/null +++ b/libtest/core.cc @@ -0,0 +1,44 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + + +namespace libtest { + +void create_core(void) +{ + if (getenv("LIBMEMCACHED_NO_COREDUMP") == NULL) + { + pid_t pid= fork(); + + if (pid == 0) + { + abort(); + } + else + { + while (waitpid(pid, NULL, 0) != pid) {}; + } + } +} + +} // namespace libtest diff --git a/libtest/core.h b/libtest/core.h index f787d0a1..2f6d8a79 100644 --- a/libtest/core.h +++ b/libtest/core.h @@ -22,5 +22,9 @@ #pragma once +namespace libtest { + LIBTEST_API void create_core(void); + +} // namespace libtest diff --git a/libtest/error.h b/libtest/error.h index e24c1791..3fa5bfa2 100644 --- a/libtest/error.h +++ b/libtest/error.h @@ -31,5 +31,12 @@ enum test_return_t { }; -#define test_failed(__test_return_t) ((__test_return_t) != TEST_SUCCESS) -#define test_success(__test_return_t) ((__test_return_t) == TEST_SUCCESS) +static inline bool test_success(test_return_t rc) +{ + return (rc == TEST_SUCCESS); +} + +static inline bool test_failed(test_return_t rc) +{ + return (rc != TEST_SUCCESS); +} diff --git a/libtest/include.am b/libtest/include.am index d49e5acc..e2921674 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -65,6 +65,8 @@ noinst_HEADERS+= \ libtest/framework.h \ libtest/gearmand.h \ libtest/get.h \ + libtest/is_pid.hpp \ + libtest/is_local.hpp \ libtest/killpid.h \ libtest/libtool.hpp \ libtest/memcached.h \ @@ -73,6 +75,7 @@ noinst_HEADERS+= \ libtest/server.h \ libtest/server_container.h \ libtest/signal.h \ + libtest/socket.hpp \ libtest/stats.h \ libtest/stream.h \ libtest/strerror.h \ @@ -86,7 +89,9 @@ noinst_LTLIBRARIES+= libtest/libtest.la libtest_libtest_la_SOURCES= \ libtest/binaries.cc \ libtest/cmdline.cc \ + libtest/core.cc \ libtest/framework.cc \ + libtest/is_local.cc \ libtest/killpid.cc \ libtest/libtool.cc \ libtest/port.cc \ @@ -94,6 +99,8 @@ libtest_libtest_la_SOURCES= \ libtest/server.cc \ libtest/server_container.cc \ libtest/signal.cc \ + libtest/socket.cc \ + libtest/strerror.cc \ libtest/test.cc libtest_libtest_la_CXXFLAGS= ${AM_CXXFLAGS} diff --git a/libtest/is_local.cc b/libtest/is_local.cc new file mode 100644 index 00000000..dfc303b2 --- /dev/null +++ b/libtest/is_local.cc @@ -0,0 +1,33 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + + +namespace libtest { + +bool test_is_local() +{ + return (getenv("LIBTEST_LOCAL")); +} + +} // namespace libtest + diff --git a/libtest/is_local.hpp b/libtest/is_local.hpp new file mode 100644 index 00000000..30da3082 --- /dev/null +++ b/libtest/is_local.hpp @@ -0,0 +1,27 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +namespace libtest { + +LIBTEST_API +bool test_is_local(); + +} // namespace libtest diff --git a/libtest/is_pid.hpp b/libtest/is_pid.hpp new file mode 100644 index 00000000..a4539bc0 --- /dev/null +++ b/libtest/is_pid.hpp @@ -0,0 +1,26 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +static inline bool is_pid_valid(const pid_t pid) +{ + return (pid > 1) ? true : false; +} + diff --git a/libtest/port.cc b/libtest/port.cc index 9bd7717f..36939e14 100644 --- a/libtest/port.cc +++ b/libtest/port.cc @@ -47,6 +47,8 @@ using namespace libtest; static in_port_t global_port= 0; static in_port_t global_max_port= 0; +namespace libtest { + in_port_t default_port() { return global_port; @@ -71,3 +73,5 @@ void set_max_port(in_port_t port) global_max_port= port; } + +} // namespace libtest diff --git a/libtest/port.h b/libtest/port.h index 63b29929..20891254 100644 --- a/libtest/port.h +++ b/libtest/port.h @@ -26,6 +26,8 @@ #pragma once +namespace libtest { + LIBTEST_API in_port_t default_port(); @@ -37,3 +39,5 @@ in_port_t max_port(); LIBTEST_API void set_max_port(in_port_t port); + +} // namespace libtest diff --git a/libtest/signal.h b/libtest/signal.h index 5cc823ac..25eae45c 100644 --- a/libtest/signal.h +++ b/libtest/signal.h @@ -25,6 +25,7 @@ #include #include +#include enum shutdown_t { SHUTDOWN_RUNNING, diff --git a/libtest/socket.cc b/libtest/socket.cc new file mode 100644 index 00000000..d4ab2970 --- /dev/null +++ b/libtest/socket.cc @@ -0,0 +1,42 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +static char global_socket[1024]; + +namespace libtest { + +const char *default_socket() +{ + assert(global_socket[0]); + return global_socket; +} + +void set_default_socket(const char *socket) +{ + if (socket) + { + strncpy(global_socket, socket, strlen(socket)); + } +} + +} diff --git a/libtest/socket.hpp b/libtest/socket.hpp new file mode 100644 index 00000000..d6be17a0 --- /dev/null +++ b/libtest/socket.hpp @@ -0,0 +1,31 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +namespace libtest { + +const char *default_socket(); + +void set_default_socket(const char *socket); + +} // namespace libtest + diff --git a/libtest/strerror.cc b/libtest/strerror.cc new file mode 100644 index 00000000..74440f51 --- /dev/null +++ b/libtest/strerror.cc @@ -0,0 +1,48 @@ +/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: + * + * libtest + * + * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +namespace libtest { + +const char *test_strerror(test_return_t code) +{ + switch (code) { + case TEST_SUCCESS: + return "ok"; + + case TEST_FAILURE: + return "failed"; + + case TEST_MEMORY_ALLOCATION_FAILURE: + return "memory allocation"; + + case TEST_SKIPPED: + return "skipped"; + + case TEST_FATAL: + break; + } + + return "failed"; +} + +} // namespace libtest diff --git a/libtest/strerror.h b/libtest/strerror.h index 5f21b83c..861c84b6 100644 --- a/libtest/strerror.h +++ b/libtest/strerror.h @@ -21,8 +21,12 @@ #pragma once +namespace libtest { + /** @note Friendly print function for errors. */ LIBTEST_API const char *test_strerror(test_return_t code); + +} // namespace libtest diff --git a/libtest/test.cc b/libtest/test.cc index bae5c39f..b7f58442 100644 --- a/libtest/test.cc +++ b/libtest/test.cc @@ -35,36 +35,12 @@ #include -#include -#include - #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" #endif using namespace libtest; -static char global_socket[1024]; - -const char *default_socket() -{ - assert(global_socket[0]); - return global_socket; -} - -bool test_is_local() -{ - return (getenv("LIBTEST_LOCAL")); -} - -void set_default_socket(const char *socket) -{ - if (socket) - { - strncpy(global_socket, socket, strlen(socket)); - } -} - static void stats_print(Stats *stats) { if (stats->collection_failed == 0 and stats->collection_success == 0) @@ -94,45 +70,6 @@ static long int timedif(struct timeval a, struct timeval b) return s + us; } -const char *test_strerror(test_return_t code) -{ - switch (code) { - case TEST_SUCCESS: - return "ok"; - - case TEST_FAILURE: - return "failed"; - - case TEST_MEMORY_ALLOCATION_FAILURE: - return "memory allocation"; - - case TEST_SKIPPED: - return "skipped"; - - case TEST_FATAL: - break; - } - - return "failed"; -} - -void create_core(void) -{ - if (getenv("LIBMEMCACHED_NO_COREDUMP") == NULL) - { - pid_t pid= fork(); - - if (pid == 0) - { - abort(); - } - else - { - while (waitpid(pid, NULL, 0) != pid) {}; - } - } -} - static Framework *world= NULL; int main(int argc, char *argv[]) { diff --git a/libtest/test.h b/libtest/test.h index d195dd56..e92d9e23 100644 --- a/libtest/test.h +++ b/libtest/test.h @@ -26,9 +26,6 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #endif -#include -#include - /** A structure describing the test case. */ @@ -45,7 +42,7 @@ do \ fprintf(stderr, "\n%s:%d: Assertion failed for %s: ", __FILE__, __LINE__, __func__);\ perror(#A); \ fprintf(stderr, "\n"); \ - create_core(); \ + libtest::create_core(); \ assert((A)); \ } \ } while (0) @@ -56,7 +53,7 @@ do \ if ((A)) { \ fprintf(stderr, "\n%s:%d: Assertion failed %s, with message %s, in %s", __FILE__, __LINE__, (B), #A, __func__ );\ fprintf(stderr, "\n"); \ - create_core(); \ + libtest::create_core(); \ assert((A)); \ } \ } while (0) @@ -66,7 +63,7 @@ do \ { \ if (! (A)) { \ fprintf(stderr, "\n%s:%d: Assertion \"%s\" failed, in %s\n", __FILE__, __LINE__, #A, __func__);\ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -76,7 +73,7 @@ do \ { \ if (! (A)) { \ fprintf(stderr, "\n%s:%d: Assertion \"%s\" failed, in %s\n", __FILE__, __LINE__, #A, __func__);\ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -84,9 +81,9 @@ do \ #define test_true_got(__expected, __hint) \ do \ { \ - if (not libtest::_compare_true_hint(__FILE__, __LINE__, __func__, ((__expected)), #__expected, ((__hint)))) \ + if (not libtest::_compare_truth_hint(__FILE__, __LINE__, __func__, ((__expected)), #__expected, ((__hint)))) \ { \ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -105,7 +102,7 @@ do \ { \ if (1) { \ fprintf(stderr, "\n%s:%d: Failed with %s, in %s\n", __FILE__, __LINE__, #A, __func__);\ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -116,7 +113,7 @@ do \ { \ if ((A)) { \ fprintf(stderr, "\n%s:%d: Assertion failed %s, in %s\n", __FILE__, __LINE__, #A, __func__);\ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -126,7 +123,7 @@ do \ { \ if ((A)) { \ fprintf(stderr, "\n%s:%d: Assertion failed %s with %s\n", __FILE__, __LINE__, #A, (B));\ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -136,7 +133,7 @@ do \ { \ if (not libtest::_compare(__FILE__, __LINE__, __func__, ((__expected)), ((__actual)))) \ { \ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -146,7 +143,7 @@ do \ { \ if (not libtest::_compare_zero(__FILE__, __LINE__, __func__, ((__actual)))) \ { \ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -156,11 +153,35 @@ do \ { \ if (not libtest::_compare_hint(__FILE__, __LINE__, __func__, (__expected), (__actual), (__hint))) \ { \ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) +#define test_compare_warn(__expected, __actual) \ +do \ +{ \ + void(libtest::_compare(__FILE__, __LINE__, __func__, (__expected), (__actual))); \ +} while (0) + +#define test_compare_warn_hint(__expected, __actual, __hint) \ +do \ +{ \ + libtest::_compare_hint(__FILE__, __LINE__, __func__, (__expected), (__actual), (__hint)); \ +} while (0) + +#define test_warn(__truth) \ +do \ +{ \ + void(libtest::_truth(__FILE__, __LINE__, __func__, (__truth))); \ +} while (0) + +#define test_warn_hint(__truth, __hint) \ +do \ +{ \ + void(libtest::_compare_truth_hint(__FILE__, __LINE__, __func__, (__truth), #__truth, (__hint))); \ +} while (0) + #define test_strcmp(A,B) \ do \ @@ -168,7 +189,7 @@ do \ if (strcmp((A), (B))) \ { \ fprintf(stderr, "\n%s:%d: Expected %s, got %s\n", __FILE__, __LINE__, (A), (B)); \ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) @@ -179,7 +200,7 @@ do \ if (memcmp((A), (B), (C))) \ { \ fprintf(stderr, "\n%s:%d: %.*s -> %.*s\n", __FILE__, __LINE__, (int)(C), (char *)(A), (int)(C), (char *)(B)); \ - create_core(); \ + libtest::create_core(); \ return TEST_FAILURE; \ } \ } while (0) diff --git a/libtest/test.hpp b/libtest/test.hpp index db702943..c30fbfc0 100644 --- a/libtest/test.hpp +++ b/libtest/test.hpp @@ -33,15 +33,19 @@ #include #include +#include +#include +#include #include #include #include #include #include -#include #include #include #include +#include +#include #include #include #include @@ -50,20 +54,3 @@ #include #include #include - -#pragma once - -LIBTEST_API -in_port_t default_port(); - -LIBTEST_API -void set_default_port(in_port_t port); - -LIBTEST_API -const char* default_socket(); - -LIBTEST_API -void set_default_socket(const char *socket); - -LIBTEST_API -bool test_is_local(void); diff --git a/libtest/version.h.in b/libtest/version.h.in index 16c4656b..eade4cf7 100644 --- a/libtest/version.h.in +++ b/libtest/version.h.in @@ -22,13 +22,5 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - #define LIBTEST_VERSION_STRING "@VERSION@" #define LIBTEST_VERSION_HEX @HEX_VERSION@ - -#ifdef __cplusplus -} -#endif diff --git a/libtest/visibility.h b/libtest/visibility.h index 20d84ccc..7b495e87 100644 --- a/libtest/visibility.h +++ b/libtest/visibility.h @@ -23,32 +23,41 @@ #pragma once #if defined(BUILDING_LIBTEST) -# if defined(HAVE_VISIBILITY) +# if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY # define LIBTEST_API __attribute__ ((visibility("default"))) -# define LIBTEST_INTERNAL_API __attribute__ ((visibility("hidden"))) -# define LIBTEST_API_DEPRECATED __attribute__ ((deprecated,visibility("default"))) -# define LIBTEST_LOCAL __attribute__ ((visibility("hidden"))) +# define LIBTEST_LOCAL __attribute__ ((visibility("default"))) # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) # define LIBTEST_API __global -# define LIBTEST_INTERNAL_API __hidden -# define LIBTEST_API_DEPRECATED __global -# define LIBTEST_LOCAL __hidden +# define LIBTEST_LOCAL __global # elif defined(_MSC_VER) -# define LIBTEST_API extern __declspec(dllexport) -# define LIBTEST_INTERNAL_API extern __declspec(dllexport) -# define LIBTEST_DEPRECATED_API extern __declspec(dllexport) -# define LIBTEST_LOCAL -# endif /* defined(HAVE_VISIBILITY) */ -#else /* defined(BUILDING_LIBTEST) */ -# if defined(_MSC_VER) -# define LIBTEST_API extern __declspec(dllimport) -# define LIBTEST_INTERNAL_API extern __declspec(dllimport) -# define LIBTEST_API_DEPRECATED extern __declspec(dllimport) -# define LIBTEST_LOCAL +# define LIBTEST_API extern __declspec(dllexport) +# define LIBTEST_LOCAL extern __declspec(dllexport) # else # define LIBTEST_API -# define LIBTEST_INTERNAL_API -# define LIBTEST_API_DEPRECATED # define LIBTEST_LOCAL -# endif /* defined(_MSC_VER) */ -#endif /* defined(BUILDING_LIBTEST) */ +# endif +#else +# if defined(BUILDING_LIBTEST) +# if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY +# define LIBTEST_API __attribute__ ((visibility("default"))) +# define LIBTEST_LOCAL __attribute__ ((visibility("hidden"))) +# elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define LIBTEST_API __global +# define LIBTEST_LOCAL __hidden +# elif defined(_MSC_VER) +# define LIBTEST_API extern __declspec(dllexport) +# define LIBTEST_LOCAL +# else +# define LIBTEST_API +# define LIBTEST_LOCAL +# endif /* defined(HAVE_VISIBILITY) */ +# else /* defined(BUILDING_LIBTEST) */ +# if defined(_MSC_VER) +# define LIBTEST_API extern __declspec(dllimport) +# define LIBTEST_LOCAL +# else +# define LIBTEST_API +# define LIBTEST_LOCAL +# endif /* defined(_MSC_VER) */ +# endif /* defined(BUILDING_LIBTEST) */ +#endif /* defined(BUILDING_LIBTESTINTERNAL) */ diff --git a/m4/pandora_libtool.m4 b/m4/pandora_libtool.m4 deleted file mode 100644 index 85456198..00000000 --- a/m4/pandora_libtool.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl Copyright (C) 2009 Sun Microsystems, Inc. -dnl This file is free software; Sun Microsystems, Inc. -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([PANDORA_LIBTOOL],[ - AC_REQUIRE([AC_DISABLE_STATIC]) - AC_REQUIRE([AC_PROG_LIBTOOL]) - m4_ifndef([LT_PREREQ],[ - pandora_have_old_libtool=yes - ],[ - pandora_have_old_libtool=no - ]) - AS_IF([test "$SUNCC" = "yes" -a "${pandora_have_old_libtool}" = "yes"],[ - AC_MSG_ERROR([Building ${PACKAGE} with Sun Studio requires at least libtool 2.2]) - ]) - - dnl By requiring AC_PROG_LIBTOOL, we should force the macro system to read - dnl libtool.m4, where in 2.2 AC_PROG_LIBTOOL is an alias for LT_INIT - dnl Then, if we're on 2.2, we should have LT_LANG, so we'll call it. - m4_ifdef([LT_LANG],[ - LT_LANG(C) - LT_LANG(C++) - ]) -]) diff --git a/m4/pandora_visibility.m4 b/m4/pandora_visibility.m4 deleted file mode 100644 index f0baa601..00000000 --- a/m4/pandora_visibility.m4 +++ /dev/null @@ -1,75 +0,0 @@ -dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc. -dnl Copyright (C) 2009 Monty Taylor -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl Tests whether the compiler supports the command-line option -dnl -fvisibility=hidden and the function and variable attributes -dnl __attribute__((__visibility__("hidden"))) and -dnl __attribute__((__visibility__("default"))). -dnl Does *not* test for __visibility__("protected") - which has tricky -dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on -dnl MacOS X. -dnl Does *not* test for __visibility__("internal") - which has processor -dnl dependent semantics. -dnl Does *not* test for #pragma GCC visibility push(hidden) - which is -dnl "really only recommended for legacy code". -dnl Set the variable CFLAG_VISIBILITY. -dnl Defines and sets the variable HAVE_VISIBILITY. - -AC_DEFUN([PANDORA_CHECK_VISIBILITY], -[ - AC_REQUIRE([AC_PROG_CC]) - CFLAG_VISIBILITY= - HAVE_VISIBILITY=0 - AS_IF([test -n "$GCC"],[ - AC_MSG_CHECKING([for simple visibility declarations]) - AC_CACHE_VAL([gl_cv_cc_visibility], [ - gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden -Werror" - AC_TRY_COMPILE( - [extern __attribute__((__visibility__("hidden"))) int hiddenvar; - extern __attribute__((__visibility__("default"))) int exportedvar; - extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); - extern __attribute__((__visibility__("default"))) int exportedfunc (void);], - [],[ - case "$host_os" in - *darwin*) - gl_cv_cc_visibility=no - ;; - *) - gl_cv_cc_visibility=yes - ;; - esac - ],[gl_cv_cc_visibility=no]) - CFLAGS="$gl_save_CFLAGS"]) - AC_MSG_RESULT([$gl_cv_cc_visibility]) - if test $gl_cv_cc_visibility = yes; then - CFLAG_VISIBILITY="-fvisibility=hidden" - CXXFLAG_VISIBILITY="-fvisibility=hidden -fvisibility-inlines-hidden" - NO_VISIBILITY="-fvisibility=default" - HAVE_VISIBILITY=1 - fi - ]) - AS_IF([test "x$SUNCC" = "xyes"],[ - CFLAG_VISIBILITY="-xldscope=hidden" - CXXFLAG_VISIBILITY="-xldscope=hidden" - NO_VISIBILITY="-xldscope=global" - HAVE_VISIBILITY=1 - ]) - AC_SUBST([CFLAG_VISIBILITY]) - AC_SUBST([CXXFLAG_VISIBILITY]) - AC_SUBST([NO_VISIBILITY]) - AC_SUBST([HAVE_VISIBILITY]) - AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], - [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) -]) - -AC_DEFUN([PANDORA_ENABLE_VISIBILITY],[ - AC_REQUIRE([PANDORA_CHECK_VISIBILITY]) - AM_CFLAGS="${AM_CFLAGS} ${CFLAG_VISIBILITY}" - AM_CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAG_VISIBILITY}" -]) diff --git a/tests/basic.h b/tests/basic.h index 7c1536ef..cb9669ff 100644 --- a/tests/basic.h +++ b/tests/basic.h @@ -43,22 +43,22 @@ extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t basic_init_test(memcached_st *junk); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t basic_clone_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t basic_reset_stack_test(memcached_st *junk); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t basic_reset_heap_test(memcached_st *junk); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t basic_reset_stack_clone_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t basic_reset_heap_clone_test(memcached_st *memc); #ifdef __cplusplus diff --git a/tests/debug.cc b/tests/debug.cc index 0b091a8d..5e72a0b6 100644 --- a/tests/debug.cc +++ b/tests/debug.cc @@ -97,7 +97,7 @@ static memcached_return_t server_wrapper_for_dump_callback(const memcached_st *, } -test_return_t confirm_keys_exist(memcached_st *memc, const char * const *keys, const size_t number_of_keys, bool key_matches_value) +test_return_t confirm_keys_exist(memcached_st *memc, const char * const *keys, const size_t number_of_keys, bool key_matches_value, bool require_all) { for (size_t x= 0; x < number_of_keys; ++x) { @@ -107,12 +107,27 @@ test_return_t confirm_keys_exist(memcached_st *memc, const char * const *keys, c test_string_make_from_cstr(keys[x]), // Keys &value_length, 0, &rc); - test_true_got(value, keys[x]); - if (key_matches_value) + if (require_all) { - test_strcmp(keys[x], value); + test_true_got(value, keys[x]); + if (key_matches_value) + { + test_strcmp(keys[x], value); + } + } + else if (memcached_success(rc)) + { + test_warn_hint(value, keys[x]); + if (value and key_matches_value) + { + test_strcmp(keys[x], value); + } + } + + if (value) + { + free(value); } - free(value); } return TEST_SUCCESS; diff --git a/tests/debug.h b/tests/debug.h index ad20b562..46d77e4c 100644 --- a/tests/debug.h +++ b/tests/debug.h @@ -37,7 +37,7 @@ #pragma once -test_return_t confirm_keys_exist(memcached_st *memc, const char * const *keys, const size_t number_of_keys, bool key_matches_value= false); +test_return_t confirm_keys_exist(memcached_st *memc, const char * const *keys, const size_t number_of_keys, bool key_matches_value= false, bool require_all= false); test_return_t confirm_keys_dont_exist(memcached_st *memc, const char * const *keys, const size_t number_of_keys); diff --git a/tests/mem_functions.cc b/tests/mem_functions.cc index 12758eeb..b6d080ef 100644 --- a/tests/mem_functions.cc +++ b/tests/mem_functions.cc @@ -3316,7 +3316,7 @@ static test_return_t mget_read(memcached_st *memc) unsigned int keys_returned; test_compare(TEST_SUCCESS, fetch_all_results(memc, keys_returned, MEMCACHED_SUCCESS)); test_true(keys_returned > 0); - test_compare_got(global_count, keys_returned, "Possible false, positive, memcached may have ejected key/value based on memory needs"); + test_compare_warn_hint(global_count, keys_returned, "Possible false, positive, memcached may have ejected key/value based on memory needs"); } return TEST_SUCCESS; diff --git a/tests/memcapable.cc b/tests/memcapable.cc index f2e347dd..65db1698 100644 --- a/tests/memcapable.cc +++ b/tests/memcapable.cc @@ -58,7 +58,7 @@ static test_return_t help_test(void *) snprintf(buffer, sizeof(buffer), "-p %d", int(default_port())); const char *args[]= { buffer, "--help", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -68,7 +68,7 @@ static test_return_t ascii_test(void *) snprintf(buffer, sizeof(buffer), "-p %d", int(default_port())); const char *args[]= { buffer, " -a ", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -78,7 +78,7 @@ static test_return_t binary_test(void *) snprintf(buffer, sizeof(buffer), "-p %d", int(default_port())); const char *args[]= { buffer, " -b ", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } diff --git a/tests/memslap.cc b/tests/memslap.cc index 45bb6e5b..544ed280 100644 --- a/tests/memslap.cc +++ b/tests/memslap.cc @@ -56,7 +56,7 @@ static test_return_t help_test(void *) { const char *args[]= { "--help", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -66,7 +66,7 @@ static test_return_t server_test(void *) snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -76,7 +76,7 @@ static test_return_t server_concurrency_test(void *) snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, "--concurrency=10", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -86,7 +86,7 @@ static test_return_t server_concurrency_initial_load_test(void *) snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, "--concurrency=10", "--initial-load=1000", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -96,7 +96,7 @@ static test_return_t server_concurrency_initial_load_execute_number_test(void *) snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, "--concurrency=10", "--initial-load=1000", "--execute-number=10", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -106,7 +106,7 @@ static test_return_t server_concurrency_initial_load_execute_number_test_get_tes snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, "--concurrency=10", "--initial-load=1000", "--execute-number=10", "--test=get", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -116,7 +116,7 @@ static test_return_t server_concurrency_initial_load_execute_number_test_set_tes snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, "--concurrency=10", "--initial-load=1000", "--execute-number=10", "--test=set", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } @@ -126,7 +126,7 @@ static test_return_t server_concurrency_initial_load_execute_number_test_set_non snprintf(buffer, sizeof(buffer), "--servers=localhost:%d", int(default_port())); const char *args[]= { buffer, "--concurrency=10", "--initial-load=1000", "--execute-number=10", "--test=set", "--non-blocking", 0 }; - test_success(exec_cmdline(executable, args)); + test_true(exec_cmdline(executable, args)); return TEST_SUCCESS; } diff --git a/tests/namespace.h b/tests/namespace.h index 600da6de..a3d6a10f 100644 --- a/tests/namespace.h +++ b/tests/namespace.h @@ -37,5 +37,5 @@ #pragma once -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t memcached_increment_namespace(memcached_st *memc); diff --git a/tests/parser.cc b/tests/parser.cc index 45ffd2d0..dd8062c2 100644 --- a/tests/parser.cc +++ b/tests/parser.cc @@ -648,7 +648,11 @@ test_return_t regression_bug_71231153_poll(memcached_st *) char *value= memcached_get(memc, test_literal_param("test"), &value_len, NULL, &rc); test_false(value); test_zero(value_len); +#ifdef __APPLE__ + test_compare_got(MEMCACHED_CONNECTION_FAILURE, rc, memcached_last_error_message(memc)); +#else test_compare_got(MEMCACHED_TIMEOUT, rc, memcached_last_error_message(memc)); +#endif memcached_free(memc); } diff --git a/tests/parser.h b/tests/parser.h index 05272ee6..73356dad 100644 --- a/tests/parser.h +++ b/tests/parser.h @@ -41,73 +41,73 @@ extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t server_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t servers_bad_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t behavior_parser_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t parser_number_options_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t parser_distribution_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t parser_hash_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t parser_boolean_options_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t parser_key_prefix_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t libmemcached_check_configuration_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t memcached_create_with_options_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t memcached_create_with_options_with_filename(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t libmemcached_check_configuration_with_filename_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t random_statement_build_test(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_include_keyword(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_end_keyword(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_reset_keyword(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_error_keyword(memcached_st*); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t server_with_weight_test(memcached_st *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_hostname_port_weight(memcached_st *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t regression_bug_71231153_connect(memcached_st *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t regression_bug_71231153_poll(memcached_st *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_parse_socket(memcached_st *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t test_namespace_keyword(memcached_st*); #ifdef __cplusplus diff --git a/tests/plus.cpp b/tests/plus.cpp index aad1abf1..1b5631d1 100644 --- a/tests/plus.cpp +++ b/tests/plus.cpp @@ -253,27 +253,23 @@ static test_return_t error_memcached_return_t_test(memcached_st *) return TEST_SUCCESS; } -#ifndef __INTEL_COMPILER -#pragma GCC diagnostic ignored "-fpermissive" -#endif - test_st error_tests[] ={ - { "error()", 0, error_test }, - { "error(std::string&)", 0, error_std_string_test }, - { "error(memcached_return_t&)", 0, error_memcached_return_t_test }, + { "error()", false, reinterpret_cast(error_test) }, + { "error(std::string&)", false, reinterpret_cast(error_std_string_test) }, + { "error(memcached_return_t&)", false, reinterpret_cast(error_memcached_return_t_test) }, {0, 0, 0} }; test_st tests[] ={ - { "basic", 0, + { "basic", false, reinterpret_cast(basic_test) }, - { "basic_master_key", 0, + { "basic_master_key", false, reinterpret_cast(basic_master_key_test) }, - { "increment_test", 0, + { "increment_test", false, reinterpret_cast(increment_test) }, - { "mget", 1, + { "mget", true, reinterpret_cast(mget_test) }, - { "basic_behavior", 0, + { "basic_behavior", false, reinterpret_cast(basic_behavior) }, {0, 0, 0} }; diff --git a/tests/pool.h b/tests/pool.h index ff4d47c7..ebaaed1f 100644 --- a/tests/pool.h +++ b/tests/pool.h @@ -41,7 +41,7 @@ extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t memcached_pool_test(memcached_st *); #ifdef __cplusplus diff --git a/tests/print.h b/tests/print.h index 8daee5c6..2b30143d 100644 --- a/tests/print.h +++ b/tests/print.h @@ -41,7 +41,7 @@ extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL memcached_return_t server_print_callback(const memcached_st *ptr, const memcached_server_st *server, void *context); diff --git a/tests/replication.cc b/tests/replication.cc index 94f0eba0..be1fd7e2 100644 --- a/tests/replication.cc +++ b/tests/replication.cc @@ -266,8 +266,8 @@ test_return_t replication_delete_test(memcached_st *memc_just_cloned) memcached_flush_buffers(memc_replicated); // Confirm keys with replication read - test_compare(TEST_SUCCESS, confirm_keys_exist(memc_replicated, keys, test_array_length(keys), true)); - test_compare(TEST_SUCCESS, confirm_keys_exist(memc_not_replicate, keys, test_array_length(keys), true)); + test_compare(TEST_SUCCESS, confirm_keys_exist(memc_replicated, keys, test_array_length(keys), true, true)); + test_compare(TEST_SUCCESS, confirm_keys_exist(memc_not_replicate, keys, test_array_length(keys), true, true)); /* Delete the items from all of the servers except 1, we use the non replicated memc so that we know we deleted the keys */ for (size_t x= 0; x < test_array_length(keys); ++x) diff --git a/tests/replication.h b/tests/replication.h index 98b0cdb9..1bf4e499 100644 --- a/tests/replication.h +++ b/tests/replication.h @@ -41,22 +41,22 @@ extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t replication_set_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t replication_get_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t replication_mget_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t replication_delete_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t replication_randomize_mget_test(memcached_st *memc); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t replication_randomize_mget_fail_test(memcached_st *memc); #ifdef __cplusplus diff --git a/tests/string.h b/tests/string.h index e8848fb9..7abbe713 100644 --- a/tests/string.h +++ b/tests/string.h @@ -41,25 +41,25 @@ extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_static_null(void *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_alloc_null(void *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_alloc_with_size(void *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_alloc_with_size_toobig(void *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_alloc_append(void *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_alloc_append_toobig(void *); -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t string_alloc_append_multiple(void *); #ifdef __cplusplus diff --git a/tests/virtual_buckets.h b/tests/virtual_buckets.h index dee47694..297ee106 100644 --- a/tests/virtual_buckets.h +++ b/tests/virtual_buckets.h @@ -43,7 +43,7 @@ struct memcached_st; extern "C" { #endif -LIBTEST_INTERNAL_API +LIBTEST_LOCAL test_return_t virtual_back_map(memcached_st *); #ifdef __cplusplus