test_compare(value_length, sizeof(uint32_t) * count);
test_compare(MEMCACHED_SUCCESS, rc);
- for (uint32_t counter= count, *ptr= value; counter; counter--)
+ for (uint32_t counter= uint32_t(count), *ptr= value; counter; counter--)
{
test_compare(*ptr, store_list[count - counter]);
ptr++;
}
else
{
- int which_key= random() %keys.size();
+ int which_key= random() % int(keys.size());
size_t value_length;
uint32_t flags;
memcached_return_t rc;
global_pairs[x].key, global_pairs[x].key_length,
&blob[0], blob.size(),
time_t(0), uint32_t(0));
+ if (rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE)
+ {
+ Error << memcached_last_error_message(memc);
+ return TEST_SKIPPED;
+ }
test_compare(*memc, MEMCACHED_SUCCESS);
test_compare(rc, MEMCACHED_SUCCESS);
}
*/
/* sighandler_t function that always asserts false */
-static void fail(int)
+static __attribute__((noreturn)) void fail(int)
{
fatal_assert(0);
}
for (size_t x= 0; x < 100; ++x)
{
char key[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1];
- int check_length= (size_t)snprintf(key, sizeof(key), "%lu", (unsigned long)x);
+ int check_length= snprintf(key, sizeof(key), "%lu", (unsigned long)x);
test_false((size_t)check_length >= sizeof(key) || check_length < 0);
size_t len= (size_t)check_length;
{
char key[10];
- int check_length= (size_t)snprintf(key, sizeof(key), "%lu", (unsigned long)x);
+ int check_length= snprintf(key, sizeof(key), "%lu", (unsigned long)x);
test_false((size_t)check_length >= sizeof(key) || check_length < 0);
uint64_t cas_value= memcached_result_cas(results);
test_true(cas_value);
+ char* take_value= memcached_result_take_value(results);
+ test_strcmp(__func__, take_value);
+ free(take_value);
+
memcached_result_free(results);
// Bad cas value, sanity check