/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "array.h"
#include "aqueue.h"
{
const unsigned int *p;
unsigned int n, i, count;
for (i = 0, n = 1; i < count; i++, n++) {
if (i == deleted_n)
n++;
if (*p != n)
return FALSE;
}
return TRUE;
}
{
ARRAY(unsigned int) aqueue_array;
unsigned int i, j, k;
for (i = 0; i < N_ELEMENTS(aqueue_input); i++) {
for (k = 0; k < N_ELEMENTS(aqueue_input); k++) {
for (j = 0; j < k; j++) {
return t_strdup_printf("Wrong count after append %u vs %u)",
}
return "Invalid data after append";
}
if (k != 0 && i < k) {
aqueue_delete(aqueue, i);
return "Wrong count after delete";
if (!aqueue_is_ok(aqueue, i))
return "Invalid data after delete";
}
if (aqueue_count(aqueue) != 0)
return "aqueue_clear() broken";
}
}
return NULL;
}
void test_aqueue(void)
{
unsigned int i;
T_BEGIN {
reason = test_aqueue2(i);
} T_END;
}
}