0029142: Exception on Redo.
[occt.git] / tests / bugs / caf / bug29142
1 puts "================"
2 puts "bug0029142"
3 puts "================"
4 puts ""
5
6 ######################################################
7 # Checks bug of Undo mechanism
8 ######################################################
9 NewDocument D BinOcaf
10 UndoLimit D 100
11 set Lab1 [Label D 0:1:1]
12
13 #1. Set Integer attribute
14 NewCommand D
15 SetInteger  D $Lab1 111
16
17 #2. Set Real attribute
18 NewCommand D
19 SetReal D $Lab1 0.234
20
21 #3. Forget Integer attribute
22 NewCommand D
23 ForgetAtt D $Lab1 2a96b606-ec8b-11d0-bee7-080009dc3333
24
25 #4. Set new Integer attribute
26 SetInteger D $Lab1 222
27 #5. Undo
28 NewCommand D
29 set IsGoodUndo 1
30 if [catch {Undo D}] {
31    puts "Error during Document Undo"
32    set IsGoodUndo 0
33 }
34
35 #6. Redo
36 set IsGoodRedo 1
37 if [catch {Redo D}] {
38    puts "Error during Document Redo"
39    set IsGoodRedo 0
40 }
41
42
43 #7. Check result
44 if {$IsGoodUndo == 1 & $IsGoodRedo == 1} {
45     puts "bug0029142: OK"
46 } else {
47     puts "bug0029142: ERROR"
48 }
49
50 #8. Close document
51 Close D