0031918: Application Framework - New binary format for fast reading part of OCAF...
[occt.git] / tests / bugs / caf / bug1395_2
1 puts "TODO OCC12345 ALL: OCC1395 Error : There is not the integer attribute on the label 0:2"
2 puts "TODO OCC12345 ALL: OCC1395 Error"
3
4 puts "================"
5 puts "OCC1395"
6 puts "================"
7 puts ""
8 #######################################################################################
9 # Wrong behaviour of Undo Redo and SetUndoLimit methods in TDocStd_Document
10 #######################################################################################
11 # Case 3 (SetUndoLimit)
12 #######################################################################################
13
14 # Create a new document and set UndoLimit
15 NewDocument D BinOcaf
16 UndoLimit D 100
17
18 # Create a label
19 set aLabel 0:2
20 Label D ${aLabel}
21
22 # Open a transaction
23 OpenTran D
24
25 # Set integer attribute
26 set anInteger 5
27 SetInteger D ${aLabel} ${anInteger}
28
29 # Commit transaction
30 CommitTran D 1
31
32 # Set UndoLimit
33 UndoLimit D 10
34
35 # Set real attribute
36 set aReal 8.8
37 SetReal D ${aLabel} ${aReal}
38
39 # Undo
40 DFUndo D 1
41
42 # Check integer and real attributes
43 set IsGood 1
44 if [catch { set Integer [GetInteger D ${aLabel}] } message] {
45   set IsGood 0
46   puts "OCC1395 Error : There is not the integer attribute on the label ${aLabel}"
47 } else {
48   puts "OCC1395 OK : There is the integer attribute on the label ${aLabel}"
49 }
50 if [catch { set Real [GetReal D ${aLabel}] } message] {
51   set IsGood 0
52   puts "OCC1395 Error : There is not the real attribute on the label ${aLabel}"
53 } else {
54   puts "OCC1395 OK : There is the real attribute on the label ${aLabel}"
55 }
56
57 if { ${IsGood} == 1 } {
58   puts "OCC1395 OK"
59 } else {
60   puts "OCC1395 Error"
61 }