/*
Sample test application.
*/
+#include "libmemcached/common.h"
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include "server.h"
-#include "../libmemcached/common.h"
#include "../clients/generator.h"
#include "../clients/execute.h"
uint32_t test_bit;
uint8_t which;
- test_bit= random() % GLOBAL_COUNT;
- which= random() % 2;
+ test_bit= (uint32_t)(random() % GLOBAL_COUNT);
+ which= (uint8_t)(random() % 2);
if (which == 0)
{
static test_return add_test(memcached_st *memc)
{
memcached_return rc;
- char *key= "foo";
- char *value= "when we sanitize";
+ const char *key= "foo";
+ const char *value= "when we sanitize";
unsigned long long setting_value;
setting_value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_NO_BLOCK);
/* Too many broken OS'es have broken loopback in async, so we can't be sure of the result */
if (setting_value)
- assert(rc == MEMCACHED_NOTSTORED || MEMCACHED_STORED);
+ assert(rc == MEMCACHED_NOTSTORED || rc == MEMCACHED_STORED);
else
assert(rc == MEMCACHED_NOTSTORED);
static test_return many_adds(memcached_st *memc)
{
unsigned int i;
- for (i = 0; i < TEST_COUNTER; i++){
+ for (i = 0; i < TEST_COUNTER; i++)
+ {
add_test(memc);
}
return 0;