From 8ed5cbcf6439bbbbaa7e05ef56c93abdf3b87c88 Mon Sep 17 00:00:00 2001 From: Vladimir Dronnikov Date: Sat, 20 Oct 2012 14:14:42 +0400 Subject: [PATCH] relaxed assertion on not found random addresses --- test/test.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test.lua b/test/test.lua index 690af0f..905a17c 100644 --- a/test/test.lua +++ b/test/test.lua @@ -222,7 +222,10 @@ for i = 1, #profiles do if i % 1e4 == 0 then print("#", i, "of", num_queries) end - assert(geodb:query_by_ipnum(cases[i], p.field)) + local result, err = geodb:query_by_ipnum(cases[i], p.field) + if not result and err ~= "not found" then + error(err) + end end print( @@ -253,7 +256,10 @@ for i = 1, #profiles do if i % 1e4 == 0 then print("#", i, "of", num_queries) end - assert(geodb:query_by_name(cases[i], p.field)) + local result, err = geodb:query_by_name(cases[i], p.field) + if not result and err ~= "not found" then + error(err) + end end print(