#!/bin/sh
-autoreconf -ivf -Wall
+autoreconf --install --force --verbose -Wall
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])
esac
dnl Specialty checks
-ACX_PTHREAD
+AX_PTHREAD
CONFIG_EXTRA
DETECT_BYTEORDER
ENABLE_UTILLIB
#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);
#include <libmemcached/common.h>
#include <sys/types.h>
+#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
/*
These functions provide data and function callback support
#include <libmemcached/csl/symbol.h>
#include <libmemcached/csl/scanner.h>
+#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wold-style-cast"
+#endif
int conf_lex(YYSTYPE* lvalp, void* scanner);
/* Line 189 of yacc.c */
-#line 118 "libmemcached/csl/parser.cc"
+#line 120 "libmemcached/csl/parser.cc"
/* Enabling traces. */
#ifndef YYDEBUG
/* Line 264 of yacc.c */
-#line 230 "libmemcached/csl/parser.cc"
+#line 232 "libmemcached/csl/parser.cc"
#ifdef short
# undef short
/* 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
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;
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);
case 9:
/* Line 1464 of yacc.c */
-#line 192 "libmemcached/csl/parser.yy"
+#line 194 "libmemcached/csl/parser.yy"
{
memcached_reset(context->memc);
;}
case 10:
/* Line 1464 of yacc.c */
-#line 196 "libmemcached/csl/parser.yy"
+#line 198 "libmemcached/csl/parser.yy"
{
yydebug= 1;
;}
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)
{
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))))
{
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))))
{
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))))
{
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);
;}
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);
;}
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);
;}
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
case 25:
/* Line 1464 of yacc.c */
-#line 296 "libmemcached/csl/parser.yy"
+#line 298 "libmemcached/csl/parser.yy"
{
;}
break;
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
case 41:
/* Line 1464 of yacc.c */
-#line 365 "libmemcached/csl/parser.yy"
+#line 367 "libmemcached/csl/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
case 55:
/* Line 1464 of yacc.c */
-#line 420 "libmemcached/csl/parser.yy"
+#line 422 "libmemcached/csl/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_CRC;
;}
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;
;}
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;
;}
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;
;}
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;
;}
case 60:
/* Line 1464 of yacc.c */
-#line 440 "libmemcached/csl/parser.yy"
+#line 442 "libmemcached/csl/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_HSIEH;
;}
case 61:
/* Line 1464 of yacc.c */
-#line 444 "libmemcached/csl/parser.yy"
+#line 446 "libmemcached/csl/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_MURMUR;
;}
case 62:
/* Line 1464 of yacc.c */
-#line 448 "libmemcached/csl/parser.yy"
+#line 450 "libmemcached/csl/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_JENKINS;
;}
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);
;}
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);
;}
case 65:
/* Line 1464 of yacc.c */
-#line 466 "libmemcached/csl/parser.yy"
+#line 468 "libmemcached/csl/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT;
;}
case 66:
/* Line 1464 of yacc.c */
-#line 470 "libmemcached/csl/parser.yy"
+#line 472 "libmemcached/csl/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA;
;}
case 67:
/* Line 1464 of yacc.c */
-#line 474 "libmemcached/csl/parser.yy"
+#line 476 "libmemcached/csl/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM;
;}
/* 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);
/* Line 1684 of yacc.c */
-#line 479 "libmemcached/csl/parser.yy"
+#line 481 "libmemcached/csl/parser.yy"
void Context::start()
#include <libmemcached/csl/symbol.h>
#include <libmemcached/csl/scanner.h>
+#ifndef __INTEL_COMPILER
#pragma GCC diagnostic ignored "-Wold-style-cast"
+#endif
int conf_lex(YYSTYPE* lvalp, void* scanner);
#include <libmemcached/csl/parser.h>
#include <libmemcached/csl/symbol.h>
+#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
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 */
#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
/* 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
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 */
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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#line 38 "libmemcached/csl/scanner.l"
+#line 40 "libmemcached/csl/scanner.l"
#include <cstdlib>
#include <cstring>
#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
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;
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 );
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 );
/* 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 */
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; \
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;
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:
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;
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;
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 169 "libmemcached/csl/scanner.l"
+#line 171 "libmemcached/csl/scanner.l"
{
if (yyextra->is_server())
{
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;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 194 "libmemcached/csl/scanner.l"
+#line 196 "libmemcached/csl/scanner.l"
{
yyextra->begin= yytext;
return UNKNOWN;
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();
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 )
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;
/* 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;
}
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 ) )
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;
/* %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) {
* @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;
/** 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;
/* %ok-for-header */
-#line 199 "libmemcached/csl/scanner.l"
+#line 201 "libmemcached/csl/scanner.l"
#include <libmemcached/csl/parser.h>
#include <libmemcached/csl/symbol.h>
+#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
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 */
/* %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
/* 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
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 */
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 );
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 );
#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 */
#include <libmemcached/csl/parser.h>
#include <libmemcached/csl/symbol.h>
+#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*
#include <libtest/common.h>
#include <libtest/blobslap_worker.h>
-#include <libtest/killpid.h>
-
-using namespace libtest;
#include <cassert>
#include <cerrno>
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
-using namespace libtest;
+namespace libtest {
class BlobslapWorker : public Server
{
return true;
}
-namespace libtest {
-
Server *build_blobslap_worker(in_port_t try_port)
{
return new BlobslapWorker(try_port);
}
-}
+} // namespace libtest
#include <fnmatch.h>
#endif
-static inline bool is_pid_valid(const pid_t pid)
-{
- return (pid > 1) ? true : false;
-}
+#include <libtest/test.hpp>
+
+#include <libtest/is_pid.hpp>
#include <libtest/gearmand.h>
#include <libtest/blobslap_worker.h>
#include <libtest/libtool.hpp>
#include <libtest/killpid.h>
+#include <libtest/stats.h>
+#include <libtest/signal.h>
-#include <libtest/test.hpp>
#pragma once
#include <typeinfo>
-#include <libtest/strerror.h>
#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
#include <libmemcached/memcached.h>
namespace libtest {
template <class T_comparable, class T_hint>
-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)
{
return true;
}
+template <class T_comparable>
+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 <class T_comparable, class T_hint>
bool _compare_hint(const char *file, int line, const char *func, T_comparable __expected, T_comparable __actual, T_hint __hint)
{
--- /dev/null
+/* 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 <libtest/common.h>
+
+
+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
#pragma once
+namespace libtest {
+
LIBTEST_API
void create_core(void);
+
+} // namespace libtest
};
-#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);
+}
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 \
libtest/server.h \
libtest/server_container.h \
libtest/signal.h \
+ libtest/socket.hpp \
libtest/stats.h \
libtest/stream.h \
libtest/strerror.h \
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 \
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}
--- /dev/null
+/* 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 <libtest/common.h>
+
+
+namespace libtest {
+
+bool test_is_local()
+{
+ return (getenv("LIBTEST_LOCAL"));
+}
+
+} // namespace libtest
+
--- /dev/null
+/* 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
--- /dev/null
+/* 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;
+}
+
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;
global_max_port= port;
}
+
+} // namespace libtest
#pragma once
+namespace libtest {
+
LIBTEST_API
in_port_t default_port();
LIBTEST_API
void set_max_port(in_port_t port);
+
+} // namespace libtest
#include <pthread.h>
#include <semaphore.h>
+#include <signal.h>
enum shutdown_t {
SHUTDOWN_RUNNING,
--- /dev/null
+/* 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 <libtest/common.h>
+
+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));
+ }
+}
+
+}
--- /dev/null
+/* 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
+
--- /dev/null
+/* 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 <libtest/common.h>
+
+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
#pragma once
+namespace libtest {
+
/**
@note Friendly print function for errors.
*/
LIBTEST_API
const char *test_strerror(test_return_t code);
+
+} // namespace libtest
#include <signal.h>
-#include <libtest/stats.h>
-#include <libtest/signal.h>
-
#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)
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[])
{
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
-#include <libtest/stream.h>
-#include <libtest/comparison.hpp>
-
/**
A structure describing the test case.
*/
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)
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)
{ \
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)
{ \
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)
#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)
{ \
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)
{ \
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)
{ \
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)
{ \
if (not libtest::_compare(__FILE__, __LINE__, __func__, ((__expected)), ((__actual)))) \
{ \
- create_core(); \
+ libtest::create_core(); \
return TEST_FAILURE; \
} \
} while (0)
{ \
if (not libtest::_compare_zero(__FILE__, __LINE__, __func__, ((__actual)))) \
{ \
- create_core(); \
+ libtest::create_core(); \
return TEST_FAILURE; \
} \
} while (0)
{ \
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 \
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)
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)
#include <libtest/version.h>
#include <libtest/error.h>
+#include <libtest/strerror.h>
+#include <libtest/stream.h>
+#include <libtest/comparison.hpp>
#include <libtest/server.h>
#include <libtest/server_container.h>
#include <libtest/wait.h>
#include <libtest/callbacks.h>
#include <libtest/test.h>
-#include <libtest/strerror.h>
#include <libtest/core.h>
#include <libtest/runner.h>
#include <libtest/port.h>
+#include <libtest/is_local.hpp>
+#include <libtest/socket.hpp>
#include <libtest/stats.h>
#include <libtest/collection.h>
#include <libtest/framework.h>
#include <libtest/cmdline.h>
#include <libtest/string.hpp>
#include <libtest/binaries.h>
-
-#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);
#pragma once
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define LIBTEST_VERSION_STRING "@VERSION@"
#define LIBTEST_VERSION_HEX @HEX_VERSION@
-
-#ifdef __cplusplus
-}
-#endif
#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) */
+++ /dev/null
-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++)
- ])
-])
+++ /dev/null
-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}"
-])
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
}
-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)
{
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;
#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);
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;
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;
}
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;
}
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;
}
{
const char *args[]= { "--help", 0 };
- test_success(exec_cmdline(executable, args));
+ test_true(exec_cmdline(executable, args));
return TEST_SUCCESS;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
#pragma once
-LIBTEST_INTERNAL_API
+LIBTEST_LOCAL
test_return_t memcached_increment_namespace(memcached_st *memc);
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);
}
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
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<test_callback_fn*>(error_test) },
+ { "error(std::string&)", false, reinterpret_cast<test_callback_fn*>(error_std_string_test) },
+ { "error(memcached_return_t&)", false, reinterpret_cast<test_callback_fn*>(error_memcached_return_t_test) },
{0, 0, 0}
};
test_st tests[] ={
- { "basic", 0,
+ { "basic", false,
reinterpret_cast<test_callback_fn*>(basic_test) },
- { "basic_master_key", 0,
+ { "basic_master_key", false,
reinterpret_cast<test_callback_fn*>(basic_master_key_test) },
- { "increment_test", 0,
+ { "increment_test", false,
reinterpret_cast<test_callback_fn*>(increment_test) },
- { "mget", 1,
+ { "mget", true,
reinterpret_cast<test_callback_fn*>(mget_test) },
- { "basic_behavior", 0,
+ { "basic_behavior", false,
reinterpret_cast<test_callback_fn*>(basic_behavior) },
{0, 0, 0}
};
extern "C" {
#endif
-LIBTEST_INTERNAL_API
+LIBTEST_LOCAL
test_return_t memcached_pool_test(memcached_st *);
#ifdef __cplusplus
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);
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)
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
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
extern "C" {
#endif
-LIBTEST_INTERNAL_API
+LIBTEST_LOCAL
test_return_t virtual_back_map(memcached_st *);
#ifdef __cplusplus