From 51130eb888c8509de26bf7ca402d956f5cd027bf Mon Sep 17 00:00:00 2001 From: Alexander Turenko <alexander.turenko@tarantool.org> Date: Mon, 13 Jan 2020 17:22:54 +0300 Subject: [PATCH] test: drop dead code from app-tap/msgpackffi test It appears due to improper conflict resolution after pushing the following commits in the reverse order: * 2b9ef8d15 lua: don't modify pointer type in msgpack.decode* * 84bcba52a lua: keeping the pointer type in msgpackffi.decode() Originally 84bcba52a (which should land first) fixes the msgpackffi module and introduces the test_decode_buffer() function locally for the msgpackffi test. Then 2b9ef8d15 fixes the msgpack module in the same way, expands and moves the test_decode_buffer() function to serializer_test.lua (to use in msgpack and msgpackffi tests both). After changes made to push the commits in the reverse order, those commits doing something weird around tests. However the resulting state is different from the right one just in the dead function in msgpackffi.test.lua. Follows up #3926. (cherry picked from commit ec32424744fb2ce69a3f336e353c986bc649bbba) --- test/app-tap/msgpackffi.test.lua | 39 -------------------------------- 1 file changed, 39 deletions(-) diff --git a/test/app-tap/msgpackffi.test.lua b/test/app-tap/msgpackffi.test.lua index bb9826580a..6f75fad9f0 100755 --- a/test/app-tap/msgpackffi.test.lua +++ b/test/app-tap/msgpackffi.test.lua @@ -116,45 +116,6 @@ local function test_other(test, s) encode_max_depth = max_depth}) end --- gh-3926: Ensure that a returned pointer has the same cdata type --- as passed argument. -local function test_decode_buffer(test, s) - local cases = { - { - 'decode_unchecked(cdata<const char *>)', - data = ffi.cast('const char *', '\x93\x01\x02\x03'), - exp_res = {1, 2, 3}, - exp_rewind = 4, - }, - { - 'decode_unchecked(cdata<char *>)', - data = ffi.cast('char *', '\x93\x01\x02\x03'), - exp_res = {1, 2, 3}, - exp_rewind = 4, - }, - } - - test:plan(#cases) - - for _, case in ipairs(cases) do - test:test(case[1], function(test) - test:plan(4) - local res, res_buf = s.decode_unchecked(case.data) - test:is_deeply(res, case.exp_res, 'verify result') - local rewind = res_buf - case.data - test:is(rewind, case.exp_rewind, 'verify resulting buffer') - -- test:iscdata() is not sufficient here, because it - -- ignores 'const' qualifier (because of using - -- ffi.istype()). - test:is(type(res_buf), 'cdata', 'verify resulting buffer type') - local data_ctype = tostring(ffi.typeof(case.data)) - local res_buf_ctype = tostring(ffi.typeof(res_buf)) - test:is(res_buf_ctype, data_ctype, 'verify resulting buffer ctype') - end) - end -end - - tap.test("msgpackffi", function(test) local serializer = require('msgpackffi') test:plan(10) -- GitLab