From 720c17f87ac7a2bb094b0e23e23f08b0d334a47a Mon Sep 17 00:00:00 2001
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Date: Mon, 28 Aug 2017 17:06:23 +0300
Subject: [PATCH] test: fix format errors in tests

Part of #2652
---
 test/box/access_misc.result   | 10 ++++++++--
 test/box/access_misc.test.lua |  5 ++++-
 test/box/alter.result         | 36 +++++++++++++++++++++++------------
 test/box/alter.test.lua       | 21 ++++++++++++--------
 test/box/net.box.result       |  6 +++---
 test/box/net.box.test.lua     |  6 +++---
 6 files changed, 55 insertions(+), 29 deletions(-)

diff --git a/test/box/access_misc.result b/test/box/access_misc.result
index 641d7b95bd..455ec1f9a4 100644
--- a/test/box/access_misc.result
+++ b/test/box/access_misc.result
@@ -1,6 +1,12 @@
 session = box.session
 ---
 ...
+utils = require('utils')
+---
+...
+EMPTY_MAP = utils.setmap({})
+---
+...
 --
 -- Check a double create space
 --
@@ -343,12 +349,12 @@ box.space._user:select(1)
 ---
 - error: Read access is denied for user 'testuser' to space '_user'
 ...
-uid = box.space._user:insert{maxuid+1, session.uid(), 'someone', 'user'}[1]
+uid = box.space._user:insert{maxuid+1, session.uid(), 'someone', 'user', EMPTY_MAP}[1]
 ---
 ...
 box.space._user:delete(uid)
 ---
-- [5, 4, 'someone', 'user']
+- [5, 4, 'someone', 'user', {}]
 ...
 session.su('admin')
 ---
diff --git a/test/box/access_misc.test.lua b/test/box/access_misc.test.lua
index 5fde9a98ac..a667e2885a 100644
--- a/test/box/access_misc.test.lua
+++ b/test/box/access_misc.test.lua
@@ -1,4 +1,7 @@
 session = box.session
+utils = require('utils')
+EMPTY_MAP = utils.setmap({})
+
 --
 -- Check a double create space
 --
@@ -141,7 +144,7 @@ session.su('testuser')
 testuser_uid = session.uid()
 box.space._user:delete(2)
 box.space._user:select(1)
-uid = box.space._user:insert{maxuid+1, session.uid(), 'someone', 'user'}[1]
+uid = box.space._user:insert{maxuid+1, session.uid(), 'someone', 'user', EMPTY_MAP}[1]
 box.space._user:delete(uid)
 
 session.su('admin')
diff --git a/test/box/alter.result b/test/box/alter.result
index 06099f0d10..abc38c2595 100644
--- a/test/box/alter.result
+++ b/test/box/alter.result
@@ -17,46 +17,52 @@ test_run:cmd("push filter ', .lsn.: [0-9]+' to ''")
 ---
 - true
 ...
+utils = require('utils')
+---
+...
+EMPTY_MAP = utils.setmap({})
+---
+...
 --
 -- Test insertion into a system space - verify that
 -- mandatory fields are required.
 --
-_space:insert{_space.id, ADMIN, 'test', 5 }
+_space:insert{_space.id, ADMIN, 'test', 'memtx', 0, EMPTY_MAP, {}}
 ---
 - error: Duplicate key exists in unique index 'primary' in space '_space'
 ...
 --
 -- Bad space id
 --
-_space:insert{'hello', 'world', 'test'}
+_space:insert{'hello', 'world', 'test', 'memtx', 0, EMPTY_MAP, {}}
 ---
 - error: 'Tuple field 1 type does not match one required by operation: expected unsigned'
 ...
 --
 -- Can't create a space which has wrong field count - field_count must be NUM
 --
-_space:insert{_space.id, ADMIN, 'test', 'world'}
+_space:insert{_space.id, ADMIN, 'test', 'world', 0, EMPTY_MAP, {}}
 ---
 - error: Duplicate key exists in unique index 'primary' in space '_space'
 ...
 --
 -- There is already a tuple for the system space
 --
-_space:insert{_space.id, ADMIN, '_space', 'memtx', 0}
+_space:insert{_space.id, ADMIN, '_space', 'memtx', 0, EMPTY_MAP, {}}
 ---
 - error: Duplicate key exists in unique index 'primary' in space '_space'
 ...
-_space:replace{_space.id, ADMIN, '_space', 'memtx', 0}
+_space:replace{_space.id, ADMIN, '_space', 'memtx', 0, EMPTY_MAP, {}}
 ---
-- [280, 1, '_space', 'memtx', 0]
+- [280, 1, '_space', 'memtx', 0, {}, []]
 ...
-_space:insert{_index.id, ADMIN, '_index', 'memtx', 0}
+_space:insert{_index.id, ADMIN, '_index', 'memtx', 0, EMPTY_MAP, {}}
 ---
 - error: Duplicate key exists in unique index 'primary' in space '_space'
 ...
-_space:replace{_index.id, ADMIN, '_index', 'memtx', 0}
+_space:replace{_index.id, ADMIN, '_index', 'memtx', 0, EMPTY_MAP, {}}
 ---
-- [288, 1, '_index', 'memtx', 0]
+- [288, 1, '_index', 'memtx', 0, {}, []]
 ...
 --
 -- Can't change properties of a space
@@ -238,12 +244,18 @@ box.snapshot()
 - ok
 ...
 test_run:cmd("restart server default with cleanup=1")
+utils = require('utils')
+---
+...
+EMPTY_MAP = utils.setmap({})
+---
+...
 ADMIN = 1
 ---
 ...
-box.space['_space']:insert{1000, ADMIN, 'test', 'memtx', 0}
+box.space['_space']:insert{1000, ADMIN, 'test', 'memtx', 0, EMPTY_MAP, {}}
 ---
-- [1000, 1, 'test', 'memtx', 0]
+- [1000, 1, 'test', 'memtx', 0, {}, []]
 ...
 box.space[1000].id
 ---
@@ -251,7 +263,7 @@ box.space[1000].id
 ...
 box.space['_space']:delete{1000}
 ---
-- [1000, 1, 'test', 'memtx', 0]
+- [1000, 1, 'test', 'memtx', 0, {}, []]
 ...
 box.space[1000]
 ---
diff --git a/test/box/alter.test.lua b/test/box/alter.test.lua
index e88b78773e..cfc51799ad 100644
--- a/test/box/alter.test.lua
+++ b/test/box/alter.test.lua
@@ -4,26 +4,29 @@ ADMIN = 1
 env = require('test_run')
 test_run = env.new()
 test_run:cmd("push filter ', .lsn.: [0-9]+' to ''")
+utils = require('utils')
+EMPTY_MAP = utils.setmap({})
+
 --
 -- Test insertion into a system space - verify that
 -- mandatory fields are required.
 --
-_space:insert{_space.id, ADMIN, 'test', 5 }
+_space:insert{_space.id, ADMIN, 'test', 'memtx', 0, EMPTY_MAP, {}}
 --
 -- Bad space id
 --
-_space:insert{'hello', 'world', 'test'}
+_space:insert{'hello', 'world', 'test', 'memtx', 0, EMPTY_MAP, {}}
 --
 -- Can't create a space which has wrong field count - field_count must be NUM
 --
-_space:insert{_space.id, ADMIN, 'test', 'world'}
+_space:insert{_space.id, ADMIN, 'test', 'world', 0, EMPTY_MAP, {}}
 --
 -- There is already a tuple for the system space
 --
-_space:insert{_space.id, ADMIN, '_space', 'memtx', 0}
-_space:replace{_space.id, ADMIN, '_space', 'memtx', 0}
-_space:insert{_index.id, ADMIN, '_index', 'memtx', 0}
-_space:replace{_index.id, ADMIN, '_index', 'memtx', 0}
+_space:insert{_space.id, ADMIN, '_space', 'memtx', 0, EMPTY_MAP, {}}
+_space:replace{_space.id, ADMIN, '_space', 'memtx', 0, EMPTY_MAP, {}}
+_space:insert{_index.id, ADMIN, '_index', 'memtx', 0, EMPTY_MAP, {}}
+_space:replace{_index.id, ADMIN, '_index', 'memtx', 0, EMPTY_MAP, {}}
 --
 -- Can't change properties of a space
 --
@@ -77,8 +80,10 @@ _index:run_triggers(false)
 _space:run_triggers(false)
 box.snapshot()
 test_run:cmd("restart server default with cleanup=1")
+utils = require('utils')
+EMPTY_MAP = utils.setmap({})
 ADMIN = 1
-box.space['_space']:insert{1000, ADMIN, 'test', 'memtx', 0}
+box.space['_space']:insert{1000, ADMIN, 'test', 'memtx', 0, EMPTY_MAP, {}}
 box.space[1000].id
 box.space['_space']:delete{1000}
 box.space[1000]
diff --git a/test/box/net.box.result b/test/box/net.box.result
index a0d0264523..7b4d706dac 100644
--- a/test/box/net.box.result
+++ b/test/box/net.box.result
@@ -1755,7 +1755,7 @@ test_run:cmd("clear filter")
 --
 -- gh-2402 net.box doesn't support space:format()
 --
-space = box.schema.space.create('test', {format={{name="id", type="number"}}})
+space = box.schema.space.create('test', {format={{name="id", type="unsigned"}}})
 ---
 ...
 space ~= nil
@@ -1790,7 +1790,7 @@ format[1].name == "id"
 ---
 - true
 ...
-format[1].type == "number"
+format[1].type == "unsigned"
 ---
 - true
 ...
@@ -1807,7 +1807,7 @@ space:drop()
 --
 -- Check that it's possible to get connection object form net.box space
 --
-space = box.schema.space.create('test', {format={{name="id", type="number"}}})
+space = box.schema.space.create('test', {format={{name="id", type="unsigned"}}})
 ---
 ...
 space ~= nil
diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
index e87637aa64..ae1b05c628 100644
--- a/test/box/net.box.test.lua
+++ b/test/box/net.box.test.lua
@@ -707,7 +707,7 @@ test_run:cmd("clear filter")
 -- gh-2402 net.box doesn't support space:format()
 --
 
-space = box.schema.space.create('test', {format={{name="id", type="number"}}})
+space = box.schema.space.create('test', {format={{name="id", type="unsigned"}}})
 space ~= nil
 _ = box.space.test:create_index('primary')
 box.schema.user.grant('guest','read,write,execute','space', 'test')
@@ -721,7 +721,7 @@ format = c.space.test:format()
 
 format[1] ~= nil
 format[1].name == "id"
-format[1].type == "number"
+format[1].type == "unsigned"
 
 c.space.test:format({})
 
@@ -732,7 +732,7 @@ space:drop()
 -- Check that it's possible to get connection object form net.box space
 --
 
-space = box.schema.space.create('test', {format={{name="id", type="number"}}})
+space = box.schema.space.create('test', {format={{name="id", type="unsigned"}}})
 space ~= nil
 _ = box.space.test:create_index('primary')
 box.schema.user.grant('guest','read,write,execute','space', 'test')
-- 
GitLab