test_true(memc_clone->flags.verify_key == memc->flags.verify_key);
test_true(memc_clone->ketama.weighted == memc->ketama.weighted);
test_true(memc_clone->flags.binary_protocol == memc->flags.binary_protocol);
test_true(memc_clone->flags.verify_key == memc->flags.verify_key);
test_true(memc_clone->ketama.weighted == memc->ketama.weighted);
test_true(memc_clone->flags.binary_protocol == memc->flags.binary_protocol);
test_true(memc_clone->flags.no_reply == memc->flags.no_reply);
test_true(memc_clone->flags.use_udp == memc->flags.use_udp);
test_true(memc_clone->flags.auto_eject_hosts == memc->flags.auto_eject_hosts);
test_true(memc_clone->flags.no_reply == memc->flags.no_reply);
test_true(memc_clone->flags.use_udp == memc->flags.use_udp);
test_true(memc_clone->flags.auto_eject_hosts == memc->flags.auto_eject_hosts);
- rc= memcached_set(memc, key, strlen(key),
- value, value_length,
- (time_t)0, (uint32_t)0);
- test_true(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
+ memcached_return_t rc= memcached_set(memc, key, strlen(key),
+ value, value_length,
+ (time_t)0, (uint32_t)0);
+ test_true(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED);
- string= memcached_get(memc, key, strlen(key),
- &string_length, &flags, &rc);
+ uint32_t flags;
+ size_t string_length;
+ char *string= memcached_get(memc, key, strlen(key),
+ &string_length, &flags, &rc);
{
test_compare(return_key_length, return_value_length);
test_memcmp(return_value, return_key, return_value_length);
{
test_compare(return_key_length, return_value_length);
test_memcmp(return_value, return_key, return_value_length);
- memc= memcached_create(NULL);
- memcached_server_add_with_weight(memc, "localhost", 11311, 100);
- memcached_server_add_with_weight(memc, "localhost", 11312, 100);
-
- server= memcached_server_by_key(memc, "a", 1, &res);
+ const memcached_server_st *server= memcached_server_by_key(memc, "a", 1, &res);
+ test_true(server);
memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, long_key));
/* Test for a bad prefix, but with a short key */
memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, long_key));
/* Test for a bad prefix, but with a short key */
rc= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_VERIFY_KEY, 1),
memcached_strerror(NULL, rc));
rc= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_VERIFY_KEY, 1),
memcached_strerror(NULL, rc));
- if (not memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL))
- {
- strncpy(long_key, "dog cat", sizeof(long_key));
- test_compare(MEMCACHED_BAD_KEY_PROVIDED,
- memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, long_key));
- }
+ test_compare(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) ? MEMCACHED_SUCCESS : MEMCACHED_BAD_KEY_PROVIDED,
+ memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, "dog cat"));
memcached_server_instance_by_position(memc, 0);
if ((instance->major_version >= 1 && (instance->minor_version == 2 && instance->micro_version >= 4))
memcached_server_instance_by_position(memc, 0);
if ((instance->major_version >= 1 && (instance->minor_version == 2 && instance->micro_version >= 4))
- rc= memcached_server_add_unix_socket_with_weight(memc, "/tmp/memcached.socket", 0);
+ test_compare(MEMCACHED_SUCCESS,
+ memcached_server_add_unix_socket_with_weight(memc, socket_file, 0));
We are testing the error condition when we connect to a server via memcached_get()
but find that the server is not available.
*/
We are testing the error condition when we connect to a server via memcached_get()
but find that the server is not available.
*/
- tl_memc_h= memcached_create(NULL);
- memcached_server_st *servers= memcached_servers_parse("localhost:9898,localhost:9899"); // This server should not exist
- test_true(servers);
- memcached_server_push(tl_memc_h, servers);
- memcached_server_list_free(servers);
+ memcached_st *tl_memc_h= memcached(test_literal_param("--server=localhost:9898 --server=localhost:9899")); // This server should not exist
- value= memcached_get(tl_memc_h, key, strlen(key), &len, &flags, &rc);
+ char *value= memcached_get(tl_memc_h, key, strlen(key), &len, &flags, &rc);
memcached_server_instance_st instance= memcached_server_instance_by_position(memc, 0);
memcached_st *local_memc= memcached_create(NULL);
memcached_server_instance_st instance= memcached_server_instance_by_position(memc, 0);
memcached_st *local_memc= memcached_create(NULL);
// Do not do this in your code, it is not supported.
memc->servers[1].options.is_dead= true;
// Do not do this in your code, it is not supported.
memc->servers[1].options.is_dead= true;
{"libmemcached_check_configuration_with_filename", 0, (test_callback_fn*)libmemcached_check_configuration_with_filename_test },
{"number_options", 0, (test_callback_fn*)parser_number_options_test },
{"randomly generated options", 0, (test_callback_fn*)random_statement_build_test },
{"libmemcached_check_configuration_with_filename", 0, (test_callback_fn*)libmemcached_check_configuration_with_filename_test },
{"number_options", 0, (test_callback_fn*)parser_number_options_test },
{"randomly generated options", 0, (test_callback_fn*)random_statement_build_test },
- {"prefix_key", 0, (test_callback_fn*)parser_key_prefix_test },
+ {"namespace", 0, (test_callback_fn*)parser_key_prefix_test },
{"server", 0, (test_callback_fn*)server_test },
{"bad server strings", 0, (test_callback_fn*)servers_bad_test },
{"server with weights", 0, (test_callback_fn*)server_with_weight_test },
{"parsing servername, port, and weight", 0, (test_callback_fn*)test_hostname_port_weight },
{"server", 0, (test_callback_fn*)server_test },
{"bad server strings", 0, (test_callback_fn*)servers_bad_test },
{"server with weights", 0, (test_callback_fn*)server_with_weight_test },
{"parsing servername, port, and weight", 0, (test_callback_fn*)test_hostname_port_weight },
- {"basic tests", 0, (test_callback_fn*)selection_of_namespace_tests },
-#if 0
- {"increment", 0, (test_callback_fn*)memcached_increment_namespace },
-#endif
+ {"basic tests", true, (test_callback_fn*)selection_of_namespace_tests },
+ {"increment", true, (test_callback_fn*)memcached_increment_namespace },
{"namespace", (test_callback_fn*)set_namespace, 0, tests},
{"namespace(BINARY)", (test_callback_fn*)set_namespace_and_binary, 0, tests},
{"specific namespace", 0, 0, namespace_tests},
{"namespace", (test_callback_fn*)set_namespace, 0, tests},
{"namespace(BINARY)", (test_callback_fn*)set_namespace_and_binary, 0, tests},
{"specific namespace", 0, 0, namespace_tests},
{"sasl_auth", (test_callback_fn*)pre_sasl, 0, sasl_auth_tests },
{"sasl", (test_callback_fn*)pre_sasl, 0, tests },
{"version_1_2_3", (test_callback_fn*)check_for_1_2_3, 0, version_1_2_3},
{"string", 0, 0, string_tests},
{"result", 0, 0, result_tests},
{"async", (test_callback_fn*)pre_nonblock, 0, async_tests},
{"sasl_auth", (test_callback_fn*)pre_sasl, 0, sasl_auth_tests },
{"sasl", (test_callback_fn*)pre_sasl, 0, tests },
{"version_1_2_3", (test_callback_fn*)check_for_1_2_3, 0, version_1_2_3},
{"string", 0, 0, string_tests},
{"result", 0, 0, result_tests},
{"async", (test_callback_fn*)pre_nonblock, 0, async_tests},
- {"async_binary", (test_callback_fn*)pre_nonblock_binary, 0, async_tests},
+ {"async(BINARY)", (test_callback_fn*)pre_nonblock_binary, 0, async_tests},
{"Cal Haldenbrand's tests", 0, 0, haldenbrand_tests},
{"user", 0, 0, user_tests},
{"generate", 0, 0, generate_tests},
{"Cal Haldenbrand's tests", 0, 0, haldenbrand_tests},
{"user", 0, 0, user_tests},
{"generate", 0, 0, generate_tests},