Add test for max size

Tests #22
parent 4be97301
......@@ -5538,6 +5538,7 @@ t_cache(unsigned chksum)
const size_t memsz = 10 * 1024 * 1024;
const size_t dsksz = 100 * 1024 * 1024;
const size_t objsize_hint = 1 * 1024 * 1024;
struct fellow_cache_res fcr;
DBGSZ(fellow_disk_seg);
DBGSZ(fellow_disk_seglist);
......@@ -5601,6 +5602,26 @@ t_cache(unsigned chksum)
test_bocdone(fbo, TRUST_ME(hash), 1);
fellow_cache_obj_deref(fc, fco);
// === hit objsize_max
fbo = fellow_busy_obj_alloc(fc, &fco, &priv2, 1234).r.ptr;
CHECK_OBJ_NOTNULL(fbo, FELLOW_BUSY_MAGIC);
do {
char *ptr;
sz = 1234;
fcr = fellow_busy_obj_getspace(fbo, &sz, (uint8_t **)&ptr);
if (fcr.status == fcr_ok) {
fellow_busy_obj_extend(fbo, sz);
continue;
}
assert(fcr.status == fcr_allocerr);
AZ(strcmp(fcr.r.err, "objsize_max reached"));
} while (fcr.status == fcr_ok);
fellow_busy_obj_trimstore(fbo);
test_bocdone(fbo, TRUST_ME(hash), 1);
fellow_cache_obj_deref(fc, fco);
test_fellow_cache_unbusy_inject(fc);
// === alloc, then evict
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment