diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-13 09:46:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-13 09:46:18 +0100 |
commit | f1e9625920e4e9add168e30c0441a4312b23c890 (patch) | |
tree | b272a83d3f8c6af8fec2eb139d415d1b8d672b1f /test/lua/unit/utf.lua | |
parent | e900e3fce155c8ad08c69b3be0668e25262b15d1 (diff) | |
download | rspamd-f1e9625920e4e9add168e30c0441a4312b23c890.tar.gz rspamd-f1e9625920e4e9add168e30c0441a4312b23c890.zip |
[Minor] Rework utf8 lowercasing
Diffstat (limited to 'test/lua/unit/utf.lua')
-rw-r--r-- | test/lua/unit/utf.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lua/unit/utf.lua b/test/lua/unit/utf.lua index 277d99e41..75dd33977 100644 --- a/test/lua/unit/utf.lua +++ b/test/lua/unit/utf.lua @@ -3,8 +3,8 @@ context("UTF8 check functions", function() local ffi = require("ffi") ffi.cdef[[ - void rspamd_str_lc_utf8 (char *str, unsigned int size); - void rspamd_str_lc (char *str, unsigned int size); + unsigned int rspamd_str_lc_utf8 (char *str, unsigned int size); + unsigned int rspamd_str_lc (char *str, unsigned int size); char * rspamd_str_make_utf_valid (const char *src, size_t slen, size_t *dstlen); ]] @@ -19,8 +19,8 @@ context("UTF8 check functions", function() test("UTF lowercase " .. tostring(i), function() local buf = ffi.new("char[?]", #c[1] + 1) ffi.copy(buf, c[1]) - ffi.C.rspamd_str_lc_utf8(buf, #c[1]) - local s = ffi.string(buf) + local nlen = ffi.C.rspamd_str_lc_utf8(buf, #c[1]) + local s = ffi.string(buf, nlen) assert_equal(s, c[2]) end) end |