X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Flibmemcached-1.0%2Fmem_functions.cc;h=2155f7f3157c1130edd81d6065f52de07be129ae;hb=f39b759b9e4483e266ee56b09e0e49a6b36170d7;hp=d439e35ec1386c4241b559b1c94a43faecf79f83;hpb=850df1fbab46a5a658c2fd0c35164ef1c60a22d9;p=awesomized%2Flibmemcached diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index d439e35e..2155f7f3 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -598,7 +598,7 @@ test_return_t append_binary_test(memcached_st *memc) 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++; @@ -644,7 +644,7 @@ test_return_t memcached_mget_mixed_memcached_get_TEST(memcached_st *memc) } 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; @@ -1754,6 +1754,11 @@ test_return_t block_add_regression(memcached_st *memc) 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); } @@ -2629,7 +2634,7 @@ test_return_t user_supplied_bug20(memcached_st *memc) */ /* sighandler_t function that always asserts false */ -static void fail(int) +static __attribute__((noreturn)) void fail(int) { fatal_assert(0); } @@ -3162,7 +3167,7 @@ test_return_t noreply_test(memcached_st *memc) 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; @@ -3217,7 +3222,7 @@ test_return_t noreply_test(memcached_st *memc) { 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);