assert(!memcmp(value, "we the people", strlen("we the people")));
assert(strlen("we the people") == value_length);
assert(rc == MEMCACHED_SUCCESS);
+ free(value);
return 0;
}
store_ptr= (unsigned int *)value;
x= 0;
- while (*store_ptr)
+ while ((size_t)store_ptr < (size_t)(value + value_length))
{
assert(*store_ptr == store_list[x++]);
store_ptr++;
}
+ free(value);
return 0;
}
assert(!memcmp(value, "we the people", strlen("we the people")));
assert(strlen("we the people") == value_length);
assert(rc == MEMCACHED_SUCCESS);
+ free(value);
return 0;
}
return 0;
}
+/* Do not copy the style of this code, I just access hosts to testthis function */
uint8_t stats_servername_test(memcached_st *memc)
{
memcached_return rc;
memcached_stat_st stat;
rc= memcached_stat_servername(&stat, NULL,
- "localhost",
- MEMCACHED_DEFAULT_PORT);
+ memc->hosts[0].hostname,
+ memc->hosts[0].port);
return 0;
}
for (x= 0; x < memcached_server_count(memc); x++)
{
- list= memcached_stat_get_keys(memc, &stat[x], &rc);
+ list= memcached_stat_get_keys(memc, stat+x, &rc);
assert(rc == MEMCACHED_SUCCESS);
- for (ptr= list; *ptr; ptr++)
- printf("Found key %s\n", *ptr);
+ for (ptr= list; *ptr; ptr++);
free(list);
}
return 0;
}
+uint8_t cleanup_pairs(memcached_st *memc)
+{
+ pairs_free(global_pairs);
+
+ return 0;
+}
+
uint8_t generate_data(memcached_st *memc)
{
unsigned long long x;
{"get_read", 0, get_read },
{"mget_read", 0, mget_read },
{"mget_read_result", 0, mget_read_result },
+ {"cleanup", 0, cleanup_pairs },
{0, 0, 0}
};