From: Vsevolod Stakhov Date: Thu, 26 Sep 2019 11:10:50 +0000 (+0100) Subject: [Test] Adjust tests X-Git-Tag: 2.0~119 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b0a535c17f7db5ce436a40425e9d2cad2555e0f9;p=rspamd.git [Test] Adjust tests --- 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)