1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
occt/tests/bugs/caf/bug24164_1
szy 1c9cffdb4b 0024164: Optimization of OCAF document closing
OCAF document closing redesign.
added 2 test scripts.
removed commented method.
added missed Draw commands.
2013-10-10 13:29:18 +04:00

52 lines
921 B
Plaintext

pload DCAF
if { [info exists imagedir] == 0 } {
set imagedir .
}
set BugNumber OCC24164
#1 open new document
NewDocument D MDTV-Standard
UndoLimit D 10 0 0
InitLogBook D
AddDriver D Box
#2 build box
NewCommand D
set B2 [AddObject D]
set F2 [AddFunction D $B2 Box]
BoxDX D $B2 190
BoxDY D $B2 290
BoxDZ D $B2 390
ComputeFun D $F2
GetShape D $F2:2 Box2
NewCommand D
#3 save shape in the document
SaveAs D ${imagedir}/testDoc1.std
#4 close document
set catch_status 0
if { [catch {Close D} catch_result] } {
set catch_status 1
}
if { ${catch_status} != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}
#5 reopen just saved document with the same name
Open ${imagedir}/testDoc1.std D
set catch_status 0
#6 close the document
if { [catch {Close D} catch_result] } {
set catch_status 1
}
if { ${catch_status} != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}