1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024164: Optimization of OCAF document closing

OCAF document closing redesign.
added 2 test scripts.
removed commented method.
added missed Draw commands.
This commit is contained in:
szy
2013-10-10 13:28:30 +04:00
committed by bugmaster
parent 830d849f94
commit 1c9cffdb4b
6 changed files with 209 additions and 19 deletions

52
tests/bugs/caf/bug24164_1 Normal file
View File

@@ -0,0 +1,52 @@
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}"
}

69
tests/bugs/caf/bug24164_2 Normal file
View File

@@ -0,0 +1,69 @@
pload DCAF
set BugNumber OCC24164
if { [info exists imagedir] == 0 } {
set imagedir .
}
#1 open new document
NewDocument D MDTV-Standard
UndoLimit D 10 0 0
#2 define set of labels
NewCommand D
set Lab1 [Label D 0:1:1]
set Lab2 [Label D 0:1:2]
set Lab3 [Label D 0:1:3]
set Lab4 [Label D 0:1:4]
set Lab5 [Label D 0:1:5]
set Lab6 [Label D 0:1:6]
#3 set references
SetRefArray D $Lab1 1 2 $Lab2 $Lab1
SetRefArray D $Lab2 1 2 $Lab3 $Lab4
SetRefArray D $Lab3 1 1 $Lab1
#4 set additional references
NewCommand D
SetRefArray D $Lab4 1 2 $Lab5 $Lab1
SetRefArray D $Lab5 1 1 $Lab6
SetRefArray D $Lab6 1 2 $Lab3 $Lab4
NewCommand D
#5 check references
GetRefArray D $Lab1
GetRefArray D $Lab2
GetRefArray D $Lab3
GetRefArray D $Lab4
GetRefArray D $Lab5
GetRefArray D $Lab6
#6 save the document
SaveAs D ${imagedir}/testDoc2.std
#7 close the 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}"
}
#8 reopen just saved document with the same name
Open ${imagedir}/testDoc2.std D
#9 close the document
if { [catch {Close D} catch_result] } {
set catch_status 1
}
if { ${catch_status} != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}