struct dict_op_settings opset;
struct ioloop *ioloop;
const char *error;
- unsigned int i;
char key[1000], value[100];
lib_init();
if (dict_init(uri, &set, &dict, &error) < 0)
i_fatal("dict_init(%s) failed: %s", argv[1], error);
- for (i = 0; !stop; i++) {
+ while (!stop) {
i_snprintf(key, sizeof(key), "%s/%02x", prefix,
i_rand_limit(0xff));
i_snprintf(value, sizeof(value), "%04x", i_rand_limit(0xffff));
{
const char *const *lines_ref = t_strsplit(reference, "\n");
const char *const *lines_act = t_strsplit(actual, "\n");
- for(size_t i = 0; *lines_ref != NULL && *lines_act != NULL; i++, lines_ref++, lines_act++) {
+ for(; *lines_ref != NULL && *lines_act != NULL; lines_ref++, lines_act++) {
if (!compare_test_stats_data_line(*lines_ref, *lines_act))
return FALSE;
}
unsigned int i;
size_t last_alloc = 0;
size_t used = 0;
- size_t count = 0;
void *mem = NULL;
test_begin("mempool_allocfree");
if (mem != NULL) {
test_assert_idx(mem_has_bytes(mem, last_alloc, SENSE), i);
used -= last_alloc;
- count--;
}
last_alloc = 0;
p_free(pool, mem);
} else if ((i % 5) == 0) {
if (mem != NULL)
used -= last_alloc;
- else
- count++;
mem = p_realloc(pool, mem, last_alloc, i*2);
if (last_alloc > 0)
test_assert_idx(mem_has_bytes(mem, last_alloc, SENSE), i);
} else if ((i % 7) == 0) {
if (mem != NULL)
used -= last_alloc;
- else
- count++;
mem = p_realloc(pool, mem, last_alloc, i-2);
if (last_alloc > 0)
test_assert_idx(mem_has_bytes(mem, i-2, SENSE), i);
/* fill it with sense marker */
memset(mem, SENSE, i);
used += i;
- count++;
last_alloc = i;
}
}