1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0032705: Test - name clashes within temporary files within bugs/caf/bug23766_X

Several test cases writing temporary files have been corrected.
This commit is contained in:
kgv 2021-12-01 21:50:48 +03:00 committed by smoskvin
parent 740833a6a8
commit 30fa5f6713
78 changed files with 298 additions and 306 deletions

View File

@ -7,10 +7,8 @@ puts "==========="
Open [locate_data_file BUC60756_Doc.cbf] D Open [locate_data_file BUC60756_Doc.cbf] D
###################################################################### set aTmpFile ${imagedir}/${casename}.cbf
catch {file delete ${imagedir}/Doc2.cbf} SaveAs D $aTmpFile
SaveAs D ${imagedir}/Doc2.cbf
Close D Close D
Open ${imagedir}/Doc2.cbf D Open $aTmpFile D
file delete -force $aTmpFile

View File

@ -7,11 +7,10 @@ puts "==========="
Open [locate_data_file BUC60756_Doc.std] D Open [locate_data_file BUC60756_Doc.std] D
######################################################################
catch {file delete ${imagedir}/Doc2.cbf}
Format D BinOcaf Format D BinOcaf
SaveAs D ${imagedir}/Doc2.cbf
Close D
Open ${imagedir}/Doc2.cbf D
set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
Close D
Open $aTmpFile D
file delete -force $aTmpFile

View File

@ -4,12 +4,9 @@ puts "=============="
NewDocument D BinOcaf NewDocument D BinOcaf
################################################################## set aTmpFile ${imagedir}/${casename}.cbf
if { [catch {set res [SaveAs D ${imagedir}/OCC158.cbf]}] != 0 } { if { [catch {set res [SaveAs D ${aTmpFile}] }] != 0 } {
puts "OCC158: Error" puts "OCC158: Error"
} else {
file delete ${imagedir}/OCC158.cbf
} }
file delete -force $aTmpFile

View File

@ -3,8 +3,8 @@ puts "OCC170"
puts "(case 3)" puts "(case 3)"
puts "========================" puts "========================"
set docName OCC170 set docName ${casename}
set newDocName OCC170_2 set newDocName ${casename}_2
set str1 "~!@#$%^&*():;'{}\|?/.>,<~!@#$%^&*():;'{}\|?/.>,<#$%#$%$%^&*():;'{}\|$%^&*(@#$%^&*():;'{}\|¦/" set str1 "~!@#$%^&*():;'{}\|?/.>,<~!@#$%^&*():;'{}\|?/.>,<#$%#$%$%^&*():;'{}\|$%^&*(@#$%^&*():;'{}\|¦/"
NewDocument $docName XmlOcaf NewDocument $docName XmlOcaf
@ -31,4 +31,3 @@ if {$str1 == $str2} {puts "OCC170 OK"} else {
puts "str2=${str2}" puts "str2=${str2}"
puts "OCC170 Error" puts "OCC170 Error"
} }

View File

@ -73,13 +73,13 @@ if { ${USA_IsDone} != 0 || ${new_USA_Real}!=${Italian_Real} } {
} }
# Store the document # Store the document
file delete ${imagedir}/OCC1919-M6.xml set aTmpFile ${imagedir}/${casename}.xml
SaveAs D ${imagedir}/OCC1919-M6.xml file delete $aTmpFile
if { ![file exists ${imagedir}/OCC1919-M6.xml] } { SaveAs D $aTmpFile
if { ![file exists $aTmpFile] } {
puts "OCC1919 Error : There is not file" puts "OCC1919 Error : There is not file"
set IsGood 0 set IsGood 0
} }
catch {exec chmod 777 ${imagedir}/OCC1919-M6.xml}
Close D Close D
# Set en_US locale # Set en_US locale
@ -91,7 +91,8 @@ if { ${en_US_local} != "en_US" } {
} }
# Restore the document # Restore the document
Open ${imagedir}/OCC1919-M6.xml DD Open $aTmpFile DD
file delete -force $aTmpFile
# Get a value of the attribute # Get a value of the attribute
set USA_IsDone [catch {set new_USA_Real [GetReal DD ${USA_Label}]} message] set USA_IsDone [catch {set new_USA_Real [GetReal DD ${USA_Label}]} message]

View File

@ -1,28 +1,22 @@
puts "============" puts "============"
puts "OCC23306" puts "OCC23306: F a i l u r e s reading some attributes of BinOcaf document"
puts "============" puts "============"
puts "" puts ""
####################################################################################
# Failures reading some attributes of BinOcaf document
####################################################################################
set BugNumber OCC23306 set BugNumber OCC23306
NewDocument D1 BinOcaf NewDocument D1 BinOcaf
SetExtStringArray D1 0:1:1 0 1 3 String1 String2 String3 SetExtStringArray D1 0:1:1 0 1 3 String1 String2 String3
SaveAs D1 ${imagedir}/ocaf1.cbf
set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D1 $aTmpFile
Close D1 Close D1
set warn [Open ${imagedir}/ocaf1.cbf D2] set warn [Open $aTmpFile D2]
set info [lsearch $warn "warning:"] set info [lsearch $warn "warning:"]
file delete -force ${aTmpFile}
if { $info == -1 } { if { $info == -1 } {
puts "OK ${BugNumber}" puts "OK ${BugNumber}"
} else { } else {
puts "Faulty ${BugNumber}" puts "Faulty ${BugNumber}"
} }

View File

@ -51,12 +51,14 @@ if { [regexp "REVERSED" $info2] != 1 } {
} }
#4 - test persistence: check orientation after retrieving (to be the same as before) #4 - test persistence: check orientation after retrieving (to be the same as before)
file delete -force ${imagedir}/bug23766_ttt1.cbf
NewCommand D NewCommand D
SaveAs D ${imagedir}/bug23766_ttt1.cbf set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
Close D Close D
##unset D ##unset D
Open ${imagedir}/bug23766_ttt1.cbf D Open $aTmpFile D
file delete -force $aTmpFile
GetShape D 0:1:2:1:2 E1 GetShape D 0:1:2:1:2 E1
set info3 [whatis E1] set info3 [whatis E1]
## to be: E1 is a shape EDGE FORWARD Modified Orientable ## to be: E1 is a shape EDGE FORWARD Modified Orientable
@ -74,4 +76,3 @@ if { [regexp "REVERSED" $info4] != 1 } {
} else { } else {
puts "OK: orientation of E2 is correct" puts "OK: orientation of E2 is correct"
} }

View File

@ -50,12 +50,15 @@ if { [regexp "REVERSED" $info2] != 1 } {
} }
#4 - test persistence: check orientation after retrieving (to be the same as before) #4 - test persistence: check orientation after retrieving (to be the same as before)
file delete -force ${imagedir}/bug23766_ttt1.cbf
NewCommand D NewCommand D
SaveAs D ${imagedir}/bug23766_ttt1.cbf
set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
Close D Close D
##unset D ##unset D
Open ${imagedir}/bug23766_ttt1.cbf D Open $aTmpFile D
file delete -force $aTmpFile
GetShape D 0:1:2:1:2 E1 GetShape D 0:1:2:1:2 E1
set info3 [whatis E1] set info3 [whatis E1]
## to be: E1 is a shape EDGE FORWARD Modified Orientable ## to be: E1 is a shape EDGE FORWARD Modified Orientable

View File

@ -53,12 +53,15 @@ if { [regexp "REVERSED" $info2] != 1 } {
} }
#4 - test persistence: check orientation after retrieving (to be the same as before) #4 - test persistence: check orientation after retrieving (to be the same as before)
file delete -force ${imagedir}/bug23766_ttt1.xml
NewCommand D NewCommand D
SaveAs D ${imagedir}/bug23766_ttt1.xml
set aTmpFile ${imagedir}/${casename}.xml
SaveAs D $aTmpFile
Close D Close D
##unset D ##unset D
Open ${imagedir}/bug23766_ttt1.xml D Open $aTmpFile D
file delete -force $aTmpFile
GetShape D 0:1:2:1:2 E1 GetShape D 0:1:2:1:2 E1
set info3 [whatis E1] set info3 [whatis E1]
## to be: E1 is a shape EDGE FORWARD Modified Orientable ## to be: E1 is a shape EDGE FORWARD Modified Orientable

View File

@ -23,7 +23,8 @@ GetShape D $F2:2 Box2
NewCommand D NewCommand D
#3 save shape in the document #3 save shape in the document
SaveAs D ${imagedir}/testDoc1.cbf set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
#4 close document #4 close document
set catch_status 0 set catch_status 0
@ -37,7 +38,8 @@ if { ${catch_status} != 0 } {
} }
#5 reopen just saved document with the same name #5 reopen just saved document with the same name
Open ${imagedir}/testDoc1.cbf D Open $aTmpFile D
file delete -force $aTmpFile
set catch_status 0 set catch_status 0
#6 close the document #6 close the document

View File

@ -40,7 +40,8 @@ GetRefArray D $Lab5
GetRefArray D $Lab6 GetRefArray D $Lab6
#6 save the document #6 save the document
SaveAs D ${imagedir}/testDoc2.cbf set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
#7 close the document #7 close the document
set catch_status 0 set catch_status 0
@ -54,7 +55,8 @@ if { ${catch_status} != 0 } {
} }
#8 reopen just saved document with the same name #8 reopen just saved document with the same name
Open ${imagedir}/testDoc2.cbf D Open $aTmpFile D
file delete -force $aTmpFile
#9 close the document #9 close the document
if { [catch {Close D} catch_result] } { if { [catch {Close D} catch_result] } {
@ -66,4 +68,3 @@ if { ${catch_status} != 0 } {
} else { } else {
puts "OK ${BugNumber}" puts "OK ${BugNumber}"
} }

View File

@ -1,18 +1,14 @@
puts "==========" puts "=========="
puts "OCC24852" puts "OCC24852: C r a s h on storage of an Ocaf document in XML file format"
puts "==========" puts "=========="
puts "" puts ""
########################################################
# Crash on storage of an Ocaf document in XML file format
########################################################
NewDocument D XmlOcaf NewDocument D XmlOcaf
set File ${imagedir}/bug24852_test.xml set aTmpFile ${imagedir}/${casename}.xml
if { [catch {set res [SaveAs D $aTmpFile]}] != 0 } {
if { [catch {set res [SaveAs D ${File}]}] != 0 } {
puts "Error : Crash on storage of an Ocaf document in XML file format" puts "Error : Crash on storage of an Ocaf document in XML file format"
} else { } else {
puts "OK : Storage of an Ocaf document in XML file format is good" puts "OK : Storage of an Ocaf document in XML file format is good"
file delete ${File}
} }
file delete -force $aTmpFile

View File

@ -50,11 +50,13 @@ set info5 [GetReferenceList D $Lab5]
# output => "List is empty" # output => "List is empty"
# 6. save the Document in external file # 6. save the Document in external file
SaveAs D ${imagedir}/bug26014_test1.cbf set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
Close D Close D
# 7. reopen the Document # 7. reopen the Document
Open ${imagedir}/bug26014_test1.cbf D Open $aTmpFile D
file delete -force $aTmpFile
# 8. Check the restored attributes at the specified labels # 8. Check the restored attributes at the specified labels
set info8 [GetBooleanList D $Lab1] set info8 [GetBooleanList D $Lab1]

View File

@ -50,11 +50,13 @@ set info5 [GetReferenceList D $Lab5]
# output => "List is empty" # output => "List is empty"
# 6. save the Document in external file # 6. save the Document in external file
SaveAs D ${imagedir}/bug26014_test2.cbf set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
Close D Close D
# 7. reopen the Document # 7. reopen the Document
Open ${imagedir}/bug26014_test2.cbf D Open $aTmpFile D
file delete -force $aTmpFile
# 8. Check the restored attributes at the specified labels # 8. Check the restored attributes at the specified labels
set info8 [GetBooleanList D $Lab1] set info8 [GetBooleanList D $Lab1]

View File

@ -50,11 +50,13 @@ set info5 [GetReferenceList D $Lab5]
# output => "List is empty" # output => "List is empty"
# 6. save the Document in external file # 6. save the Document in external file
SaveAs D ${imagedir}/bug26014_test3.xml set aTmpFile ${imagedir}/${casename}.xml
SaveAs D $aTmpFile
Close D Close D
# 7. reopen the Document # 7. reopen the Document
Open ${imagedir}/bug26014_test3.xml D Open $aTmpFile D
file delete -force $aTmpFile
# 8. Check the restored attributes at the specified labels # 8. Check the restored attributes at the specified labels
set info8 [GetBooleanList D $Lab1] set info8 [GetBooleanList D $Lab1]

View File

@ -1,10 +1,7 @@
puts "============" puts "============"
puts "OCC25536" puts "OCC25536: XmlMDataXtd_GeometryDriver doesn't support TDataXtd_SPLINE, TDataXtd_PLANE and TDataXtd_CYLINDER."
puts "============" puts "============"
puts "" puts ""
#######################################################################
# XmlMDataXtd_GeometryDriver doesn't support TDataXtd_SPLINE, TDataXtd_PLANE and TDataXtd_CYLINDER.
#######################################################################
NewDocument Doc XmlOcaf NewDocument Doc XmlOcaf
@ -16,12 +13,13 @@ SetGeometry Doc 0:2:2 pln
Label Doc 0:2:3 Label Doc 0:2:3
SetGeometry Doc 0:2:3 cyl SetGeometry Doc 0:2:3 cyl
set aFile ${imagedir}/bug25536_test.xml set aTmpFile ${imagedir}/${casename}.xml
SaveAs Doc ${aFile} SaveAs Doc ${aTmpFile}
Close Doc Close Doc
# check attributes are correctly restored # check attributes are correctly restored
Open ${aFile} Doc2 Open ${aTmpFile} Doc2
file delete -force $aTmpFile
set aType [GetGeometryType Doc2 0:2:1] set aType [GetGeometryType Doc2 0:2:1]
if {${aType} != "spl"} { if {${aType} != "spl"} {
@ -37,4 +35,3 @@ if {${aType} != "cyl"} {
} }
Close Doc2 Close Doc2

View File

@ -1,10 +1,8 @@
puts "============" puts "============"
puts "OCC25537" puts "OCC25537: XmlMPrsStd_PositionDriver::Paste runtime check c r a s h."
puts "============" puts "============"
puts "" puts ""
#######################################################################
# XmlMPrsStd_PositionDriver::Paste runtime check crash.
#######################################################################
pload XDEDRAW pload XDEDRAW
NewDocument Doc XmlXCAF NewDocument Doc XmlXCAF
@ -22,8 +20,9 @@ for {set i 1} {$i < 100} {incr i} {
XSetCentroid Doc $aLab2 $aBigNum $aBigNum $aBigNum XSetCentroid Doc $aLab2 $aBigNum $aBigNum $aBigNum
} }
set aFile ${imagedir}/bug25537_test.xml set aTmpFile ${imagedir}/${casename}.xml
SaveAs Doc ${aFile} SaveAs Doc ${aTmpFile}
## ==> No exception ## ==> No exception
Close Doc Close Doc
file delete -force $aTmpFile

View File

@ -25,7 +25,9 @@ Undo D 1
Redo D 1 Redo D 1
AISColor D $Lab1 AQUAMARINE4 AISColor D $Lab1 AQUAMARINE4
NewCommand D NewCommand D
SaveAs D $imagedir/bug26290_new_1.cbf
set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D $aTmpFile
AISErase D $Lab1 AISErase D $Lab1
## DFBrowse D # - for debug purpose only ## DFBrowse D # - for debug purpose only
@ -36,7 +38,8 @@ Redo D 1
Close D Close D
## reopen just kept file ## reopen just kept file
Open $imagedir/bug26290_new_1.cbf D Open $aTmpFile D
file delete -force $aTmpFile
## DFBrowse D ## DFBrowse D
AISInitViewer D AISInitViewer D

View File

@ -27,11 +27,14 @@ Undo D 1
Redo D 1 Redo D 1
AISColor D $Lab1 AQUAMARINE4 AISColor D $Lab1 AQUAMARINE4
NewCommand D NewCommand D
SaveAs D $imagedir/bug26290_new_1.cbf
set aTmpFile1 ${imagedir}/${casename}_1.cbf
SaveAs D $aTmpFile1
Close D Close D
# test # test
Open $imagedir/bug26290_new_1.cbf D Open $aTmpFile1 D
file delete -force $aTmpFile1
UndoLimit D 100 UndoLimit D 100
NewCommand D NewCommand D
@ -53,14 +56,16 @@ NewCommand D
Undo D 1 Undo D 1
Redo D 1 Redo D 1
SaveAs D $imagedir/bug26290_new_2.cbf set aTmpFile2 ${imagedir}/${casename}_2.cbf
SaveAs D $aTmpFile2
AISErase D $Lab2 AISErase D $Lab2
set Lab1 [Label D 0:1:1] set Lab1 [Label D 0:1:1]
AISErase D $Lab1 AISErase D $Lab1
NewCommand D NewCommand D
Close D Close D
Open $imagedir/bug26290_new_2.cbf D Open $aTmpFile2 D
file delete -force $aTmpFile1
## DFBrowse D ## DFBrowse D
AISInitViewer D AISInitViewer D

View File

@ -6,6 +6,5 @@ NewDocument D BinOcaf
###################################################################### ######################################################################
file delete ${imagedir}/OCC267.cbf SaveAs D ${imagedir}/${casename}.cbf
SaveAs D ${imagedir}/OCC267.cbf file delete -force ${imagedir}/${casename}.cbf

View File

@ -10,12 +10,12 @@ NewDocument Doc BinOcaf
SetInteger Doc 0:2 100 SetInteger Doc 0:2 100
# Save the document # Save the document
set aFile ${imagedir}/OCC27433-[file tail [info script]].cbf set aTmpFile ${imagedir}/${casename}.cbf
file delete ${aFile} puts ${aTmpFile}
puts ${aFile} catch {SaveAs Doc ${aTmpFile}}
catch {SaveAs Doc ${aFile}} if { ![file exists ${aTmpFile}] } {
if { ![file exists ${aFile}] } {
puts "Error: Can not save the file with path to plugins ended with slash" puts "Error: Can not save the file with path to plugins ended with slash"
} }
Close Doc Close Doc
file delete -force $aTmpFile

View File

@ -11,18 +11,18 @@ pload OCAF MODELING
# just a big shape to fit in memory # just a big shape to fit in memory
restore [locate_data_file $aBigShape] s restore [locate_data_file $aBigShape] s
file delete ${imagedir}/test.cbf set aTmpFile ${imagedir}/${casename}.cbf
# store it in the document # store it in the document
NewDocument D BinOcaf NewDocument D BinOcaf
SetShape D "0:2" s SetShape D "0:2" s
SaveAs D ${imagedir}/test.cbf SaveAs D $aTmpFile
Close D Close D
# store the memory used before opening a document # store the memory used before opening a document
set aBefore [meminfo h] set aBefore [meminfo h]
Open ${imagedir}/test.cbf DD Open $aTmpFile DD
set aDocLoaded [meminfo h] set aDocLoaded [meminfo h]
set aBigDelta [expr $aDocLoaded - $aBefore] set aBigDelta [expr $aDocLoaded - $aBefore]
Close DD Close DD
@ -39,3 +39,5 @@ puts "After close: $anAfter"
if {[expr $aBigDelta / 20. - $aDelta] < 0} { if {[expr $aBigDelta / 20. - $aDelta] < 0} {
puts "Error: the memory is not freed after Open/Close" puts "Error: the memory is not freed after Open/Close"
} }
file delete -force $aTmpFile

View File

@ -1,19 +1,18 @@
puts "===========" puts "==========="
puts "OCC28428" puts "OCC28428: BinMNaming_NamedShapeDriver f a i l s if there are no nodes in NamedShape"
puts "===========" puts "==========="
puts "" puts ""
########################################################################
# BinMNaming_NamedShapeDriver fails if there are no nodes in NamedShape
########################################################################
pload QAcommands pload QAcommands
NewDocument D1 BinOcaf NewDocument D1 BinOcaf
# Create TNaming_Builder on a label without putthing shapes # Create TNaming_Builder on a label without putthing shapes
BuildNamedShape D1 0:1 P BuildNamedShape D1 0:1 P
SaveAs D1 $imagedir/bug28428_new.cbf set aTmpFile ${imagedir}/${casename}.cbf
SaveAs D1 $aTmpFile
Close D1 Close D1
# This produced a NamedShape driver failure with catching by general driver # This produced a NamedShape driver failure with catching by general driver
# and output a failure message (caught by parse.rules) # and output a failure message (caught by parse.rules)
Open $imagedir/bug28428_new.cbf D2 Open $aTmpFile D2
Close D2 Close D2
file delete -force $aTmpFile

View File

@ -6,8 +6,8 @@ puts ""
NewDocument D XmlOcaf NewDocument D XmlOcaf
SetExtStringArray D 0:1 0 1 3 Hello hallo Bonjour SetExtStringArray D 0:1 0 1 3 Hello hallo Bonjour
set FileV7 ${imagedir}/bug28691_doc7.xml set FileV7 ${imagedir}/${casename}_doc7.xml
set FileV9 ${imagedir}/bug28691_doc9.xml set FileV9 ${imagedir}/${casename}_doc9.xml
SetNode D 0:1 SetNode D 0:1
AISSet D 0:1 NS AISSet D 0:1 NS
@ -90,3 +90,6 @@ if { [regexp "Bonjour" ${info}] != 1 } {
} else { } else {
puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document" puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document"
} }
file delete -force ${FileV7}
file delete -force ${FileV9}

View File

@ -6,8 +6,8 @@ puts ""
NewDocument D BinOcaf NewDocument D BinOcaf
SetExtStringArray D 0:1 0 1 3 Hello hallo Bonjour SetExtStringArray D 0:1 0 1 3 Hello hallo Bonjour
set FileV7 ${imagedir}/bug29217_doc7.cbf set FileV7 ${imagedir}/${casename}_doc7.cbf
set FileV10 ${imagedir}/bug29217_doc10.cbf set FileV10 ${imagedir}/${casename}_doc10.cbf
SetNode D 0:1 SetNode D 0:1
AISSet D 0:1 NS AISSet D 0:1 NS
@ -90,3 +90,6 @@ if { [regexp "Bonjour" ${info}] != 1 } {
} else { } else {
puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document" puts "OK : there is \"Bonjour\" word in TDataStd_ExtStringArray attribute in old version document"
} }
file delete -force ${FileV7}
file delete -force ${FileV10}

View File

@ -8,11 +8,8 @@ pload QAcommands
NewDocument D BinOcaf NewDocument D BinOcaf
###################################################### ######################################################
catch { SaveAs D ${imagedir}/OCC381_1.cbf } catch { SaveAs D ${imagedir}/${casename}.cbf }
if { [catch { OCC381_Save D } ] } { if { [catch { OCC381_Save D } ] } {
puts "OCC381: Error" puts "OCC381: Error"
} else {
catch { exec chmod 777 ${imagedir}/OCC381_1.cbf }
file delete -force ${imagedir}/OCC381_1.cbf
} }
file delete -force ${imagedir}/${casename}.cbf

View File

@ -8,10 +8,7 @@ pload QAcommands
NewDocument D BinOcaf NewDocument D BinOcaf
###################################################### ######################################################
if { [catch { OCC381_SaveAs D ${imagedir}/OCC381_2.cbf}] } { if { [catch { OCC381_SaveAs D ${imagedir}/${casename}.cbf}] } {
puts "OCC381: Error" puts "OCC381: Error"
} else {
catch {exec chmod 777 ${imagedir}/OCC381_2.cbf}
file delete -force ${imagedir}/OCC381_2.cbf
} }
file delete -force ${imagedir}/${casename}.cbf

View File

@ -23,18 +23,17 @@ SetName D ${aLabel} ${aSetAttr1}
NewCommand D NewCommand D
# Save the document # Save the document
set aFile ${imagedir}/OCC425.cbf set aFile ${imagedir}/${casename}.cbf
catch {file delete ${aFile}}
SaveAs D ${aFile} SaveAs D ${aFile}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {
puts "There is not ${aFile} file; SaveAs command: Error" puts "There is not ${aFile} file; SaveAs command: Error"
set IsGood 0 set IsGood 0
} }
catch {exec chmod 777 ${aFile}}
# Restore the document # Restore the document
Close D Close D
Open ${aFile} DD Open ${aFile} DD
file delete -force ${aFile}
# Get a value of the attribute # Get a value of the attribute
set aGetAttr3 "" set aGetAttr3 ""

View File

@ -57,19 +57,18 @@ SelectShape D $CylNamLab:11 C_2 C
SelectShape D $CylNamLab:12 C_3 C SelectShape D $CylNamLab:12 C_3 C
# Save the document # Save the document
set aFile ${imagedir}/OCC9746-Z3.cbf set aFile ${imagedir}/${casename}.cbf
file delete ${aFile}
SaveAs D ${aFile} SaveAs D ${aFile}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {
puts "There is not ${aFile} file; SaveAs command: Error" puts "There is not ${aFile} file; SaveAs command: Error"
puts "${BugNumber}: ERROR (case 1)" puts "${BugNumber}: ERROR (case 1)"
} }
catch {exec chmod 777 ${aFile}}
Close D Close D
# Restore the document # Restore the document
catch {Open ${aFile} DDoc} catch {Open ${aFile} DDoc}
file delete -force ${aFile}
# #
set BoxNamLab [Label DDoc 0:4] set BoxNamLab [Label DDoc 0:4]

View File

@ -1,14 +1,10 @@
puts "========" puts "========"
puts "CR23822" puts "CR23822: S I G S E G V 'segmentation v i o l a t i o n' during writing IGES"
puts "========" puts "========"
puts "" puts ""
#########################################################
## SIGSEGV 'segmentation violation' during writing IGES
#########################################################
ReadIges D [locate_data_file ball_bearing.igs] ReadIges D [locate_data_file ball_bearing.igs]
set aFile ${imagedir}/bug23822_new_file.igs set aTmpFile ${imagedir}/${casename}.igs
file delete -force ${aFile} WriteIges D $aTmpFile
file delete -force $aTmpFile
WriteIges D ${aFile}

View File

@ -1,19 +1,18 @@
puts "========" puts "========"
puts "OCC25518" puts "OCC25518: Colors are not written to IGES 5.3"
puts "========" puts "========"
puts "" puts ""
######################################
# Colors are not written to IGES 5.3
######################################
catch {exec rm ${imagedir}/OCC25518.igs}
psphere s 10 psphere s 10
XNewDoc D XNewDoc D
XAddShape D s XAddShape D s
XSetColor D s 0 0 1 XSetColor D s 0 0 1
param write.iges.brep.mode 1 param write.iges.brep.mode 1
WriteIges D ${imagedir}/OCC25518.igs
ReadIges T ${imagedir}/OCC25518.igs set aTmpFile ${imagedir}/${casename}.igs
WriteIges D $aTmpFile
ReadIges T $aTmpFile
file delete -force ${aTmpFile}
if {[string trim [XGetAllColors T]] != "BLUE"} { if {[string trim [XGetAllColors T]] != "BLUE"} {
puts "ERROR: OCC25518 is reproduced. Color is lost." puts "ERROR: OCC25518 is reproduced. Color is lost."
} }

View File

@ -1,10 +1,7 @@
puts "============" puts "============"
puts "OCC25632" puts "OCC25632: IGES writer looses face orientation"
puts "============" puts "============"
puts "" puts ""
#######################################################################
# IGES writer looses face orientation
#######################################################################
plane p 0 0 0 0 0 1 1 0 0 plane p 0 0 0 0 0 1 1 0 0
mkface f p 0 100 0 100 mkface f p 0 100 0 100
@ -17,13 +14,15 @@ normals f 100
treverse f treverse f
normals f 100 normals f 100
xwd ${imagedir}/${test_image}_1.png xwd ${imagedir}/${casename}_1.png
testwriteiges ${imagedir}/bug25632_f.igs f set aTmpFile ${imagedir}/${casename}.igs
testreadiges ${imagedir}/bug25632_f.igs ff testwriteiges $aTmpFile f
testreadiges $aTmpFile ff
file delete -force ${aTmpFile}
donly ff donly ff
normals ff 100 normals ff 100
xwd ${imagedir}/${test_image}_2.png xwd ${imagedir}/${casename}_2.png

View File

@ -1,10 +1,7 @@
puts "============" puts "============"
puts "OCC25632" puts "OCC25632: IGES writer looses face orientation"
puts "============" puts "============"
puts "" puts ""
#######################################################################
# IGES writer looses face orientation
#######################################################################
plane p 0 0 0 0 0 1 1 0 0 plane p 0 0 0 0 0 1 1 0 0
mkface face p 0 100 0 100 mkface face p 0 100 0 100
@ -21,13 +18,15 @@ mkface f s 10 20 30 40
treverse f treverse f
normals f 100 normals f 100
xwd ${imagedir}/${test_image}_1.png xwd ${imagedir}/${casename}_1.png
testwriteiges ${imagedir}/f_2.igs f set aTmpFile ${imagedir}/${casename}.igs
testreadiges ${imagedir}/f_2.igs ff testwriteiges $aTmpFile f
testreadiges $aTmpFile ff
file delete -force ${aTmpFile}
donly ff donly ff
normals ff 100 normals ff 100
xwd ${imagedir}/${test_image}_2.png xwd ${imagedir}/${casename}_2.png

View File

@ -1,12 +1,7 @@
puts "========" puts "========"
puts "OCC25747" puts "OCC25747: Bad IGES file after import and export with different units"
puts "========" puts "========"
puts "" puts ""
######################################
# Bad IGES file after import and export with different units
######################################
catch {exec rm ${imagedir}/OCC25747.igs}
# default OCCT unit for reading # default OCCT unit for reading
param xstep.cascade.unit MM param xstep.cascade.unit MM
@ -23,10 +18,12 @@ vfit
vsetdispmode 1 vsetdispmode 1
vdump ${imagedir}/${casename}_1.png vdump ${imagedir}/${casename}_1.png
WriteIges D ${imagedir}/OCC25747.igs set aTmpFile ${imagedir}/${casename}.igs
WriteIges D $aTmpFile
# bad IGES file after export # bad IGES file after export
ReadIges T ${imagedir}/OCC25747.igs ReadIges T $aTmpFile
file delete -force ${aTmpFile}
XShow T XShow T
vtop vtop

View File

@ -1,12 +1,13 @@
puts "========" puts "========"
puts "OCC26138" puts "OCC26138: Problems with writing periodic BSplines into IGES"
puts "========" puts "========"
puts "" puts ""
#####################################################
# Problems with writing periodic BSplines into IGES
#####################################################
igesbrep [locate_data_file OCC26138_Torus.igs] a * igesbrep [locate_data_file OCC26138_Torus.igs] a *
brepiges a ${imagedir}/bug26138.igs
igesbrep ${imagedir}/bug26138.igs b * set aTmpFile ${imagedir}/${casename}.igs
brepiges a $aTmpFile
igesbrep $aTmpFile b *
file delete -force ${aTmpFile}
checkprops a -s -equal b checkprops a -s -equal b

View File

@ -1,11 +1,10 @@
puts "========" puts "========"
puts "OCC26419" puts "OCC26419: Export of a reversed face leads to c r a s h in 6.9.0 although proceeded in 6.8.0"
puts "========" puts "========"
puts "" puts ""
#####################################################
# [Regression?] Export of a reversed face leads to crash in 6.9.0 although proceeded in 6.8.0
#####################################################
restore [locate_data_file bug26419_a-fwd.brep] af restore [locate_data_file bug26419_a-fwd.brep] af
brepiges af ${imagedir}/bug26419_1.igs set aTmpFile ${imagedir}/${casename}.igs
brepiges af $aTmpFile
file delete -force ${aTmpFile}

View File

@ -1,11 +1,10 @@
puts "========" puts "========"
puts "OCC26419" puts "OCC26419: Export of a reversed face leads to c r a s h in 6.9.0 although proceeded in 6.8.0"
puts "========" puts "========"
puts "" puts ""
#####################################################
# [Regression?] Export of a reversed face leads to crash in 6.9.0 although proceeded in 6.8.0
#####################################################
restore [locate_data_file bug26419_a-rev.brep] ar restore [locate_data_file bug26419_a-rev.brep] ar
brepiges ar ${imagedir}/bug26419_2.igs set aTmpFile ${imagedir}/${casename}.igs
brepiges ar $aTmpFile
file delete -force ${aTmpFile}

View File

@ -1,11 +1,13 @@
####################################################################### #######################################################################
# OCC26931: [Regression in 6.9.0] Exporting a face throws an exception puts "OCC26931: Exporting a face throws an e x c e p t i o n"
####################################################################### #######################################################################
# restore initial face # restore initial face
restore [locate_data_file bug26931.brep] face restore [locate_data_file bug26931.brep] face
set square 6416.6 set square 6416.6
# export face to IGES # export face to IGES
brepiges face ${imagedir}/${casename}.igs set aTmpFile ${imagedir}/${casename}.igs
brepiges face $aTmpFile
# import back to check similarity # import back to check similarity
igesbrep ${imagedir}/${casename}.igs result * igesbrep $aTmpFile result *
file delete -force ${aTmpFile}

View File

@ -1,9 +1,12 @@
######################################################################################### #########################################################################################
# OCC26989: [Regression in 6.9.0] Export of a reversed face leads to wrong data in 6.9.0 puts "OCC26989: Export of a reversed face leads to wrong data in 6.9.0"
######################################################################################### #########################################################################################
restore [locate_data_file bug26989.brep] a restore [locate_data_file bug26989.brep] a
newmodel newmodel
brepiges a ${imagedir}/bug26989.igs set aTmpFile ${imagedir}/${casename}.igs
igesbrep ${imagedir}/bug26989.igs result * brepiges a $aTmpFile
igesbrep $aTmpFile result *
file delete -force ${aTmpFile}
checkprops result -s 56.5487 checkprops result -s 56.5487

View File

@ -1,8 +1,12 @@
####################################################################### #######################################################################
# Data Exchange - Writing face with NaturalRestriction flag to IGES puts "Data Exchange - Writing face with NaturalRestriction flag to IGES"
####################################################################### #######################################################################
restore [locate_data_file bug28589.brep] face restore [locate_data_file bug28589.brep] face
brepiges face ${imagedir}/${casename}.igs
igesbrep ${imagedir}/${casename}.igs result * set aTmpFile ${imagedir}/${casename}.igs
brepiges face $aTmpFile
igesbrep $aTmpFile result *
file delete -force ${aTmpFile}
checknbshapes result -shape 10 checknbshapes result -shape 10

View File

@ -1,21 +1,19 @@
pload DCAF
pload TOPTEST
pload XDE
puts "========" puts "========"
puts "OCC26657" puts "OCC26657: STEP OCAF writers should keep hierarchy and colors when saving non-root elements"
puts "========" puts "========"
puts "" puts ""
##########################################################################
# STEP OCAF writers should keep hierarchy and colors when saving non-root elements pload DCAF TOPTEST XDE XDEDRAW
##########################################################################
pload XDEDRAW
ReadStep D1 [locate_data_file bug26657.stp] ReadStep D1 [locate_data_file bug26657.stp]
WriteStep D1 $imagedir/bug26657_temp.stp a 0:1:1:1:2
set aTmpFile ${imagedir}/${casename}_temp.stp
WriteStep D1 $aTmpFile a 0:1:1:1:2
if { [catch { Close D11 } catch_result] } { if { [catch { Close D11 } catch_result] } {
puts "Document D11 is not exist" puts "Document D11 is not exist"
} }
ReadStep D11 $aTmpFile
file delete -force $aTmpFile
ReadStep D11 $imagedir/bug26657_temp.stp
XGetOneShape result D11 XGetOneShape result D11
checkshape result f checkshape result f
@ -24,5 +22,4 @@ checknbshapes result -solid 3
XShow D11 XShow D11
vfit vfit
vsetdispmode 1 vsetdispmode 1
vdump $imagedir/${test_image}.png vdump $imagedir/${casename}.png

View File

@ -1,10 +1,7 @@
puts "==========" puts "=========="
puts "OCC29403" puts "OCC29403: Subshapes names are not imported from step"
puts "==========" puts "=========="
puts "" puts ""
#########################################################
# Subshapes names are not imported from step
#########################################################
param read.stepcaf.subshapes.name 1 param read.stepcaf.subshapes.name 1
param write.stepcaf.subshapes.name 1 param write.stepcaf.subshapes.name 1
@ -18,9 +15,10 @@ regexp {level N 1 +: +([-0-9.+eE]+)} $info1 full l1
regexp {Total number of labels for shapes in the document += +([-0-9.+eE]+)} $info1 full nb regexp {Total number of labels for shapes in the document += +([-0-9.+eE]+)} $info1 full nb
regexp {Number of labels with name += +([-0-9.+eE]+)} $info1 full nbname regexp {Number of labels with name += +([-0-9.+eE]+)} $info1 full nbname
WriteStep doc $imagedir/doc_subshapes.stp set aTmpFile ${imagedir}/${casename}_subshapes.stp
WriteStep doc $aTmpFile
ReadStep after_doc $imagedir/doc_subshapes.stp ReadStep after_doc $aTmpFile
file delete -force $aTmpFile
set info2 [XStat after_doc] set info2 [XStat after_doc]
regexp {level N 0 +: +([-0-9.+eE]+)} $info2 full l0_1 regexp {level N 0 +: +([-0-9.+eE]+)} $info2 full l0_1
@ -41,7 +39,6 @@ if { ${l0} != ${l0_1} ||
Close doc Close doc
Close after_doc Close after_doc
file delete -force $imagedir/doc_subshapes.stp
param read.stepcaf.subshapes.name 0 param read.stepcaf.subshapes.name 0
param write.stepcaf.subshapes.name 0 param write.stepcaf.subshapes.name 0

View File

@ -12,7 +12,7 @@ if { [catch { ReadStep D ${filename} } result] } {
# Static data # Static data
set Transparency 0.5 set Transparency 0.5
set TempFilename ${imagedir}/bug31550_temp.stp set TempFilename ${imagedir}/${casename}_temp.stp
# Get colors # Get colors
set Colors [XGetAllColors D] set Colors [XGetAllColors D]
@ -29,6 +29,7 @@ if { [catch { WriteStep D ${TempFilename} } result] } {
if { [catch { ReadStep D1 ${TempFilename} } result] } { if { [catch { ReadStep D1 ${TempFilename} } result] } {
puts "ERROR: Couldn't read ${TempFilename} file" puts "ERROR: Couldn't read ${TempFilename} file"
} }
file delete -force $TempFilename
# Get colors # Get colors
set Colors [XGetAllColors D1] set Colors [XGetAllColors D1]

View File

@ -17,11 +17,11 @@ proc CheckName {doc1 doc2 lab} {
} }
proc RunTestWithFile {file} { proc RunTestWithFile {file} {
global imagedir
puts "Testing file $file" puts "Testing file $file"
XOpen [locate_data_file $file] d1 XOpen [locate_data_file $file] d1
WriteStep d1 ${imagedir}/${file}.step set aTmpFile ${::imagedir}/${::casename}_${file}.step
ReadStep d2 ${imagedir}/${file}.step WriteStep d1 $aTmpFile
ReadStep d2 $aTmpFile
CheckName d1 d2 0:1:1:1:1 CheckName d1 d2 0:1:1:1:1
CheckName d1 d2 0:1:1:2:1 CheckName d1 d2 0:1:1:2:1
@ -29,7 +29,7 @@ proc RunTestWithFile {file} {
Close d1 Close d1
Close d2 Close d2
file delete ${imagedir}/${file}.step file delete -force $aTmpFile
} }
RunTestWithFile as1-no-ass-name.xbf RunTestWithFile as1-no-ass-name.xbf

View File

@ -1,17 +1,15 @@
puts "==========" puts "=========="
puts "OCC21802" puts "OCC21802: Not all names are transferred from STEP to IGES via XDE"
puts "==========" puts "=========="
puts "" puts ""
###########################################################
# Not all names are transferred from STEP to IGES via XDE
###########################################################
ReadStep d [locate_data_file bug21802_as1-oc-214.stp] ReadStep d [locate_data_file bug21802_as1-oc-214.stp]
catch {exec rm ${imagedir}/bug21802_as1-oc-214.igs}
WriteIges d ${imagedir}/bug21802_as1-oc-214.igs set aTmpFile ${imagedir}/${casename}.igs
WriteIges d $aTmpFile
set is21802fixed "FALSE" set is21802fixed "FALSE"
set file21802 [open ${imagedir}/bug21802_as1-oc-214.igs RDONLY] set file21802 [open $aTmpFile RDONLY]
while {[eof $file21802] == 0} { while {[eof $file21802] == 0} {
set file21802line [string trim [gets $file21802]] set file21802line [string trim [gets $file21802]]
if {[string first "l-bracke" $file21802line] != -1} { if {[string first "l-bracke" $file21802line] != -1} {
@ -19,6 +17,7 @@ while {[eof $file21802] == 0} {
} }
} }
close $file21802 close $file21802
file delete -force ${aTmpFile}
if {[string compare $is21802fixed "FALSE"] == 0} { if {[string compare $is21802fixed "FALSE"] == 0} {
puts "ERROR: OCC21802 is reproduced" puts "ERROR: OCC21802 is reproduced"

View File

@ -8,13 +8,16 @@ regexp {level N 1 +: +([-0-9.+eE]+)} $info1 full l1
regexp {Total number of labels for shapes in the document += +([-0-9.+eE]+)} $info1 full nb regexp {Total number of labels for shapes in the document += +([-0-9.+eE]+)} $info1 full nb
regexp {Number of labels with name += +([-0-9.+eE]+)} $info1 full nbname regexp {Number of labels with name += +([-0-9.+eE]+)} $info1 full nbname
set aTmpFile ${imagedir}/${casename}_temp.stp
param write.stepcaf.subshapes.name 1 param write.stepcaf.subshapes.name 1
WriteStep doc $imagedir/doc_subshapes.stp WriteStep doc $aTmpFile
param read.stepcaf.subshapes.name 1 param read.stepcaf.subshapes.name 1
ReadStep after_doc $imagedir/doc_subshapes.stp ReadStep after_doc $aTmpFile
file delete -force $aTmpFile
set info2 [XStat after_doc] set info2 [XStat after_doc]
regexp {level N 0 +: +([-0-9.+eE]+)} $info2 full l0_1 regexp {level N 0 +: +([-0-9.+eE]+)} $info2 full l0_1
@ -35,4 +38,3 @@ if { ${l0} != ${l0_1} ||
Close doc Close doc
Close after_doc Close after_doc
file delete -force $imagedir/doc_subshapes.stp

View File

@ -1,18 +1,16 @@
puts "========" puts "========"
puts "OCC25910" puts "OCC25910: The material with 0-density causes e r r o r s during writing STEP files"
puts "========" puts "========"
puts "" puts ""
#######################################################################
# The material with 0-density causes errors during writing STEP files
#######################################################################
pload DCAF pload DCAF
NewDocument D NewDocument D
box b 10 10 10 box b 10 10 10
XSetMaterial D [XAddShape D b] Vacuum 0. XSetMaterial D [XAddShape D b] Vacuum 0.
set bug_info [catch {WriteStep D $imagedir/OCC25910.stp}]
if {$bug_info != 0} { set aTmpFile ${imagedir}/${casename}_tmp.stp
puts "ERROR: OCC25910 is reproduced." set bug_info [catch {WriteStep D $aTmpFile}]
} file delete -force $aTmpFile
if {$bug_info != 0} { puts "ERROR: OCC25910 is reproduced." }

View File

@ -17,9 +17,6 @@ set anImageD $imagedir/${casename}_D.png
set anImageD1 $imagedir/${casename}_D1.png set anImageD1 $imagedir/${casename}_D1.png
set anImageD2 $imagedir/${casename}_D2.png set anImageD2 $imagedir/${casename}_D2.png
catch {exec rm ${aFileD1}}
catch {exec rm ${aFileD2}}
box b 0 0 0 10 10 10 box b 0 0 0 10 10 10
compound b c compound b c
NewDocument D NewDocument D
@ -36,6 +33,8 @@ WriteIges D ${aFileD2}
ReadIges D1 ${aFileD1} ReadIges D1 ${aFileD1}
ReadIges D2 ${aFileD2} ReadIges D2 ${aFileD2}
file delete -force ${aFileD1}
file delete -force ${aFileD2}
XShow D1 XShow D1
vfit vfit

View File

@ -1,10 +1,7 @@
puts "========" puts "========"
puts "OCC27447" puts "OCC27447: Add support for long IGES entity names"
puts "========" puts "========"
puts "" puts ""
##########################################
# Add support for long IGES entity names
##########################################
pload OCAF pload OCAF
@ -27,12 +24,12 @@ SetName D [XFindShape D link]:2 "Nut instance 1"
SetName D [XFindShape D link]:3 "Nut instance 2" SetName D [XFindShape D link]:3 "Nut instance 2"
# Write IGES file # Write IGES file
catch {exec rm ${imagedir}/bug27447_link.igs} set aTmpFile ${imagedir}/${casename}.igs
WriteIges D ${imagedir}/bug27447_link.igs WriteIges D $aTmpFile
# Processing of IGES file # Processing of IGES file
set is_bug27447_fixed "FALSE" set is_bug27447_fixed "FALSE"
set file_27447 [open ${imagedir}/bug27447_link.igs RDONLY] set file_27447 [open $aTmpFile RDONLY]
while {[eof $file_27447] == 0} { while {[eof $file_27447] == 0} {
set file_27447_line [string trim [gets $file_27447]] set file_27447_line [string trim [gets $file_27447]]
if {[string first "Very long link name" $file_27447_line] != -1} { if {[string first "Very long link name" $file_27447_line] != -1} {
@ -40,6 +37,7 @@ while {[eof $file_27447] == 0} {
} }
} }
close $file_27447 close $file_27447
file delete -force $aTmpFile
# Results validation # Results validation
if {[string compare $is_bug27447_fixed "FALSE"] == 0} { if {[string compare $is_bug27447_fixed "FALSE"] == 0} {

View File

@ -1,18 +1,16 @@
puts "========" puts "========"
puts "OCC27701" puts "OCC27701: C r a s h when export empty solid to STEP"
puts "========" puts "========"
puts "" puts ""
#########################################
# Crash when export empty solid to STEP
#########################################
pload DCAF pload DCAF
catch {exec rm ${imagedir}/bug27701.stp}
restore [locate_data_file bug27701.brep] s restore [locate_data_file bug27701.brep] s
NewDocument D NewDocument D
XAddShape D s XAddShape D s
XSetColor D 0:1:1:1 1 0 0 s XSetColor D 0:1:1:1 1 0 0 s
WriteStep D ${imagedir}/bug27701.stp
set aTmpFile ${imagedir}/${casename}_tmp.stp
WriteStep D $aTmpFile
file delete -force $aTmpFile

View File

@ -1,10 +1,7 @@
puts "========" puts "========"
puts "OCC28044" puts "OCC28044: Implement data structures in OCAF for Saved Views."
puts "========" puts "========"
puts "" puts ""
####################################################
# Implement data structures in OCAF for Saved Views.
####################################################
pload OCAF pload OCAF
@ -35,10 +32,12 @@ XSetViewFrontPlaneDistance D_First 0:1:7:1 10
XSetViewVolumeSidesClipping D_First 0:1:7:1 1 XSetViewVolumeSidesClipping D_First 0:1:7:1 1
set first_view [XDumpView D_First 0:1:7:1] set first_view [XDumpView D_First 0:1:7:1]
# Write file # Write file
SaveAs D_First ${imagedir}/bug28044.xbf set aTmpFile ${imagedir}/${casename}.xbf
SaveAs D_First $aTmpFile
Close D_First Close D_First
# Read document # Read document
XOpen ${imagedir}/bug28044.xbf D_Second XOpen $aTmpFile D_Second
file delete -force $aTmpFile
set second_view [XDumpView D_Second 0:1:7:1] set second_view [XDumpView D_Second 0:1:7:1]
Close D_Second Close D_Second

View File

@ -24,10 +24,12 @@ vdump $::imagedir/${::casename}_first.png
if { [vreadpixel 300 200 rgb name] != "GRAY63" } { puts "Error: wrong color in 3D Viewer" } if { [vreadpixel 300 200 rgb name] != "GRAY63" } { puts "Error: wrong color in 3D Viewer" }
# Write file # Write file
SaveAs D_First ${imagedir}/bug28521.xbf set aTmpFile ${imagedir}/${casename}.xbf
SaveAs D_First $aTmpFile
Close D_First Close D_First
# Read document # Read document
XOpen ${imagedir}/bug28521.xbf D_Second XOpen $aTmpFile D_Second
file delete -force $aTmpFile
# Results validation # Results validation
set isOK 1 set isOK 1

View File

@ -1,10 +1,8 @@
puts "==========" puts "=========="
puts "OCC29338" puts "OCC29338: Add Planes for Tolerance zones in Geometric tolerances"
puts "==========" puts "=========="
puts "" puts ""
#########################################################
# Add Planes for Tolerance zones in Geometric tolerances
#########################################################
pload ALL pload ALL
box b 1 1 1 box b 1 1 1
@ -14,9 +12,10 @@ explode b f
XAddGeomTolerance D b_1 XAddGeomTolerance D b_1
plane p 1 2 3 0 1 0 plane p 1 2 3 0 1 0
XSetGDTAffectedPlane D 0:1:4:1 p 2 XSetGDTAffectedPlane D 0:1:4:1 p 2
SaveAs D ${imagedir}/bug29338.xbf set aTmpFile ${imagedir}/${casename}.xbf
SaveAs D $aTmpFile
Close D Close D
XOpen ${imagedir}/bug29338.xbf DD XOpen $aTmpFile DD
set type [XGetGDTAffectedPlane DD 0:1:4:1 plane] set type [XGetGDTAffectedPlane DD 0:1:4:1 plane]
if {[lindex $type 0] != "orientation"} { if {[lindex $type 0] != "orientation"} {
puts "Error: wrong affected plane type" puts "Error: wrong affected plane type"
@ -43,4 +42,4 @@ if {[lindex $check 23] != 0} {
puts "Error: wrong affected plane" puts "Error: wrong affected plane"
} }
Close DD Close DD
file delete ${imagedir}/bug29338.xbf file delete -force $aTmpFile

View File

@ -1,19 +1,16 @@
puts "=========" puts "========="
puts "OCC533" puts "OCC533: XmlOcaf-Document is not stored in XDEDRAWEXE although stored in TCAF"
puts "=========" puts "========="
puts "" puts ""
####################################################### set aTmpFile ${imagedir}/${casename}.xml
## XmlOcaf-Document is not stored in XDEDRAWEXE although stored in TCAF
#######################################################
file delete ${imagedir}/A.xml
set res 0 set res 0
catch { NewDocument A XmlOcaf } catch { NewDocument A XmlOcaf }
if [catch {SaveAs A ${imagedir}/A.xml}] { if [catch {SaveAs A $aTmpFile}] {
puts "OCC533 FAULTY" puts "OCC533 FAULTY"
} else { } else {
puts "OCC533 OK" puts "OCC533 OK"
} }
file delete -force $aTmpFile

View File

@ -30,7 +30,7 @@ SetInteger Doc ${aLabel} ${aSetAttr1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -30,7 +30,7 @@ SetReal Doc ${aLabel} ${aSetAttr1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile} } catch {SaveAs Doc ${aFile} }
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -35,7 +35,7 @@ SetRealArray Doc ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -35,7 +35,7 @@ SetIntArray Doc ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr1
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -31,7 +31,7 @@ SetName Doc ${aLabel} ${aSetAttr1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -31,7 +31,7 @@ SetComment Doc ${aLabel} ${aSetAttr1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -47,7 +47,7 @@ SetPoint Doc ${aLabel} aPoint1
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -55,7 +55,7 @@ SetAxis Doc ${aLabel} aLine1
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -58,7 +58,7 @@ SetPlane Doc ${aLabel} aPlane1
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -30,7 +30,7 @@ SetUAttribute Doc ${aLabel} ${aSetAttr1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -34,7 +34,7 @@ SetUAttribute Doc ${aLabel} ${aSetAttr2}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -40,7 +40,7 @@ SetShape Doc ${aLabel} aBox1
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -40,7 +40,7 @@ SetReference Doc ${aLabel4} ${aReference1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -46,7 +46,7 @@ SetShape Doc ${aLabel} aBox1
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
#catch {exec chmod 777 ${aFile}} #catch {exec chmod 777 ${aFile}}

View File

@ -40,7 +40,7 @@ AISSet Doc ${aLabel} NS
AISDisplay Doc ${aLabel} AISDisplay Doc ${aLabel}
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -54,7 +54,7 @@ CopyWithLink Doc1 ${aLabel2} Doc1 ${aLabel1}
NewCommand Doc1 NewCommand Doc1
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc1 ${aFile}} catch {SaveAs Doc1 ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -37,7 +37,7 @@ SetName Doc ${aChild1} ${aName11}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -30,7 +30,7 @@ SetName Doc ${aLabel1} ${aName1}
NewCommand Doc NewCommand Doc
# Save the document # Save the document
set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile} file delete ${aFile}
catch {SaveAs Doc ${aFile}} catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -14,7 +14,7 @@ AISSet D1 0:1 NS
AISDisplay D1 0:1 AISDisplay D1 0:1
AISMode D1 0:1 1 AISMode D1 0:1 1
set aFile ${imagedir}/testmode.xml set aFile ${imagedir}/${casename}.xml
file delete ${aFile} file delete ${aFile}
SaveAs D1 ${aFile} SaveAs D1 ${aFile}
if { ![file exists ${aFile}] } { if { ![file exists ${aFile}] } {

View File

@ -19,7 +19,7 @@ box b 1 1 1
SetShape Doc 0:1 b SetShape Doc 0:1 b
# SaveAs # SaveAs
set output [SaveAs Doc ${imagedir}/testA1.cbf] set output [SaveAs Doc ${imagedir}/${casename}_tmp.cbf]
# Close the document # Close the document
Close Doc Close Doc

View File

@ -20,7 +20,7 @@ box b 1 1 1
SetShape Doc 0:1 b SetShape Doc 0:1 b
# SaveAs # SaveAs
set output [SaveAs Doc ${imagedir}/testA2.xml] set output [SaveAs Doc ${imagedir}/${casename}_tmp.xml]
# Close the document # Close the document
Close Doc Close Doc

View File

@ -39,8 +39,8 @@ NewShape D ${lab7} shape7
NewShape D ${lab8} shape8 NewShape D ${lab8} shape8
# Save document # Save document
file delete -force ${imagedir}/2793.cbf
dchrono h restart dchrono h restart
SaveAs D ${imagedir}/2793.cbf SaveAs D ${imagedir}/${casename}.cbf
dchrono h stop counter SaveAs dchrono h stop counter SaveAs
Close D Close D
file delete -force ${imagedir}/${casename}.cbf

View File

@ -16,9 +16,12 @@ XNewDoc D
XAddShape D co XAddShape D co
puts "Writing STEP model" puts "Writing STEP model"
WriteStep D . set aTmpFile ${imagedir}/${casename}_tmp.stp
WriteStep D $aTmpFile
Close D Close D
puts "Destructing model" puts "Destructing model"
#crash #crash
newmodel newmodel
file delete -force $aTmpFile

View File

@ -19,6 +19,8 @@ set nz 10
if [info exists D] {Close D} if [info exists D] {Close D}
if [info exists D1] {Close D1} if [info exists D1] {Close D1}
set aTmpFile ${imagedir}/${casename}_tmp.stp
for {set npass 1} {$npass <= 2} {incr npass} { for {set npass 1} {$npass <= 2} {incr npass} {
set nx [expr $nx0 * $npass] set nx [expr $nx0 * $npass]
@ -64,13 +66,13 @@ for {set npass 1} {$npass <= 2} {incr npass} {
puts "Writing STEP model" puts "Writing STEP model"
chrono cr1 restart chrono cr1 restart
WriteStep D . WriteStep D $aTmpFile
chrono cr1 stop chrono cr1 stop
Close D Close D
puts "Reading STEP model" puts "Reading STEP model"
chrono cr2 restart chrono cr2 restart
ReadStep D1 . ReadStep D1 $aTmpFile
chrono cr2 stop chrono cr2 stop
# check one solid with different locations # check one solid with different locations
@ -93,6 +95,7 @@ for {set npass 1} {$npass <= 2} {incr npass} {
set time_write_$npass [lindex [dchrono cr1 counter "WriteStep_$npass"] end] set time_write_$npass [lindex [dchrono cr1 counter "WriteStep_$npass"] end]
set time_read_$npass [lindex [dchrono cr2 counter "ReadStep_$npass"] end] set time_read_$npass [lindex [dchrono cr2 counter "ReadStep_$npass"] end]
file delete -force $aTmpFile
} }
puts "time_write_1=$time_write_1" puts "time_write_1=$time_write_1"