From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Kirill Shcherbatov Subject: [PATCH v1 1/1] tests: fix flaky hints test Date: Wed, 27 Mar 2019 17:16:56 +0300 Message-Id: <0ad1aa7a7046e13b5705cf4c5b8c7a5c6216f23d.1553696115.git.kshcherbatov@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: tarantool-patches@freelists.org, vdavydov.dev@gmail.com Cc: Kirill Shcherbatov List-ID: We must use long long unsigned numbers on ffi types build to avoid precision lost. Follow-up f5721edc825b test: check hints corner cases Closes #4080 --- https://github.com/tarantool/tarantool/issues/4080 https://github.com/tarantool/tarantool/tree/kshch/gh-4080-hints-fixup test/engine/hints.result | 60 ++++++++++++++++++++------------------ test/engine/hints.test.lua | 4 +-- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/test/engine/hints.result b/test/engine/hints.result index 946f82039..9841341ce 100644 --- a/test/engine/hints.result +++ b/test/engine/hints.result @@ -21,8 +21,8 @@ inspector:cmd("setopt delimiter ';'"); ... function insert_values(type) local x = 54 - while (x <= 64) do - local val = ffi.new(type, 2^x-1) + while (x < 64) do + local val = ffi.new(type, (2LLU^x)-1) s:replace({val}) x = x + 1 end @@ -46,17 +46,16 @@ insert_values('uint64_t') ... s:select() --- -- - [0] - - [18014398509481984] - - [36028797018963968] - - [72057594037927936] - - [144115188075855872] - - [288230376151711744] - - [576460752303423488] - - [1152921504606846976] - - [2305843009213693952] - - [4611686018427387904] - - [9223372036854775808] +- - [18014398509481983] + - [36028797018963967] + - [72057594037927935] + - [144115188075855871] + - [288230376151711743] + - [576460752303423487] + - [1152921504606846975] + - [2305843009213693951] + - [4611686018427387903] + - [9223372036854775807] ... i1:alter{parts = {1, 'integer'}} --- @@ -66,18 +65,16 @@ insert_values('int64_t') ... s:select() --- -- - [-9223372036854775808] - - [0] - - [18014398509481984] - - [36028797018963968] - - [72057594037927936] - - [144115188075855872] - - [288230376151711744] - - [576460752303423488] - - [1152921504606846976] - - [2305843009213693952] - - [4611686018427387904] - - [9223372036854775808] +- - [18014398509481983] + - [36028797018963967] + - [72057594037927935] + - [144115188075855871] + - [288230376151711743] + - [576460752303423487] + - [1152921504606846975] + - [2305843009213693951] + - [4611686018427387903] + - [9223372036854775807] ... i1:alter{parts = {1, 'number'}} --- @@ -87,19 +84,26 @@ insert_values('double') ... s:select() --- -- - [-9223372036854775808] - - [0] +- - [18014398509481983] - [18014398509481984] + - [36028797018963967] - [36028797018963968] + - [72057594037927935] - [72057594037927936] + - [144115188075855871] - [144115188075855872] + - [288230376151711743] - [288230376151711744] + - [576460752303423487] - [576460752303423488] + - [1152921504606846975] - [1152921504606846976] + - [2305843009213693951] - [2305843009213693952] + - [4611686018427387903] - [4611686018427387904] + - [9223372036854775807] - [9223372036854775808] - - [1.844674407371e+19] ... s:drop() --- diff --git a/test/engine/hints.test.lua b/test/engine/hints.test.lua index 266516ec9..f081ebed1 100644 --- a/test/engine/hints.test.lua +++ b/test/engine/hints.test.lua @@ -12,8 +12,8 @@ engine = inspector:get_cfg('engine') inspector:cmd("setopt delimiter ';'"); function insert_values(type) local x = 54 - while (x <= 64) do - local val = ffi.new(type, 2^x-1) + while (x < 64) do + local val = ffi.new(type, (2LLU^x)-1) s:replace({val}) x = x + 1 end -- 2.21.0