- 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);
- (void)not_used;
-
- memc= memcached_create(NULL);
- memcached_server_add_with_weight(memc, "localhost", 11311, 100);
- memcached_server_add_with_weight(memc, "localhost", 11312, 100);
+ memcached_st *memc= memcached(test_literal_param("--server=localhost:11311/?100 --server=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"));
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);
{"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 },
{"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},