diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-26 12:10:50 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-26 12:10:50 +0100 |
commit | b0a535c17f7db5ce436a40425e9d2cad2555e0f9 (patch) | |
tree | 91634991b1246db7b4a7faad13d2be4116d3d88b /test | |
parent | 66d8b6e43447eeebe1ca1c2f79fa4b52173a1b6b (diff) | |
download | rspamd-b0a535c17f7db5ce436a40425e9d2cad2555e0f9.tar.gz rspamd-b0a535c17f7db5ce436a40425e9d2cad2555e0f9.zip |
[Test] Adjust tests
Diffstat (limited to 'test')
-rw-r--r-- | test/lua/unit/addr.lua | 4 | ||||
-rw-r--r-- | test/lua/unit/received.lua | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/test/lua/unit/addr.lua b/test/lua/unit/addr.lua index a021b1cba..6da72d316 100644 --- a/test/lua/unit/addr.lua +++ b/test/lua/unit/addr.lua @@ -6,7 +6,7 @@ context("Inet addr check functions", function() ffi.cdef[[ typedef struct rspamd_inet_addr_s rspamd_inet_addr_t; bool rspamd_parse_inet_address (rspamd_inet_addr_t **target, - const char *src); + const char *src, size_t len); void rspamd_inet_address_free (rspamd_inet_addr_t *addr); ]] @@ -35,7 +35,7 @@ context("Inet addr check functions", function() for i,c in ipairs(cases) do test("Create inet addr from string " .. c[1] .. '; expect ' .. tostring(c[2]), function() local ip = ffi.new("rspamd_inet_addr_t* [1]"); - local res = ffi.C.rspamd_parse_inet_address(ip, c[1]) + local res = ffi.C.rspamd_parse_inet_address(ip, c[1], #c[1]) assert_equal(res, c[2], "Expect " .. tostring(c[2]) .. " while parsing " .. c[1]) if res then ffi.C.rspamd_inet_address_free(ip[0]) diff --git a/test/lua/unit/received.lua b/test/lua/unit/received.lua index c633a99b1..fc1f24de8 100644 --- a/test/lua/unit/received.lua +++ b/test/lua/unit/received.lua @@ -117,6 +117,11 @@ context("Received headers parser", function() by_hostname = 'mail01.someotherdomain.org', } }, + {[[from example.com ([]) by example.com with ESMTP id 2019091111 ; Thu, 26 Sep 2019 11:19:07 +0200]], + { + by_hostname = 'example.com', + }, + } } local task = ffi.C.rspamd_task_new(nil, nil) |