aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-29 15:03:00 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-29 15:03:00 +0100
commita78961b4277306675c59a3fbc6da836cfdde41b2 (patch)
tree79fc8225de98c0dc92785ea7c720082f1daa8481 /test
parentf305fb7394a3e80a2487889834b37e4f66fe43e6 (diff)
downloadrspamd-a78961b4277306675c59a3fbc6da836cfdde41b2.tar.gz
rspamd-a78961b4277306675c59a3fbc6da836cfdde41b2.zip
[Minor] Variuous unit tests fixes
Diffstat (limited to 'test')
-rw-r--r--test/lua/unit/addr.lua2
-rw-r--r--test/lua/unit/rfc2047.lua6
-rw-r--r--test/lua/unit/smtp_addr.lua4
3 files changed, 6 insertions, 6 deletions
diff --git a/test/lua/unit/addr.lua b/test/lua/unit/addr.lua
index 8229535ac..ca9b323ef 100644
--- a/test/lua/unit/addr.lua
+++ b/test/lua/unit/addr.lua
@@ -7,7 +7,7 @@ context("Inet addr check functions", function()
typedef struct rspamd_inet_addr_s rspamd_inet_addr_t;
bool rspamd_parse_inet_address (rspamd_inet_addr_t **target,
const char *src);
- void rspamd_inet_address_freefree (rspamd_inet_addr_t *addr);
+ void rspamd_inet_address_free (rspamd_inet_addr_t *addr);
]]
test("Create inet addr from string", function()
diff --git a/test/lua/unit/rfc2047.lua b/test/lua/unit/rfc2047.lua
index 8c450c47a..0b8baf624 100644
--- a/test/lua/unit/rfc2047.lua
+++ b/test/lua/unit/rfc2047.lua
@@ -29,7 +29,7 @@ context("RFC2047 decoding", function()
ffi.cdef[[
const char * rspamd_mime_header_decode (void *pool, const char *in, size_t inlen);
- void * rspamd_mempool_new (size_t sz, const char *name);
+ void * rspamd_mempool_new_ (size_t sz, const char *name, const char *strloc);
void rspamd_mempool_delete (void *pool);
]]
@@ -46,7 +46,7 @@ context("RFC2047 decoding", function()
{"=?windows-1251?B?xO7q8+zl7fIuc2NyLnV1ZQ==?=", "Документ.scr.uue"},
}
- local pool = ffi.C.rspamd_mempool_new(4096, "lua")
+ local pool = ffi.C.rspamd_mempool_new_(4096, "lua", "rfc2047.lua:49")
for _,c in ipairs(cases) do
local res = ffi.C.rspamd_mime_header_decode(pool, c[1], #c[1])
@@ -60,7 +60,7 @@ context("RFC2047 decoding", function()
end)
test("Fuzz test for rfc2047 tokens", function()
local util = require("rspamd_util")
- local pool = ffi.C.rspamd_mempool_new(4096, "lua")
+ local pool = ffi.C.rspamd_mempool_new_(4096, "lua", "rfc2047.lua:63")
local str = "Тест Тест Тест Тест Тест"
for i = 0,1000 do
diff --git a/test/lua/unit/smtp_addr.lua b/test/lua/unit/smtp_addr.lua
index 4aa7ecd52..c07d33fda 100644
--- a/test/lua/unit/smtp_addr.lua
+++ b/test/lua/unit/smtp_addr.lua
@@ -65,7 +65,7 @@ context("SMTP address check functions", function()
assert_equal(str, ex)
end
end, case[2])
- ffi.C.rspamd_email_address_unref(st)
+ ffi.C.rspamd_email_address_free(st)
end, cases_valid)
local cases_invalid = {
@@ -97,7 +97,7 @@ context("SMTP address check functions", function()
local t1 = util.get_ticks()
local st = ffi.C.rspamd_email_address_from_smtp(ncase, #ncase)
local t2 = util.get_ticks()
- ffi.C.rspamd_email_address_unref(st)
+ ffi.C.rspamd_email_address_free(st)
total = total + t2 - t1
end