transactd 3.5.0-x86-mswin32-100 → 3.6.0-x86-mswin32-100
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/2.0/transactd.so +0 -0
- data/bin/2.1/transactd.so +0 -0
- data/bin/2.2/transactd.so +0 -0
- data/bin/2.3/transactd.so +0 -0
- data/bin/common/{tdclc_32_3_5.dll → tdclc_32_3_6.dll} +0 -0
- data/bin/common/tdclcpp_vc100_32mr_3_6.dll +0 -0
- data/source/bzs/test/tdclrb/transactd_datetime_spec.rb +40 -4
- data/source/bzs/test/tdclrb/transactd_fetch_spec.rb +785 -0
- data/source/bzs/test/tdclrb/transactd_pool_spec.rb +21 -1
- data/source/bzs/test/tdclrb/transactd_setget_spec.rb +450 -0
- data/source/bzs/test/tdclrb/transactd_spec.rb +14 -2
- data/source/bzs/test/tdclrb/transactd_v3_spec.rb +1192 -11
- data/transactd.gemspec +1 -1
- metadata +7 -5
- data/bin/common/tdclcpp_vc100_32mr_3_5.dll +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e1f784449abf50bb8c1bfa0957283a00f8d4600
|
4
|
+
data.tar.gz: b340100d7034ab744751b07138c34f9dcb31808f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5087302871111abe520e05e50de559bf7627dce6e78099057f795e3e69445470b8f22ce06784815d7b23f5c12020eae0de22c5b20547eb7a823b5cd6ff9dc2c
|
7
|
+
data.tar.gz: ca8ef8451029d95b90e1ec09f551d18a514d856488d122980e4e0af4eb207acc68e230f50f2a7e0376b06161ab034524b8749c6eca49459081c0c53a4393ce02
|
data/bin/2.0/transactd.so
CHANGED
Binary file
|
data/bin/2.1/transactd.so
CHANGED
Binary file
|
data/bin/2.2/transactd.so
CHANGED
Binary file
|
data/bin/2.3/transactd.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
@@ -20,6 +20,14 @@
|
|
20
20
|
=end
|
21
21
|
require 'transactd'
|
22
22
|
|
23
|
+
def hhnnssuu2i(hh, nn, ss, uu)
|
24
|
+
uu + ss * 256 + nn * 256**2 + hh * 256**3
|
25
|
+
end
|
26
|
+
|
27
|
+
def yymmdd2i(yy, mm, dd)
|
28
|
+
dd + mm * 256 + yy * 256**2
|
29
|
+
end
|
30
|
+
|
23
31
|
describe Transactd, 'datetime' do
|
24
32
|
it 'get BtrDate' do
|
25
33
|
i_nowdate = Transactd::getNowDate() # get today as integer
|
@@ -28,8 +36,8 @@ describe Transactd, 'datetime' do
|
|
28
36
|
#p i_nowdate
|
29
37
|
#p s_i_nowdate + ' ' + s_i_nowdate.encoding.to_s
|
30
38
|
#p s_i_nowdate2 + ' ' + s_i_nowdate2.encoding.to_s
|
31
|
-
nowdate = Transactd::BtrDate.new()
|
32
|
-
nowdate.i = i_nowdate
|
39
|
+
nowdate = Transactd::BtrDate.new() # get today as BtrDate
|
40
|
+
nowdate.i = i_nowdate
|
33
41
|
s_nowdate = Transactd::btrdtoa(nowdate)
|
34
42
|
s_nowdate2 = Transactd::btrdtoa(nowdate, true)
|
35
43
|
#p nowdate
|
@@ -37,6 +45,19 @@ describe Transactd, 'datetime' do
|
|
37
45
|
#p s_nowdate2 + ' ' + s_nowdate2.encoding.to_s
|
38
46
|
expect(s_i_nowdate).to eq s_nowdate
|
39
47
|
expect(s_i_nowdate2).to eq s_nowdate2
|
48
|
+
expect(nowdate.yy.class).to eq Fixnum
|
49
|
+
expect(nowdate.mm.class).to eq Fixnum
|
50
|
+
expect(nowdate.dd.class).to eq Fixnum
|
51
|
+
expect("#{format('%04d', nowdate.yy)}/#{format('%02d', nowdate.mm)}/#{format('%02d', nowdate.dd)}").to eq s_nowdate
|
52
|
+
expect("#{format('%04d', nowdate.yy)}-#{format('%02d', nowdate.mm)}-#{format('%02d', nowdate.dd)}").to eq s_nowdate2
|
53
|
+
expect(i_nowdate).to eq yymmdd2i(nowdate.yy, nowdate.mm, nowdate.dd)
|
54
|
+
nowdate.yy = 2014
|
55
|
+
nowdate.mm = 8
|
56
|
+
nowdate.dd = 15
|
57
|
+
expect(nowdate.yy).to eq 2014
|
58
|
+
expect(nowdate.mm).to eq 8
|
59
|
+
expect(nowdate.dd).to eq 15
|
60
|
+
expect(nowdate.i).to eq yymmdd2i(2014, 8, 15)
|
40
61
|
end
|
41
62
|
|
42
63
|
it 'get BtrTime' do
|
@@ -44,12 +65,27 @@ describe Transactd, 'datetime' do
|
|
44
65
|
s_i_nowtime = Transactd::btrttoa(i_nowtime)
|
45
66
|
#p i_nowtime
|
46
67
|
#p s_i_nowtime + ' ' + s_i_nowtime.encoding.to_s
|
47
|
-
nowtime = Transactd::BtrTime.new()
|
48
|
-
nowtime.i = i_nowtime
|
68
|
+
nowtime = Transactd::BtrTime.new() # get now time as BtrTime
|
69
|
+
nowtime.i = i_nowtime
|
49
70
|
s_nowtime = Transactd::btrttoa(nowtime)
|
50
71
|
#p nowtime
|
51
72
|
#p s_nowtime + ' ' + s_nowtime.encoding.to_s
|
52
73
|
expect(s_i_nowtime).to eq s_nowtime
|
74
|
+
expect(nowtime.hh.class).to eq Fixnum
|
75
|
+
expect(nowtime.nn.class).to eq Fixnum
|
76
|
+
expect(nowtime.ss.class).to eq Fixnum
|
77
|
+
expect(nowtime.uu.class).to eq Fixnum
|
78
|
+
expect("#{format('%02d', nowtime.hh)}:#{format('%02d', nowtime.nn)}:#{format('%02d', nowtime.ss)}").to eq s_nowtime
|
79
|
+
expect(i_nowtime).to eq hhnnssuu2i(nowtime.hh, nowtime.nn, nowtime.ss, nowtime.uu)
|
80
|
+
nowtime.hh = 1
|
81
|
+
nowtime.nn = 2
|
82
|
+
nowtime.ss = 31
|
83
|
+
nowtime.uu = 32
|
84
|
+
expect(nowtime.hh).to eq 1
|
85
|
+
expect(nowtime.nn).to eq 2
|
86
|
+
expect(nowtime.ss).to eq 31
|
87
|
+
expect(nowtime.uu).to eq 32
|
88
|
+
expect(nowtime.i).to eq hhnnssuu2i(1, 2, 31, 32)
|
53
89
|
end
|
54
90
|
|
55
91
|
it 'get BtrDateTime' do
|
@@ -0,0 +1,785 @@
|
|
1
|
+
# coding : utf-8
|
2
|
+
=begin ============================================================
|
3
|
+
Copyright (C) 2015 BizStation Corp All rights reserved.
|
4
|
+
|
5
|
+
This program is free software; you can redistribute it and/or
|
6
|
+
modify it under the terms of the GNU General Public License
|
7
|
+
as published by the Free Software Foundation; either version 2
|
8
|
+
of the License, or (at your option) any later version.
|
9
|
+
|
10
|
+
This program is distributed in the hope that it will be useful,
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
GNU General Public License for more details.
|
14
|
+
|
15
|
+
You should have received a copy of the GNU General Public License
|
16
|
+
along with this program; if not, write to the Free Software
|
17
|
+
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
18
|
+
02111-1307, USA.
|
19
|
+
===================================================================
|
20
|
+
=end
|
21
|
+
require 'transactd'
|
22
|
+
|
23
|
+
require 'rbconfig'
|
24
|
+
|
25
|
+
def getEnv(valuename)
|
26
|
+
return ENV[valuename] if ENV[valuename] != nil
|
27
|
+
return ''
|
28
|
+
end
|
29
|
+
|
30
|
+
def getHost()
|
31
|
+
hostname = getEnv('TRANSACTD_RSPEC_HOST')
|
32
|
+
hostname = '127.0.0.1/' if hostname == ''
|
33
|
+
hostname = hostname + '/' unless (hostname =~ /\/$/)
|
34
|
+
return hostname
|
35
|
+
end
|
36
|
+
|
37
|
+
HOSTNAME = getHost()
|
38
|
+
USERNAME = getEnv('TRANSACTD_RSPEC_USER')
|
39
|
+
USERPART = USERNAME == '' ? '' : USERNAME + '@'
|
40
|
+
PASSWORD = getEnv('TRANSACTD_RSPEC_PASS')
|
41
|
+
PASSPART = PASSWORD == '' ? '' : '&pwd=' + PASSWORD
|
42
|
+
URL = 'tdap://' + USERPART + HOSTNAME + 'test_fetch?dbfile=transactd_schema' + PASSPART
|
43
|
+
TABLENAME = 'users'
|
44
|
+
|
45
|
+
FIELDS = ['id', 'name', 'age', 'group_id'];
|
46
|
+
ALIASED_FIELDS = ['id', 'name', 'age', 'group'];
|
47
|
+
|
48
|
+
MAX_ID = 2000
|
49
|
+
CHECK_MAX_ID = 10
|
50
|
+
FETCHMODES = [Transactd::FETCH_VAL_NUM, Transactd::FETCH_VAL_ASSOC, Transactd::FETCH_VAL_BOTH,
|
51
|
+
Transactd::FETCH_OBJ, Transactd::FETCH_USR_CLASS, Transactd::FETCH_RECORD_INTO]
|
52
|
+
|
53
|
+
def dropDatabase(db)
|
54
|
+
db.drop(URL)
|
55
|
+
expect(db.stat()).to eq 0
|
56
|
+
end
|
57
|
+
|
58
|
+
def createDatabase(db)
|
59
|
+
db.create(URL)
|
60
|
+
if (db.stat() == Transactd::STATUS_TABLE_EXISTS_ERROR)
|
61
|
+
dropDatabase(db)
|
62
|
+
db.create(URL)
|
63
|
+
end
|
64
|
+
expect(db.stat()).to eq 0
|
65
|
+
end
|
66
|
+
|
67
|
+
def openDatabase(db)
|
68
|
+
return db.open(URL, Transactd::TYPE_SCHEMA_BDF, Transactd::TD_OPEN_NORMAL)
|
69
|
+
end
|
70
|
+
|
71
|
+
def createUsersTable(db)
|
72
|
+
openDatabase(db)
|
73
|
+
dbdef = db.dbDef()
|
74
|
+
expect(dbdef).not_to eq nil
|
75
|
+
td = Transactd::Tabledef.new()
|
76
|
+
td.schemaCodePage = Transactd::CP_UTF8
|
77
|
+
td.setTableName(TABLENAME)
|
78
|
+
td.setFileName(TABLENAME)
|
79
|
+
td.charsetIndex = Transactd::CHARSET_UTF8
|
80
|
+
tableid = 1
|
81
|
+
td.id = tableid
|
82
|
+
dbdef.insertTable(td)
|
83
|
+
expect(dbdef.stat()).to eq 0
|
84
|
+
# id
|
85
|
+
fieldIndex = 0
|
86
|
+
fd = dbdef.insertField(tableid, fieldIndex)
|
87
|
+
fd.setName(FIELDS[fieldIndex])
|
88
|
+
fd.type = Transactd::Ft_integer
|
89
|
+
fd.len = 4
|
90
|
+
# name
|
91
|
+
fieldIndex += 1
|
92
|
+
fd = dbdef.insertField(tableid, fieldIndex)
|
93
|
+
fd.setName(FIELDS[fieldIndex])
|
94
|
+
fd.type = Transactd::Ft_myvarchar
|
95
|
+
fd.setLenByCharnum(60)
|
96
|
+
# age
|
97
|
+
fieldIndex += 1
|
98
|
+
fd = dbdef.insertField(tableid, fieldIndex)
|
99
|
+
fd.setName(FIELDS[fieldIndex])
|
100
|
+
fd.type = Transactd::Ft_integer
|
101
|
+
fd.len = 4
|
102
|
+
# group_id
|
103
|
+
fieldIndex += 1
|
104
|
+
fd = dbdef.insertField(tableid, fieldIndex)
|
105
|
+
fd.setName(FIELDS[fieldIndex])
|
106
|
+
fd.type = Transactd::Ft_integer
|
107
|
+
fd.len = 4
|
108
|
+
# primary key
|
109
|
+
keynum = 0
|
110
|
+
kd = dbdef.insertKey(tableid, keynum)
|
111
|
+
kd.segment(0).fieldNum = 0 # id
|
112
|
+
kd.segment(0).flags.bit8 = 1
|
113
|
+
kd.segment(0).flags.bit1 = 1
|
114
|
+
kd.segmentCount = 1
|
115
|
+
td = dbdef.tableDefs(tableid)
|
116
|
+
td.primaryKeyNum = keynum
|
117
|
+
# update
|
118
|
+
dbdef.updateTableDef(tableid)
|
119
|
+
expect(dbdef.stat()).to eq 0
|
120
|
+
end
|
121
|
+
|
122
|
+
def insertData(db)
|
123
|
+
tb = db.openTable(TABLENAME, Transactd::TD_OPEN_NORMAL)
|
124
|
+
expect(db.stat()).to eq 0
|
125
|
+
begin
|
126
|
+
db.beginTrn()
|
127
|
+
tb.clearBuffer()
|
128
|
+
for i in 1..MAX_ID
|
129
|
+
tb.setFV(0, i) # id
|
130
|
+
tb.setFV(1, i.to_s() + " user") # name
|
131
|
+
tb.setFV(2, (i % 50) + 15 + rand(15)) # age
|
132
|
+
tb.setFV(3, (i + rand(5)) % 5) # group_id
|
133
|
+
tb.insert()
|
134
|
+
end
|
135
|
+
db.endTrn()
|
136
|
+
tb.close()
|
137
|
+
rescue => e
|
138
|
+
db.abortTrn()
|
139
|
+
tb.close()
|
140
|
+
expect(true).to eq false
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
|
145
|
+
class UserBase
|
146
|
+
@_alias_map = {}
|
147
|
+
def self.setAlias(aliased)
|
148
|
+
@_alias_map = (aliased ? { :group => 'group_id' } : {}) # This is reverse map
|
149
|
+
self
|
150
|
+
end
|
151
|
+
def self.alias_map
|
152
|
+
return @_alias_map
|
153
|
+
end
|
154
|
+
|
155
|
+
@_nodefine_original = false
|
156
|
+
def self.set_nodefine_original(v)
|
157
|
+
@_nodefine_original = v
|
158
|
+
self
|
159
|
+
end
|
160
|
+
def self.nodefine_original
|
161
|
+
return @_nodefine_original
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
|
166
|
+
def openTable(db)
|
167
|
+
tb = db.openTable(TABLENAME)
|
168
|
+
expect(db.stat()).to eq 0
|
169
|
+
return tb
|
170
|
+
end
|
171
|
+
|
172
|
+
def seekId1(tb)
|
173
|
+
tb.setKeyNum(0)
|
174
|
+
expect(tb.stat()).to eq 0
|
175
|
+
tb.clearBuffer()
|
176
|
+
expect(tb.stat()).to eq 0
|
177
|
+
tb.setFV(0, 1)
|
178
|
+
expect(tb.stat()).to eq 0
|
179
|
+
tb.seek()
|
180
|
+
expect(tb.stat()).to eq 0
|
181
|
+
return tb.fields
|
182
|
+
end
|
183
|
+
|
184
|
+
def openActiveTable(db, alias_map = nil)
|
185
|
+
at = Transactd::ActiveTable.new(db, TABLENAME)
|
186
|
+
at.index(0).keyValue(0, 0)
|
187
|
+
if alias_map.is_a?(Hash)
|
188
|
+
at.resetAlias()
|
189
|
+
alias_map.each {|key, orign| at.alias(orign, key.to_s) }
|
190
|
+
else
|
191
|
+
at.alias('group_id', 'group')
|
192
|
+
end
|
193
|
+
return at
|
194
|
+
end
|
195
|
+
|
196
|
+
def getRecordSet(at)
|
197
|
+
rs = at.read(Transactd::Query.new())
|
198
|
+
expect(rs.size()).to be > 0
|
199
|
+
return rs
|
200
|
+
end
|
201
|
+
|
202
|
+
def doTestArray(rec, rec_id = 1)
|
203
|
+
expect(rec.is_a?(Array)).to eq true
|
204
|
+
expect(rec.length).to eq FIELDS.length
|
205
|
+
expect(rec[0]).to eq rec_id
|
206
|
+
expect(rec[1]).to eq "#{rec_id} user"
|
207
|
+
end
|
208
|
+
|
209
|
+
def doTestHash(rec, aliased, with_number, rec_id = 1)
|
210
|
+
expect(rec.is_a?(Hash)).to eq true
|
211
|
+
fs = aliased ? ALIASED_FIELDS : FIELDS
|
212
|
+
for name in fs
|
213
|
+
expect(rec.has_key?(name)).to eq true
|
214
|
+
end
|
215
|
+
for i in 0...fs.length
|
216
|
+
expect(rec.has_key?(i)).to eq with_number
|
217
|
+
end
|
218
|
+
expect(rec[FIELDS[0]]).to eq rec_id
|
219
|
+
expect(rec[FIELDS[1]]).to eq "#{rec_id} user"
|
220
|
+
if with_number
|
221
|
+
expect(rec[0]).to eq rec_id
|
222
|
+
expect(rec[1]).to eq "#{rec_id} user"
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
def doTestObject(rec, aliased, rec_id = 1)
|
227
|
+
expect(rec.is_a?(Object)).to eq true
|
228
|
+
expect(rec.is_a?(Hash)).to eq false
|
229
|
+
expect(rec.is_a?(Array)).to eq false
|
230
|
+
fs = aliased ? ALIASED_FIELDS : FIELDS
|
231
|
+
for name in fs
|
232
|
+
expect(rec.respond_to?(name)).to eq true
|
233
|
+
expect(rec.respond_to?(name + '=')).to eq true
|
234
|
+
end
|
235
|
+
expect(rec.id).to eq rec_id
|
236
|
+
expect(rec.name).to eq "#{rec_id} user"
|
237
|
+
rec.id = rec_id + 10
|
238
|
+
rec.name = "#{rec_id} user *"
|
239
|
+
expect(rec.id).to eq rec_id + 10
|
240
|
+
expect(rec.name).to eq "#{rec_id} user *"
|
241
|
+
end
|
242
|
+
|
243
|
+
def doTestClass(rec, klass)
|
244
|
+
aliased = klass.alias_map.length != 0
|
245
|
+
expect(rec.is_a?(klass)).to eq true
|
246
|
+
expect(rec.is_a?(Hash)).to eq false
|
247
|
+
expect(rec.is_a?(Array)).to eq false
|
248
|
+
expected_fields = aliased ? ALIASED_FIELDS : FIELDS
|
249
|
+
expected_fields += FIELDS unless klass.nodefine_original
|
250
|
+
expected_fields.uniq!
|
251
|
+
not_expected_fields = (ALIASED_FIELDS | FIELDS) - expected_fields
|
252
|
+
#p expected_fields
|
253
|
+
#p not_expected_fields
|
254
|
+
for name in expected_fields
|
255
|
+
expect(rec.respond_to?(name)).to eq true
|
256
|
+
expect(rec.respond_to?(name + '=')).to eq true
|
257
|
+
end
|
258
|
+
for name in not_expected_fields
|
259
|
+
expect(rec.respond_to?(name)).to eq false
|
260
|
+
expect(rec.respond_to?(name + '=')).to eq false
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
def doTestTable(db, klass)
|
265
|
+
# table
|
266
|
+
tb = openTable(db)
|
267
|
+
tb.fetchMode = Transactd::FETCH_USR_CLASS
|
268
|
+
tb.fetchClass = klass
|
269
|
+
if klass.alias_map.length > 0
|
270
|
+
tb.setAlias("group_id", "group")
|
271
|
+
end
|
272
|
+
rec = seekId1(tb)
|
273
|
+
doTestClass(rec, klass)
|
274
|
+
for i in 2..CHECK_MAX_ID
|
275
|
+
tb.seekNext()
|
276
|
+
expect(tb.stat()).to eq 0
|
277
|
+
rec = tb.fields()
|
278
|
+
doTestClass(rec, klass)
|
279
|
+
end
|
280
|
+
tb.close()
|
281
|
+
end
|
282
|
+
|
283
|
+
def doTestRecordset(rs, klass)
|
284
|
+
# recordset
|
285
|
+
rs.fetchClass = klass
|
286
|
+
for i in 0...CHECK_MAX_ID
|
287
|
+
rec = rs[i]
|
288
|
+
doTestClass(rec, klass)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
def doTestFieldsBase(rec, aliased, rec_id = 1)
|
293
|
+
expect(rec.is_a?(Transactd::Record)).to eq true
|
294
|
+
expect(rec.is_a?(Hash)).to eq false
|
295
|
+
expect(rec.is_a?(Array)).to eq false
|
296
|
+
fs = aliased ? ALIASED_FIELDS : FIELDS
|
297
|
+
for i in 0...fs.length
|
298
|
+
expect(rec.indexByName(fs[i])).to eq i
|
299
|
+
end
|
300
|
+
expect(rec[rec.indexByName(fs[0])]).to eq rec_id
|
301
|
+
expect(rec[rec.indexByName(fs[1])]).to eq "#{rec_id} user"
|
302
|
+
end
|
303
|
+
|
304
|
+
def findAll(tb)
|
305
|
+
tb.setFilter('', 0, 0)
|
306
|
+
expect(tb.stat()).to eq 0
|
307
|
+
tb.setKeyNum(0)
|
308
|
+
expect(tb.stat()).to eq 0
|
309
|
+
tb.clearBuffer()
|
310
|
+
expect(tb.stat()).to eq 0
|
311
|
+
tb.seekFirst(0)
|
312
|
+
expect(tb.stat()).to eq 0
|
313
|
+
q = Transactd::Query.new()
|
314
|
+
q.where('id', '<=', CHECK_MAX_ID).reject(1)
|
315
|
+
tb.setQuery(q)
|
316
|
+
expect(tb.stat()).to eq 0
|
317
|
+
return tb.findAll
|
318
|
+
end
|
319
|
+
|
320
|
+
def getRecordSetForFindAll(at)
|
321
|
+
q = Transactd::Query.new()
|
322
|
+
q.where('id', '<=', CHECK_MAX_ID).reject(1)
|
323
|
+
rs = at.read(q)
|
324
|
+
expect(rs.size()).to eq CHECK_MAX_ID
|
325
|
+
return rs
|
326
|
+
end
|
327
|
+
|
328
|
+
def doTestTableArray(db, klass)
|
329
|
+
# table
|
330
|
+
tb = openTable(db)
|
331
|
+
tb.fetchMode = Transactd::FETCH_USR_CLASS
|
332
|
+
tb.fetchClass = klass
|
333
|
+
if klass.alias_map.length > 0
|
334
|
+
tb.setAlias("group_id", "group")
|
335
|
+
end
|
336
|
+
arr = findAll(tb)
|
337
|
+
expect(arr.is_a?(Array)).to eq true
|
338
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
339
|
+
for i in 0...arr.length
|
340
|
+
rec = arr[i]
|
341
|
+
doTestClass(rec, klass)
|
342
|
+
end
|
343
|
+
tb.close()
|
344
|
+
end
|
345
|
+
|
346
|
+
def doTestRecordsetArray(rs, klass)
|
347
|
+
# recordset
|
348
|
+
rs.fetchClass = klass
|
349
|
+
arr = rs.to_a
|
350
|
+
expect(arr.is_a?(Array)).to eq true
|
351
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
352
|
+
for i in 0...arr.length
|
353
|
+
rec = arr[i]
|
354
|
+
doTestClass(rec, klass)
|
355
|
+
end
|
356
|
+
end
|
357
|
+
|
358
|
+
describe Transactd, 'FetchMode' do
|
359
|
+
it 'create database and table' do
|
360
|
+
db = Transactd::Database.new()
|
361
|
+
createDatabase(db)
|
362
|
+
openDatabase(db)
|
363
|
+
createUsersTable(db)
|
364
|
+
insertData(db)
|
365
|
+
db.close()
|
366
|
+
end
|
367
|
+
|
368
|
+
it 'fetch with FETCH_VAL_NUM' do
|
369
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
370
|
+
db = Transactd::Database.new()
|
371
|
+
openDatabase(db)
|
372
|
+
# table
|
373
|
+
tb = openTable(db)
|
374
|
+
tb.fetchMode = Transactd::FETCH_VAL_NUM
|
375
|
+
rec = seekId1(tb)
|
376
|
+
doTestArray(rec)
|
377
|
+
for i in 2..CHECK_MAX_ID
|
378
|
+
tb.seekNext()
|
379
|
+
expect(tb.stat()).to eq 0
|
380
|
+
rec = tb.fields()
|
381
|
+
doTestArray(rec, i)
|
382
|
+
end
|
383
|
+
tb.close()
|
384
|
+
# activeTable
|
385
|
+
at = openActiveTable(db)
|
386
|
+
rs = getRecordSet(at)
|
387
|
+
rs.fetchMode = Transactd::FETCH_VAL_NUM
|
388
|
+
for i in 0...CHECK_MAX_ID
|
389
|
+
rec = rs[i]
|
390
|
+
doTestArray(rec, i + 1)
|
391
|
+
end
|
392
|
+
at.release()
|
393
|
+
db.close()
|
394
|
+
end
|
395
|
+
|
396
|
+
it 'fetch with FETCH_VAL_ASSOC' do
|
397
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
398
|
+
db = Transactd::Database.new()
|
399
|
+
openDatabase(db)
|
400
|
+
# table
|
401
|
+
tb = openTable(db)
|
402
|
+
tb.fetchMode = Transactd::FETCH_VAL_ASSOC
|
403
|
+
rec = seekId1(tb)
|
404
|
+
doTestHash(rec, false, false)
|
405
|
+
for i in 2..CHECK_MAX_ID
|
406
|
+
tb.seekNext()
|
407
|
+
expect(tb.stat()).to eq 0
|
408
|
+
rec = tb.fields()
|
409
|
+
doTestHash(rec, false, false, i)
|
410
|
+
end
|
411
|
+
tb.close()
|
412
|
+
# activeTable
|
413
|
+
at = openActiveTable(db)
|
414
|
+
rs = getRecordSet(at)
|
415
|
+
rs.fetchMode = Transactd::FETCH_VAL_ASSOC
|
416
|
+
for i in 0...CHECK_MAX_ID
|
417
|
+
rec = rs[i]
|
418
|
+
doTestHash(rec, true, false, i + 1)
|
419
|
+
end
|
420
|
+
at.release()
|
421
|
+
db.close()
|
422
|
+
end
|
423
|
+
|
424
|
+
it 'fetch with FETCH_VAL_BOTH' do
|
425
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
426
|
+
db = Transactd::Database.new()
|
427
|
+
openDatabase(db)
|
428
|
+
# table
|
429
|
+
tb = openTable(db)
|
430
|
+
tb.fetchMode = Transactd::FETCH_VAL_BOTH
|
431
|
+
rec = seekId1(tb)
|
432
|
+
doTestHash(rec, false, true)
|
433
|
+
for i in 2..CHECK_MAX_ID
|
434
|
+
tb.seekNext()
|
435
|
+
expect(tb.stat()).to eq 0
|
436
|
+
rec = tb.fields()
|
437
|
+
doTestHash(rec, false, true, i)
|
438
|
+
end
|
439
|
+
tb.close()
|
440
|
+
# activeTable
|
441
|
+
at = openActiveTable(db)
|
442
|
+
rs = getRecordSet(at)
|
443
|
+
rs.fetchMode = Transactd::FETCH_VAL_BOTH
|
444
|
+
for i in 0...CHECK_MAX_ID
|
445
|
+
rec = rs[i]
|
446
|
+
doTestHash(rec, true, true, i + 1)
|
447
|
+
end
|
448
|
+
at.release()
|
449
|
+
db.close()
|
450
|
+
end
|
451
|
+
|
452
|
+
it 'fetch with FETCH_OBJ' do
|
453
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
454
|
+
db = Transactd::Database.new()
|
455
|
+
openDatabase(db)
|
456
|
+
# table
|
457
|
+
tb = openTable(db)
|
458
|
+
tb.fetchMode = Transactd::FETCH_OBJ
|
459
|
+
rec = seekId1(tb)
|
460
|
+
doTestObject(rec, false)
|
461
|
+
for i in 2..CHECK_MAX_ID
|
462
|
+
tb.seekNext()
|
463
|
+
expect(tb.stat()).to eq 0
|
464
|
+
rec = tb.fields()
|
465
|
+
doTestObject(rec, false, i)
|
466
|
+
end
|
467
|
+
tb.close()
|
468
|
+
# activeTable
|
469
|
+
at = openActiveTable(db)
|
470
|
+
rs = getRecordSet(at)
|
471
|
+
rs.fetchMode = Transactd::FETCH_OBJ
|
472
|
+
for i in 0...CHECK_MAX_ID
|
473
|
+
rec = rs[i]
|
474
|
+
doTestObject(rec, true, i + 1)
|
475
|
+
end
|
476
|
+
at.release()
|
477
|
+
db.close()
|
478
|
+
end
|
479
|
+
|
480
|
+
it 'fetch with FETCH_USR_CLASS' do
|
481
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
482
|
+
db = Transactd::Database.new()
|
483
|
+
openDatabase(db)
|
484
|
+
# receiver classes
|
485
|
+
User_NA_NUO = Class.new(UserBase).setAlias(false).set_nodefine_original(false)
|
486
|
+
User_NA__UO = Class.new(UserBase).setAlias(false).set_nodefine_original(true)
|
487
|
+
User__A_NUO = Class.new(UserBase).setAlias(true).set_nodefine_original(false)
|
488
|
+
User__A__UO = Class.new(UserBase).setAlias(true).set_nodefine_original(true)
|
489
|
+
# receiver classes are not initialized by Transactd yet
|
490
|
+
expect(User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
491
|
+
expect(User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
492
|
+
expect(User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
493
|
+
expect(User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
494
|
+
# open activeTable and not aliased recordset
|
495
|
+
at = openActiveTable(db)
|
496
|
+
rs = getRecordSet(at)
|
497
|
+
rs.fetchMode = Transactd::FETCH_USR_CLASS
|
498
|
+
at.release()
|
499
|
+
# (1) User_NA_NUO : not aliased, not nodefine_original
|
500
|
+
doTestTable(db, User_NA_NUO)
|
501
|
+
doTestRecordset(rs, User_NA_NUO)
|
502
|
+
expect(User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
503
|
+
expect(User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
504
|
+
expect(User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
505
|
+
expect(User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
506
|
+
# (2) User_NA__UO : not aliased, nodefine_original
|
507
|
+
doTestTable(db, User_NA__UO)
|
508
|
+
doTestRecordset(rs, User_NA__UO)
|
509
|
+
expect(User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
510
|
+
expect(User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
511
|
+
expect(User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
512
|
+
expect(User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
513
|
+
# open activeTable and aliased recordset
|
514
|
+
at = openActiveTable(db, User__A_NUO.alias_map)
|
515
|
+
rs = getRecordSet(at)
|
516
|
+
rs.fetchMode = Transactd::FETCH_USR_CLASS
|
517
|
+
at.release()
|
518
|
+
|
519
|
+
# (3) User__A_NUO : aliased, not nodefine_original
|
520
|
+
doTestTable(db, User__A_NUO)
|
521
|
+
doTestRecordset(rs, User__A_NUO)
|
522
|
+
expect(User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
523
|
+
expect(User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
524
|
+
expect(User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
525
|
+
expect(User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
526
|
+
# (4) User__A__UO : aliased, nodefine_original
|
527
|
+
doTestTable(db, User__A__UO)
|
528
|
+
doTestRecordset(rs, User__A__UO)
|
529
|
+
expect(User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
530
|
+
expect(User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
531
|
+
expect(User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
532
|
+
expect(User__A__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
533
|
+
# close all
|
534
|
+
db.close()
|
535
|
+
end
|
536
|
+
|
537
|
+
it 'fetch with FETCH_RECORD_INTO' do
|
538
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
539
|
+
db = Transactd::Database.new()
|
540
|
+
openDatabase(db)
|
541
|
+
# table
|
542
|
+
tb = openTable(db)
|
543
|
+
tb.fetchMode = Transactd::FETCH_RECORD_INTO
|
544
|
+
rec = seekId1(tb)
|
545
|
+
doTestFieldsBase(rec, false)
|
546
|
+
for i in 2..CHECK_MAX_ID
|
547
|
+
tb.seekNext()
|
548
|
+
expect(tb.stat()).to eq 0
|
549
|
+
rec = tb.fields()
|
550
|
+
doTestFieldsBase(rec, false, i)
|
551
|
+
end
|
552
|
+
tb.close()
|
553
|
+
# activeTable
|
554
|
+
at = openActiveTable(db)
|
555
|
+
rs = getRecordSet(at)
|
556
|
+
rs.fetchMode = Transactd::FETCH_RECORD_INTO
|
557
|
+
for i in 0...CHECK_MAX_ID
|
558
|
+
rec = rs[i]
|
559
|
+
doTestFieldsBase(rec, true, i + 1)
|
560
|
+
end
|
561
|
+
at.release()
|
562
|
+
# recordset::getRecord()
|
563
|
+
at = openActiveTable(db)
|
564
|
+
rs = getRecordSet(at)
|
565
|
+
for i in 0...CHECK_MAX_ID
|
566
|
+
rs.fetchMode = FETCHMODES[i % FETCHMODES.length]
|
567
|
+
rec = rs.getRecord(i)
|
568
|
+
doTestFieldsBase(rec, true, i + 1)
|
569
|
+
end
|
570
|
+
at.release()
|
571
|
+
db.close()
|
572
|
+
end
|
573
|
+
|
574
|
+
it 'fetch ALL with FETCH_VAL_NUM' do
|
575
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
576
|
+
db = Transactd::Database.new()
|
577
|
+
openDatabase(db)
|
578
|
+
# table
|
579
|
+
tb = openTable(db)
|
580
|
+
tb.fetchMode = Transactd::FETCH_VAL_NUM
|
581
|
+
arr = findAll(tb)
|
582
|
+
expect(arr.is_a?(Array)).to eq true
|
583
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
584
|
+
for i in 0...arr.length
|
585
|
+
rec = arr[i]
|
586
|
+
doTestArray(rec, i + 1)
|
587
|
+
end
|
588
|
+
tb.close()
|
589
|
+
# activeTable
|
590
|
+
at = openActiveTable(db)
|
591
|
+
rs = getRecordSetForFindAll(at)
|
592
|
+
rs.fetchMode = Transactd::FETCH_VAL_NUM
|
593
|
+
arr = rs.to_a
|
594
|
+
expect(arr.is_a?(Array)).to eq true
|
595
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
596
|
+
for i in 0...arr.length
|
597
|
+
rec = arr[i]
|
598
|
+
doTestArray(rec, i + 1)
|
599
|
+
end
|
600
|
+
at.release()
|
601
|
+
db.close()
|
602
|
+
end
|
603
|
+
|
604
|
+
it 'fetch ALL with FETCH_VAL_ASSOC' do
|
605
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
606
|
+
db = Transactd::Database.new()
|
607
|
+
openDatabase(db)
|
608
|
+
# table
|
609
|
+
tb = openTable(db)
|
610
|
+
tb.fetchMode = Transactd::FETCH_VAL_ASSOC
|
611
|
+
arr = findAll(tb)
|
612
|
+
expect(arr.is_a?(Array)).to eq true
|
613
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
614
|
+
for i in 0...arr.length
|
615
|
+
rec = arr[i]
|
616
|
+
doTestHash(rec, false, false, i + 1)
|
617
|
+
end
|
618
|
+
tb.close()
|
619
|
+
# activeTable
|
620
|
+
at = openActiveTable(db)
|
621
|
+
rs = getRecordSetForFindAll(at)
|
622
|
+
rs.fetchMode = Transactd::FETCH_VAL_ASSOC
|
623
|
+
arr = rs.to_a
|
624
|
+
expect(arr.is_a?(Array)).to eq true
|
625
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
626
|
+
for i in 0...arr.length
|
627
|
+
rec = arr[i]
|
628
|
+
doTestHash(rec, true, false, i + 1)
|
629
|
+
end
|
630
|
+
at.release()
|
631
|
+
db.close()
|
632
|
+
end
|
633
|
+
|
634
|
+
it 'fetch ALL with FETCH_VAL_BOTH' do
|
635
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
636
|
+
db = Transactd::Database.new()
|
637
|
+
openDatabase(db)
|
638
|
+
# table
|
639
|
+
tb = openTable(db)
|
640
|
+
tb.fetchMode = Transactd::FETCH_VAL_BOTH
|
641
|
+
arr = findAll(tb)
|
642
|
+
expect(arr.is_a?(Array)).to eq true
|
643
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
644
|
+
for i in 0...arr.length
|
645
|
+
rec = arr[i]
|
646
|
+
doTestHash(rec, false, true, i + 1)
|
647
|
+
end
|
648
|
+
tb.close()
|
649
|
+
# activeTable
|
650
|
+
at = openActiveTable(db)
|
651
|
+
rs = getRecordSetForFindAll(at)
|
652
|
+
rs.fetchMode = Transactd::FETCH_VAL_BOTH
|
653
|
+
arr = rs.to_a
|
654
|
+
expect(arr.is_a?(Array)).to eq true
|
655
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
656
|
+
for i in 0...arr.length
|
657
|
+
rec = arr[i]
|
658
|
+
doTestHash(rec, true, true, i + 1)
|
659
|
+
end
|
660
|
+
at.release()
|
661
|
+
db.close()
|
662
|
+
end
|
663
|
+
|
664
|
+
it 'fetch ALL with FETCH_OBJ' do
|
665
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
666
|
+
db = Transactd::Database.new()
|
667
|
+
openDatabase(db)
|
668
|
+
# table
|
669
|
+
tb = openTable(db)
|
670
|
+
tb.fetchMode = Transactd::FETCH_OBJ
|
671
|
+
arr = findAll(tb)
|
672
|
+
expect(arr.is_a?(Array)).to eq true
|
673
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
674
|
+
for i in 0...arr.length
|
675
|
+
rec = arr[i]
|
676
|
+
doTestObject(rec, false, i + 1)
|
677
|
+
end
|
678
|
+
tb.close()
|
679
|
+
# activeTable
|
680
|
+
at = openActiveTable(db)
|
681
|
+
rs = getRecordSetForFindAll(at)
|
682
|
+
rs.fetchMode = Transactd::FETCH_OBJ
|
683
|
+
arr = rs.to_a
|
684
|
+
expect(arr.is_a?(Array)).to eq true
|
685
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
686
|
+
for i in 0...arr.length
|
687
|
+
rec = arr[i]
|
688
|
+
doTestObject(rec, true, i + 1)
|
689
|
+
end
|
690
|
+
at.release()
|
691
|
+
db.close()
|
692
|
+
end
|
693
|
+
|
694
|
+
it 'fetch ALL with FETCH_USR_CLASS' do
|
695
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
696
|
+
db = Transactd::Database.new()
|
697
|
+
openDatabase(db)
|
698
|
+
# receiver classes
|
699
|
+
AR_User_NA_NUO = Class.new(UserBase).setAlias(false).set_nodefine_original(false)
|
700
|
+
AR_User_NA__UO = Class.new(UserBase).setAlias(false).set_nodefine_original(true)
|
701
|
+
AR_User__A_NUO = Class.new(UserBase).setAlias(true).set_nodefine_original(false)
|
702
|
+
AR_User__A__UO = Class.new(UserBase).setAlias(true).set_nodefine_original(true)
|
703
|
+
# receiver classes are not initialized by Transactd yet
|
704
|
+
expect(AR_User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
705
|
+
expect(AR_User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
706
|
+
expect(AR_User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
707
|
+
expect(AR_User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
708
|
+
# open table
|
709
|
+
tb = openTable(db)
|
710
|
+
tb.fetchMode = Transactd::FETCH_USR_CLASS
|
711
|
+
# open activeTable and not aliased recordset
|
712
|
+
at = openActiveTable(db)
|
713
|
+
rs = getRecordSetForFindAll(at)
|
714
|
+
rs.fetchMode = Transactd::FETCH_USR_CLASS
|
715
|
+
at.release()
|
716
|
+
# (1) AR_User_NA_NUO : not aliased, not nodefine_original
|
717
|
+
doTestTable(db, AR_User_NA_NUO)
|
718
|
+
doTestRecordset(rs, AR_User_NA_NUO)
|
719
|
+
expect(AR_User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
720
|
+
expect(AR_User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
721
|
+
expect(AR_User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
722
|
+
expect(AR_User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
723
|
+
# (2) AR_User_NA__UO : not aliased, nodefine_original
|
724
|
+
doTestTable(db, AR_User_NA__UO)
|
725
|
+
doTestRecordset(rs, AR_User_NA__UO)
|
726
|
+
expect(AR_User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
727
|
+
expect(AR_User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
728
|
+
expect(AR_User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
729
|
+
expect(AR_User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
730
|
+
# open activeTable and aliased recordset
|
731
|
+
at = openActiveTable(db, AR_User__A_NUO.alias_map)
|
732
|
+
rs = getRecordSetForFindAll(at)
|
733
|
+
rs.fetchMode = Transactd::FETCH_USR_CLASS
|
734
|
+
at.release()
|
735
|
+
# (3) AR_User__A_NUO : aliased, not nodefine_original
|
736
|
+
doTestTable(db, AR_User__A_NUO)
|
737
|
+
doTestRecordset(rs, AR_User__A_NUO)
|
738
|
+
expect(AR_User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
739
|
+
expect(AR_User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
740
|
+
expect(AR_User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
741
|
+
expect(AR_User__A__UO.instance_variable_get(:@_accessor_initialized)).to be_nil
|
742
|
+
# (4) AR_User__A__UO : aliased, nodefine_original
|
743
|
+
doTestTable(db, AR_User__A__UO)
|
744
|
+
doTestRecordset(rs, AR_User__A__UO)
|
745
|
+
expect(AR_User_NA_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
746
|
+
expect(AR_User_NA__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
747
|
+
expect(AR_User__A_NUO.instance_variable_get(:@_accessor_initialized)).to be true
|
748
|
+
expect(AR_User__A__UO.instance_variable_get(:@_accessor_initialized)).to be true
|
749
|
+
# close all
|
750
|
+
tb.close()
|
751
|
+
db.close()
|
752
|
+
end
|
753
|
+
|
754
|
+
it 'fetch ALL with FETCH_RECORD_INTO (same as FETCH_VAL_BOTH)' do
|
755
|
+
Transactd::setFieldValueMode(Transactd::FIELD_VALUE_MODE_VALUE)
|
756
|
+
db = Transactd::Database.new()
|
757
|
+
openDatabase(db)
|
758
|
+
# table
|
759
|
+
tb = openTable(db)
|
760
|
+
tb.fetchMode = Transactd::FETCH_RECORD_INTO
|
761
|
+
arr = findAll(tb)
|
762
|
+
expect(arr.is_a?(Array)).to eq true
|
763
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
764
|
+
for i in 0...arr.length
|
765
|
+
rec = arr[i]
|
766
|
+
# same as FETCH_VAL_BOTH, not doTestFieldsBase(rec, false, i + 1)
|
767
|
+
doTestHash(rec, false, true, i + 1)
|
768
|
+
end
|
769
|
+
tb.close()
|
770
|
+
# activeTable
|
771
|
+
at = openActiveTable(db)
|
772
|
+
rs = getRecordSetForFindAll(at)
|
773
|
+
rs.fetchMode = Transactd::FETCH_RECORD_INTO
|
774
|
+
arr = rs.to_a
|
775
|
+
expect(arr.is_a?(Array)).to eq true
|
776
|
+
expect(arr.length).to eq CHECK_MAX_ID
|
777
|
+
for i in 0...arr.length
|
778
|
+
rec = arr[i]
|
779
|
+
# same as FETCH_VAL_BOTH, not doTestFieldsBase(rec, true, i + 1)
|
780
|
+
doTestHash(rec, true, true, i + 1)
|
781
|
+
end
|
782
|
+
at.release()
|
783
|
+
db.close()
|
784
|
+
end
|
785
|
+
end
|