X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffunction.c;h=13574427de8b0075a0af511804a16db6841ae768;hb=aeb3ec459e2f5844aa9b9eb8a60092309b33702a;hp=e87aa28a26dcfdd20506d7de1b62cc02024ba0b0;hpb=b2aca5463d5f5e12969f6ee3eaf40297311a1057;p=m6w6%2Flibmemcached diff --git a/tests/function.c b/tests/function.c index e87aa28a..13574427 100644 --- a/tests/function.c +++ b/tests/function.c @@ -4521,14 +4521,14 @@ static test_return regression_bug_434843(memcached_st *memc) */ uint32_t number_of_hosts= memc->number_of_hosts; memc->number_of_hosts= 1; - const int max_keys= 10240; + const size_t max_keys= 10240; char **keys= calloc(max_keys, sizeof(char*)); size_t *key_length=calloc(max_keys, sizeof(size_t)); - for (int x= 0; x < max_keys; ++x) + for (int x= 0; x < (int)max_keys; ++x) { char k[251]; - key_length[x]= snprintf(k, sizeof(k), "0200%u", x); + key_length[x]= (size_t)snprintf(k, sizeof(k), "0200%u", x); keys[x]= strdup(k); assert(keys[x] != NULL); } @@ -4547,7 +4547,7 @@ static test_return regression_bug_434843(memcached_st *memc) /* The first iteration should give me a 100% cache miss. verify that*/ assert(counter == 0); char blob[1024]; - for (int x= 0; x < max_keys; ++x) + for (int x= 0; x < (int)max_keys; ++x) { rc= memcached_add(memc, keys[x], key_length[x], blob, sizeof(blob), 0, 0); @@ -4557,12 +4557,12 @@ static test_return regression_bug_434843(memcached_st *memc) else { /* Verify that we received all of the key/value pairs */ - assert(counter == max_keys); + assert(counter == (unsigned int)max_keys); } } /* Release allocated resources */ - for (int x= 0; x < max_keys; ++x) + for (size_t x= 0; x < max_keys; ++x) free(keys[x]); free(keys); free(key_length); @@ -4599,11 +4599,6 @@ static test_return regression_bug_421108(memcached_st *memc) assert(rc == MEMCACHED_SUCCESS); assert(bytes_written != NULL); - /* - * We did a flush before running the test, so bytes should be 0, but - * bytes_read and butes_written cannot be zero ;-) - */ - assert(strcmp(bytes, "0") == 0); assert(strcmp(bytes, bytes_read) != 0); assert(strcmp(bytes, bytes_written) != 0);