/* we've deleted some messages. we should be ok, unless we
were already over quota and still are after these
deletions. */
+ const uint64_t count_deleted = (uint64_t)-ctx->count_used;
+
if (ctx->count_over > 0) {
- if (ctx->count_over > (uint64_t)-ctx->count_used + 1)
+ if (count_deleted - 1 < ctx->count_over)
return TRUE;
- } else {
- return TRUE;
}
} else {
if (ctx->count_ceil < 1 ||
{ MAXU64, MAXU64, 0, 1, TRUE },
{ MAXU64, MAXU64-1, 0, 1, FALSE },
{ MAXU64, MAXU64-1, 1, 1, TRUE },
+ { MAXU64-1, MAXU64-1, 0, 1, TRUE },
+ { MAXU64-1, MAXU64-1, -1, 1, FALSE },
+ { MAXU64-2, MAXU64-1, -1, 1, TRUE },
+ { MAXU64-2, MAXU64-1, -2, 1, FALSE },
/* these are for bytes tests: */