test_compare(MEMCACHED_SUCCESS,
memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, true));
test_compare(query_id, memcached_query_id(memc_clone)); // We should not increase the query_id for memcached_behavior_set()
+ ASSERT_TRUE(memcached_behavior_get(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY));
/* All keys are valid in the binary protocol (except for length) */
if (memcached_behavior_get(memc_clone, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) == false)
const char *key= "mine";
char *value;
- /* Make sure be default none exists */
+ /* Make sure by default none exists */
value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
test_null(value);
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
test_true(value);
- test_memcmp(value, key, 4);
+ test_memcmp(value, key, strlen(key));
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
/* Test that we can turn it off */
value= (char *)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
test_true(value);
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
- test_memcmp(value, key, 4);
+ test_memcmp(value, key, strlen(key));
/* Set to Zero, and then Set to something too large */
{
test_compare(MEMCACHED_SUCCESS,
memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, NULL));
- value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
- test_null(value);
- test_compare(MEMCACHED_SUCCESS, rc);
+ ASSERT_NULL_(memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc), "Setting namespace to NULL did not work");
/* Test a long key for failure */
/* TODO, extend test to determine based on setting, what result should be */
{
memcached_return_t rc;
const char *key= "mine";
- char *value;
// Make sure we default to a null namespace
- value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
- test_null(value);
+ char* value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
+ ASSERT_NULL_(value, "memc had a value for namespace when none should exist");
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
/* Test a clean set */
memcached_callback_set(memc, MEMCACHED_CALLBACK_NAMESPACE, (void *)key));
value= (char*)memcached_callback_get(memc, MEMCACHED_CALLBACK_NAMESPACE, &rc);
- test_true(value);
- test_memcmp(value, key, 4);
+ ASSERT_TRUE(value);
+ test_memcmp(value, key, strlen(key));
test_compare_got(MEMCACHED_SUCCESS, rc, memcached_strerror(NULL, rc));
return TEST_SUCCESS;