diff options
Diffstat (limited to 'test/unit/rbuffer_spec.lua')
-rw-r--r-- | test/unit/rbuffer_spec.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/unit/rbuffer_spec.lua b/test/unit/rbuffer_spec.lua index 9b5927cae6..e9104dd5c4 100644 --- a/test/unit/rbuffer_spec.lua +++ b/test/unit/rbuffer_spec.lua @@ -5,7 +5,7 @@ local eq = helpers.eq local ffi = helpers.ffi local cstr = helpers.cstr local to_cstr = helpers.to_cstr -local deferred_call = helpers.deferred_call +local child_call_once = helpers.child_call_once local rbuffer = helpers.cimport("./test/unit/fixtures/rbuffer.h") @@ -32,11 +32,13 @@ describe('rbuffer functions', function() return ffi.string(rbuffer.rbuffer_get(rbuf, idx), 1) end - before_each(deferred_call(function() - rbuf = ffi.gc(rbuffer.rbuffer_new(capacity), rbuffer.rbuffer_free) - -- fill the internal buffer with the character '0' to simplify inspecting - ffi.C.memset(rbuf.start_ptr, string.byte('0'), capacity) - end)) + before_each(function() + child_call_once(function() + rbuf = ffi.gc(rbuffer.rbuffer_new(capacity), rbuffer.rbuffer_free) + -- fill the internal buffer with the character '0' to simplify inspecting + ffi.C.memset(rbuf.start_ptr, string.byte('0'), capacity) + end) + end) describe('RBUFFER_UNTIL_FULL', function() local chunks |