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