Add. Test

This commit is contained in:
Alexey Melnichuk 2021-01-07 10:16:34 +03:00
parent e69056cf3f
commit 791c06e035

View File

@ -1057,6 +1057,19 @@ local function test_cb(name)
gc_collect() gc_collect()
assert_nil(pctx.value) assert_nil(pctx.value)
do local ctx = {}
pctx = weak_ptr(ctx)
assert(set(c, function() end, ctx))
end
gc_collect()
assert_table(pctx.value)
c:reset()
gc_collect()
assert_nil(pctx.value)
end end
function test_read() test_cb('readfunction') end function test_read() test_cb('readfunction') end
@ -1069,6 +1082,11 @@ function test_fnmatch() test_cb('fnmatch_function') end
function test_chunk_bgn() test_cb('chunk_bgn_function') end function test_chunk_bgn() test_cb('chunk_bgn_function') end
function test_chunk_end() test_cb('chunk_end_function') end function test_chunk_end() test_cb('chunk_end_function') end
if curl.OPT_HSTSREADFUNCTION then
function test_hstsreadfunction() test_cb('hstsreadfunction') end
function test_hstswritefunction() test_cb('hstswritefunction') end
end
end end
local _ENV = TEST_CASE'set_slist' if ENABLE then local _ENV = TEST_CASE'set_slist' if ENABLE then