Skip to content
Snippets Groups Projects
Commit a3bce424 authored by Kirill Shcherbatov's avatar Kirill Shcherbatov Committed by Kirill Yukhin
Browse files

tests: fix flaky hints test

We must use long long unsigned numbers on ffi types build to
avoid precision lost.

Follow-up
        f5721edc test: check hints corner cases

Closes #4080
parent f6520860
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,8 @@ inspector:cmd("setopt delimiter ';'"); ...@@ -21,8 +21,8 @@ inspector:cmd("setopt delimiter ';'");
... ...
function insert_values(type) function insert_values(type)
local x = 54 local x = 54
while (x <= 64) do while (x < 64) do
local val = ffi.new(type, 2^x-1) local val = ffi.new(type, (2LLU^x)-1)
s:replace({val}) s:replace({val})
x = x + 1 x = x + 1
end end
...@@ -46,17 +46,16 @@ insert_values('uint64_t') ...@@ -46,17 +46,16 @@ insert_values('uint64_t')
... ...
s:select() s:select()
--- ---
- - [0] - - [18014398509481983]
- [18014398509481984] - [36028797018963967]
- [36028797018963968] - [72057594037927935]
- [72057594037927936] - [144115188075855871]
- [144115188075855872] - [288230376151711743]
- [288230376151711744] - [576460752303423487]
- [576460752303423488] - [1152921504606846975]
- [1152921504606846976] - [2305843009213693951]
- [2305843009213693952] - [4611686018427387903]
- [4611686018427387904] - [9223372036854775807]
- [9223372036854775808]
... ...
i1:alter{parts = {1, 'integer'}} i1:alter{parts = {1, 'integer'}}
--- ---
...@@ -66,18 +65,16 @@ insert_values('int64_t') ...@@ -66,18 +65,16 @@ insert_values('int64_t')
... ...
s:select() s:select()
--- ---
- - [-9223372036854775808] - - [18014398509481983]
- [0] - [36028797018963967]
- [18014398509481984] - [72057594037927935]
- [36028797018963968] - [144115188075855871]
- [72057594037927936] - [288230376151711743]
- [144115188075855872] - [576460752303423487]
- [288230376151711744] - [1152921504606846975]
- [576460752303423488] - [2305843009213693951]
- [1152921504606846976] - [4611686018427387903]
- [2305843009213693952] - [9223372036854775807]
- [4611686018427387904]
- [9223372036854775808]
... ...
i1:alter{parts = {1, 'number'}} i1:alter{parts = {1, 'number'}}
--- ---
...@@ -87,19 +84,26 @@ insert_values('double') ...@@ -87,19 +84,26 @@ insert_values('double')
... ...
s:select() s:select()
--- ---
- - [-9223372036854775808] - - [18014398509481983]
- [0]
- [18014398509481984] - [18014398509481984]
- [36028797018963967]
- [36028797018963968] - [36028797018963968]
- [72057594037927935]
- [72057594037927936] - [72057594037927936]
- [144115188075855871]
- [144115188075855872] - [144115188075855872]
- [288230376151711743]
- [288230376151711744] - [288230376151711744]
- [576460752303423487]
- [576460752303423488] - [576460752303423488]
- [1152921504606846975]
- [1152921504606846976] - [1152921504606846976]
- [2305843009213693951]
- [2305843009213693952] - [2305843009213693952]
- [4611686018427387903]
- [4611686018427387904] - [4611686018427387904]
- [9223372036854775807]
- [9223372036854775808] - [9223372036854775808]
- [1.844674407371e+19]
... ...
s:drop() s:drop()
--- ---
......
...@@ -12,8 +12,8 @@ engine = inspector:get_cfg('engine') ...@@ -12,8 +12,8 @@ engine = inspector:get_cfg('engine')
inspector:cmd("setopt delimiter ';'"); inspector:cmd("setopt delimiter ';'");
function insert_values(type) function insert_values(type)
local x = 54 local x = 54
while (x <= 64) do while (x < 64) do
local val = ffi.new(type, 2^x-1) local val = ffi.new(type, (2LLU^x)-1)
s:replace({val}) s:replace({val})
x = x + 1 x = x + 1
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment