1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
kgv 30fa5f6713 0032705: Test - name clashes within temporary files within bugs/caf/bug23766_X
Several test cases writing temporary files have been corrected.
2021-12-02 21:14:57 +03:00

80 lines
1.8 KiB
Plaintext
Executable File

#INTERFACE CAF
puts "================"
puts "OCC1228"
puts "================"
puts ""
# Basic attributes
#
# Testing attribute: TDataStd_IntegerArray
#
# Testing command: SetIntArray
# Testing command: GetIntArray
#
# ANALOG: puts "caf001-D3"
set QA_DUP 0
# Create a new document and set UndoLimit
NewDocument Doc BinOcaf
UndoLimit Doc 100
# Open a transaction
NewCommand Doc
# Add an attribute to a data framework
set aFrom1 1
set aTo1 2
set aSetAttr11 3
set aSetAttr12 4
set aLabel 0:2
set isDelta 0
SetIntArray Doc ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}
# Close/Open the transaction
NewCommand Doc
# Save the document
set aFile ${imagedir}/OCC1228-${casename}.cbf
file delete ${aFile}
catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } {
puts "There is not ${aFile} file; SaveAs command: Error"
puts "OCC1228: ERROR (case 1)"
}
#catch {exec chmod 777 ${aFile}}
# Restore the document
Close Doc
catch {Open ${aFile} DDoc}
# Get a value of the attribute
set aGetAttr3 ""
set aMessage3 "Get a value of TDataStd_IntegerArray attribute from restoring document: Error"
set IsDone [catch {set aGetAttr3 [GetIntArray DDoc ${aLabel}]} aResult]
if { ${IsDone} != 0 } {
puts ${aMessage3}
puts "OCC1228: ERROR (case 2)"
}
set aLen3 [llength ${aGetAttr3}]
if { ${aLen3} != [expr ${aTo1} - ${aFrom1} + 1] } {
puts "aLen3=${aLen3}"
puts ${aMessage3}
puts "OCC1228: ERROR (case 3)"
}
set aGetAttr41 [lindex ${aGetAttr3} 0]
if { ${aSetAttr11} != ${aGetAttr41} } {
puts "aGetAttr41=${aGetAttr41}"
puts ${aMessage3}
puts "OCC1228: ERROR (case 4)"
}
set aGetAttr42 [lindex ${aGetAttr3} 1]
if { ${aSetAttr12} != ${aGetAttr42} } {
puts "aGetAttr42=${aGetAttr42}"
puts ${aMessage3}
puts "OCC1228: ERROR (case 5)"
} else {
puts "Get a value of TDataStd_IntegerArray attribute from restoring document: OK"
puts "OCC1228: OK"
}