0022898: IGES import fails in german environment
[occt.git] / tests / bugs / caf / bug1054_1
CommitLineData
61c421bf 1puts "================"
2puts "OCC1054"
3puts "================"
4puts ""
5#######################################################################################
6# Mechanism of transactions' synchronization and mechanizm of nested transactions
7#######################################################################################
8# Case 1 (nested mode ON)
9#######################################################################################
10
11proc OCC1054_Check_dump {IsGood index good_index case} {
12 # Check dump
13 if { ${index} != ${good_index} } {
14 set IsGood 0
15 puts "OCC1054 Error (case ${case} : index = ${index} good_index = ${good_index})"
16 }
17 return ${IsGood}
18}
19
20proc OCC1054_Check_real_attribute {IsGood doc label good_real case} {
21 global ${doc}
22 # Check real attribute
23 set percent_max 0.1
24 if [catch { set real [GetReal ${doc} ${label}] } message] {
25 set IsGood 0
26 puts "OCC1054 Error (case ${case})"
27 } else {
28 set real_percent [expr abs(${real} - ${good_real}) / double(${good_real}) * 100.]
29 if {${real_percent} > ${percent_max}} {
30 puts "good_real = ${good_real}"
31 puts "real = ${real}"
32 puts "real_percent = ${real_percent}"
33 puts "OCC1054 Error (case ${case}-2)"
34 }
35 }
36 return ${IsGood}
37}
38
39
40set IsGood 1
41set Case 0
42
43NewDocument doc1
44NewDocument doc2
45NewDocument doc3
46mtmCreate 4
47
48mtmNestedMode 1
49
50mtmAdd doc1
51
52mtmOpen
53 SetReal doc1 0:1:1 1.1
54 OpenCommand doc1
55 SetReal doc1 0:1:1 11
56 AbortCommand doc1
57
58 OpenCommand doc1
59 SetReal doc1 0:1:3 12.1
60
61 OpenCommand doc1
62 SetReal doc1 0:1:3 121
63 AbortCommand doc1
64
65 SetReal doc1 0:1:4 12.2
66 CommitCommand doc1
67
68 SetReal doc1 0:1:1 1.2
69 SetReal doc1 0:1:4 1.3
70mtmCommit Transaction1
71
72set list [mtmDump]
73################################################################################
74# *** Dump of MTM ***
75# There is one document ( "2690640" ) in the manager
76# Nested transaction mode is on
77#
78# Undo: Transaction1 - 1 documents ( "2690640" ) < Last action
79#
80# *** End ***
81################################################################################
82set index1 [lsearch -exact ${list} "Transaction1"]
83set docnum1 [lindex ${list} [expr ${index1} + 2]]
84set index2 [lsearch -exact ${list} "Last"]
85
86# Check dump
87set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 21 [incr Case]]
88set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
89set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 29 [incr Case]]
90
91# Check real attributes
92set IsGood [OCC1054_Check_real_attribute ${IsGood} ${doc1} 0:1:1 1.2 [incr Case]]
93set IsGood [OCC1054_Check_real_attribute ${IsGood} ${doc1} 0:1:3 12.1 [incr Case]]
94set IsGood [OCC1054_Check_real_attribute ${IsGood} ${doc1} 0:1:4 1.3 [incr Case]]
95
96mtmAdd doc2
97mtmAdd doc3
98
99mtmOpen
100 SetReal doc2 0:2:1 2.1
101 SetReal doc1 0:2:2 2.1
102 OpenCommand doc1
103 OpenCommand doc2
104 SetReal doc2 0:2:1 21
105 SetReal doc1 0:2:2 21
106 AbortCommand doc2
107
108 OpenCommand doc3
109 OpenCommand doc2
110 SetReal doc3 0:2:3 22.1
111 SetReal doc2 0:2:3 22.1
112
113 OpenCommand doc2
114 SetReal doc2 0:2:3 221
115 AbortCommand doc2
116
117 SetReal doc3 0:2:4 22.2
118 CommitCommand doc2
119 CommitCommand doc3
120 AbortCommand doc1
121
122 SetReal doc1 0:2:1 2.2
123 SetReal doc1 0:2:4 2.3
124mtmCommit Transaction2
125
126set list [mtmDump]
127################################################################################
128# *** Dump of MTM ***
129# There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager
130# Nested transaction mode is on
131#
132# Undo: Transaction1 - 1 documents ( "2809192" )
133# Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) < Last action
134#
135# *** End ***
136################################################################################
137
138set index1 [lsearch -exact ${list} "Transaction1"]
139set docnum1 [lindex ${list} [expr ${index1} + 2]]
140set index2 [lsearch -exact ${list} "Transaction2"]
141set docnum2 [lindex ${list} [expr ${index2} + 2]]
142set index3 [lsearch -exact ${list} "Last"]
143
144# Check dump
145set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
146set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
147set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
148set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
149set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]]
150
151# Check real attributes
152# doc1
153set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 1.2 [incr Case]]
154set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 12.1 [incr Case]]
155set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 1.3 [incr Case]]
156set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
157set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
158set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
159# doc2
160set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
161set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
162# doc3
163set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
164set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
165
166mtmOpen
167 SetReal doc1 0:1:1 3.1
168 OpenCommand doc1
169 SetReal doc1 0:1:1 31
170 AbortCommand doc1
171
172 OpenCommand doc1
173 SetReal doc1 0:1:3 32.1
174
175 OpenCommand doc1
176 SetReal doc1 0:1:3 321
177 AbortCommand doc1
178
179 SetReal doc1 0:1:4 32.2
180 CommitCommand doc1
181
182 SetReal doc1 0:1:1 3.2
183 SetReal doc1 0:1:4 3.3
184mtmCommit Transaction3
185
186set list [mtmDump]
187################################################################################
188# *** Dump of MTM ***
189# There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager
190# Nested transaction mode is on
191#
192# Undo: Transaction1 - 1 documents ( "2809192" )
193# Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" )
194# Undo: Transaction3 - 1 documents ( "2809192" ) < Last action
195#
196# *** End ***
197################################################################################
198
199set index1 [lsearch -exact ${list} "Transaction1"]
200set docnum1 [lindex ${list} [expr ${index1} + 2]]
201set index2 [lsearch -exact ${list} "Transaction2"]
202set docnum2 [lindex ${list} [expr ${index2} + 2]]
203set index3 [lsearch -exact ${list} "Transaction3"]
204set docnum3 [lindex ${list} [expr ${index3} + 2]]
205set index4 [lsearch -exact ${list} "Last"]
206
207# Check dump
208set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
209set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
210set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
211set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
212set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]]
213set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
214set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]]
215
216# Check real attributes
217# doc1
218set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 3.2 [incr Case]]
219set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 32.1 [incr Case]]
220set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]]
221set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
222set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
223set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
224# doc2
225set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
226set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
227# doc3
228set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
229set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
230
231mtmUndo
232
233set list [mtmDump]
234################################################################################
235# *** Dump of MTM ***
236# There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager
237# Nested transaction mode is on
238#
239# Undo: Transaction1 - 1 documents ( "2809192" )
240# Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) < Last action
241# Redo: Transaction3 - 1 documents ( "2809192" )
242#
243# *** End ***
244################################################################################
245
246set index1 [lsearch -exact ${list} "Transaction1"]
247set docnum1 [lindex ${list} [expr ${index1} + 2]]
248set index2 [lsearch -exact ${list} "Transaction2"]
249set docnum2 [lindex ${list} [expr ${index2} + 2]]
250set index3 [lsearch -exact ${list} "Transaction3"]
251set docnum3 [lindex ${list} [expr ${index3} + 2]]
252set redo3 [lindex ${list} [expr ${index3} - 1]]
253set index4 [lsearch -exact ${list} "Last"]
254
255# Check dump
256set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
257set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
258set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
259set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
260set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 44 [incr Case]]
261set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
262set IsGood [OCC1054_Check_dump ${IsGood} ${redo3} "Redo:" [incr Case]]
263set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 41 [incr Case]]
264
265# Check real attributes
266# doc1
267set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 1.2 [incr Case]]
268set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 12.1 [incr Case]]
269set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 1.3 [incr Case]]
270set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
271set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
272set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
273# doc2
274set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
275set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
276# doc3
277set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
278set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
279
280mtmOpen
281 SetReal doc1 0:1:1 4.1
282 OpenCommand doc1
283 SetReal doc1 0:1:1 41
284 AbortCommand doc1
285
286 OpenCommand doc1
287 SetReal doc1 0:1:3 42.1
288
289 OpenCommand doc1
290 SetReal doc1 0:1:3 421
291mtmAbort
292
293set list [mtmDump]
294################################################################################
295# *** Dump of MTM ***
296# There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager
297# Nested transaction mode is on
298#
299# Undo: Transaction1 - 1 documents ( "2809192" )
300# Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" ) < Last action
301# Redo: Transaction3 - 1 documents ( "2809192" )
302#
303# *** End ***
304################################################################################
305
306set index1 [lsearch -exact ${list} "Transaction1"]
307set docnum1 [lindex ${list} [expr ${index1} + 2]]
308set index2 [lsearch -exact ${list} "Transaction2"]
309set docnum2 [lindex ${list} [expr ${index2} + 2]]
310set index3 [lsearch -exact ${list} "Transaction3"]
311set docnum3 [lindex ${list} [expr ${index3} + 2]]
312set redo3 [lindex ${list} [expr ${index3} - 1]]
313set index4 [lsearch -exact ${list} "Last"]
314
315# Check dump
316set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
317set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
318set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
319set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
320set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 44 [incr Case]]
321set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
322set IsGood [OCC1054_Check_dump ${IsGood} ${redo3} "Redo:" [incr Case]]
323set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 41 [incr Case]]
324
325# Check real attributes
326# doc1
327set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 1.2 [incr Case]]
328set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 12.1 [incr Case]]
329set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 1.3 [incr Case]]
330set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
331set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
332set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
333# doc2
334set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
335set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
336# doc3
337set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
338set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
339
340mtmRedo
341
342set list [mtmDump]
343################################################################################
344# *** Dump of MTM ***
345# There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager
346# Nested transaction mode is on
347#
348# Undo: Transaction1 - 1 documents ( "2809192" )
349# Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" )
350# Undo: Transaction3 - 1 documents ( "2809192" ) < Last action
351#
352# *** End ***
353################################################################################
354
355set index1 [lsearch -exact ${list} "Transaction1"]
356set docnum1 [lindex ${list} [expr ${index1} + 2]]
357set index2 [lsearch -exact ${list} "Transaction2"]
358set docnum2 [lindex ${list} [expr ${index2} + 2]]
359set index3 [lsearch -exact ${list} "Transaction3"]
360set docnum3 [lindex ${list} [expr ${index3} + 2]]
361set undo3 [lindex ${list} [expr ${index3} - 1]]
362set index4 [lsearch -exact ${list} "Last"]
363
364# Check dump
365set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
366set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
367set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
368set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
369set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]]
370set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
371set IsGood [OCC1054_Check_dump ${IsGood} ${undo3} "Undo:" [incr Case]]
372set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]]
373
374# Check real attributes
375# doc1
376set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 3.2 [incr Case]]
377set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 32.1 [incr Case]]
378set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]]
379set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
380set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
381set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
382# doc2
383set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
384set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
385# doc3
386set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
387set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
388
389mtmOpen
390 SetReal doc1 0:1:1 5.1
391 OpenCommand doc1
392 SetReal doc1 0:1:1 51
393
394 OpenCommand doc1
395 SetReal doc1 0:1:3 52.1
396
397 OpenCommand doc1
398 SetReal doc1 0:1:3 521
399mtmCommit Transaction5
400
401set list [mtmDump]
402################################################################################
403# *** Dump of MTM ***
404# There are 3 documents ( "2809192" "2705536" "2697976" ) in the manager
405# Nested transaction mode is on
406#
407# Undo: Transaction1 - 1 documents ( "2809192" )
408# Undo: Transaction2 - 3 documents ( "2697976" "2705536" "2809192" )
409# Undo: Transaction3 - 1 documents ( "2809192" )
410# Undo: Transaction5 - 1 documents ( "2809192" ) < Last action
411#
412# *** End ***
413################################################################################
414
415set index1 [lsearch -exact ${list} "Transaction1"]
416set docnum1 [lindex ${list} [expr ${index1} + 2]]
417set index2 [lsearch -exact ${list} "Transaction2"]
418set docnum2 [lindex ${list} [expr ${index2} + 2]]
419set index3 [lsearch -exact ${list} "Transaction3"]
420set docnum3 [lindex ${list} [expr ${index3} + 2]]
421set index4 [lsearch -exact ${list} "Transaction5"]
422set docnum4 [lindex ${list} [expr ${index4} + 2]]
423set index5 [lsearch -exact ${list} "Last"]
424
425# Check dump
426set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
427set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
428set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
429set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
430set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]]
431set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
432set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]]
433set IsGood [OCC1054_Check_dump ${IsGood} ${docnum4} 1 [incr Case]]
434set IsGood [OCC1054_Check_dump ${IsGood} ${index5} 57 [incr Case]]
435
436# Check real attributes
437# doc1
438set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 51 [incr Case]]
439set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 521 [incr Case]]
440set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]]
441set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
442set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
443set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
444# doc2
445set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
446set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
447# doc3
448set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
449set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
450
451mtmUndo
452
453set list [mtmDump]
454################################################################################
455# *** Dump of MTM ***
456# There are 3 documents ( "2809192" "2705536" "3095112" ) in the manager
457# Nested transaction mode is on
458#
459# Undo: Transaction1 - 1 documents ( "2809192" )
460# Undo: Transaction2 - 3 documents ( "3095112" "2705536" "2809192" )
461# Undo: Transaction3 - 1 documents ( "2809192" ) < Last action
462# Redo: Transaction5 - 1 documents ( "2809192" )
463#
464# *** End ***
465################################################################################
466
467set index1 [lsearch -exact ${list} "Transaction1"]
468set docnum1 [lindex ${list} [expr ${index1} + 2]]
469set index2 [lsearch -exact ${list} "Transaction2"]
470set docnum2 [lindex ${list} [expr ${index2} + 2]]
471set index3 [lsearch -exact ${list} "Transaction3"]
472set docnum3 [lindex ${list} [expr ${index3} + 2]]
473set index4 [lsearch -exact ${list} "Transaction5"]
474set docnum4 [lindex ${list} [expr ${index4} + 2]]
475set redo4 [lindex ${list} [expr ${index4} - 1]]
476set index5 [lsearch -exact ${list} "Last"]
477
478# Check dump
479set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
480set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
481set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
482set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
483set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]]
484set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
485set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 52 [incr Case]]
486set IsGood [OCC1054_Check_dump ${IsGood} ${docnum4} 1 [incr Case]]
487set IsGood [OCC1054_Check_dump ${IsGood} ${redo4} "Redo:" [incr Case]]
488set IsGood [OCC1054_Check_dump ${IsGood} ${index5} 49 [incr Case]]
489
490# Check real attributes
491# doc1
492set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 3.2 [incr Case]]
493set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 32.1 [incr Case]]
494set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]]
495set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
496set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
497set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
498# doc2
499set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
500set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
501# doc3
502set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
503set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
504
505mtmOpen
506 SetReal doc1 0:1:1 6.1
507 OpenCommand doc1
508 SetReal doc1 0:1:1 61
509
510 OpenCommand doc1
511 SetReal doc1 0:1:3 62.1
512
513mtmCommit Transaction6
514
515set list [mtmDump]
516################################################################################
517# *** Dump of MTM ***
518# There are 3 documents ( "2809192" "2705536" "3095112" ) in the manager
519# Nested transaction mode is on
520#
521# Undo: Transaction1 - 1 documents ( "2809192" )
522# Undo: Transaction2 - 3 documents ( "3095112" "2705536" "2809192" )
523# Undo: Transaction3 - 1 documents ( "2809192" )
524# Undo: Transaction6 - 1 documents ( "2809192" ) < Last action
525#
526# *** End ***
527################################################################################
528
529set index1 [lsearch -exact ${list} "Transaction1"]
530set docnum1 [lindex ${list} [expr ${index1} + 2]]
531set index2 [lsearch -exact ${list} "Transaction2"]
532set docnum2 [lindex ${list} [expr ${index2} + 2]]
533set index3 [lsearch -exact ${list} "Transaction3"]
534set docnum3 [lindex ${list} [expr ${index3} + 2]]
535set index4 [lsearch -exact ${list} "Transaction6"]
536set docnum4 [lindex ${list} [expr ${index4} + 2]]
537set index5 [lsearch -exact ${list} "Last"]
538
539# Check dump
540set IsGood [OCC1054_Check_dump ${IsGood} ${index1} 23 [incr Case]]
541set IsGood [OCC1054_Check_dump ${IsGood} ${docnum1} 1 [incr Case]]
542set IsGood [OCC1054_Check_dump ${IsGood} ${index2} 31 [incr Case]]
543set IsGood [OCC1054_Check_dump ${IsGood} ${docnum2} 3 [incr Case]]
544set IsGood [OCC1054_Check_dump ${IsGood} ${index3} 41 [incr Case]]
545set IsGood [OCC1054_Check_dump ${IsGood} ${docnum3} 1 [incr Case]]
546set IsGood [OCC1054_Check_dump ${IsGood} ${index4} 49 [incr Case]]
547set IsGood [OCC1054_Check_dump ${IsGood} ${docnum4} 1 [incr Case]]
548set IsGood [OCC1054_Check_dump ${IsGood} ${index5} 57 [incr Case]]
549
550# Check real attributes
551# doc1
552set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:1 61 [incr Case]]
553set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:3 62.1 [incr Case]]
554set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:1:4 3.3 [incr Case]]
555set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:1 2.2 [incr Case]]
556set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:2 2.1 [incr Case]]
557set IsGood [OCC1054_Check_real_attribute ${IsGood} doc1 0:2:4 2.3 [incr Case]]
558# doc2
559set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:1 2.1 [incr Case]]
560set IsGood [OCC1054_Check_real_attribute ${IsGood} doc2 0:2:3 22.1 [incr Case]]
561# doc3
562set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:3 22.1 [incr Case]]
563set IsGood [OCC1054_Check_real_attribute ${IsGood} doc3 0:2:4 22.2 [incr Case]]
564
565if { ${IsGood} == 1 } {
566 puts "OCC1054 OK"
567} else {
568 puts "OCC1054 Error"
569}