0024927: Getting rid of "Persistent" functionality -- Tests
[occt.git] / tests / caf / basic / A3
CommitLineData
40093367 1#INTERFACE CAF
2# Basic attributes
3#
4# Testing attribute: TDataStd_Integer
5#
6# Testing command: SetInteger
7# Testing command: GetInteger
8#
9
10puts "caf001-A3"
11
12# Add an attribute to a data framework
13set aSetAttr1 100
14set aLabel 0:2
15SetInteger D ${aLabel} ${aSetAttr1}
16
17# Close/Open the transaction
18NewCommand D
19
20# Save the document
e837410d 21set aFile ${imagedir}/caf001-A3.cbf
40093367 22file delete ${aFile}
23SaveAs D ${aFile}
24if { ![file exists ${aFile}] } {
25 puts "There is not ${aFile} file; SaveAs command: Error"
26 return
27}
28#catch {exec chmod 777 ${aFile}}
29
30# Restore the document
31Close D
32Open ${aFile} DD
33
34# Get a value of the attribute
35set IsDone [catch {set aGetAttr3 [GetInteger DD ${aLabel}]} aResult]
36if { ${IsDone} != 0 ||
37 ${aSetAttr1}!=${aGetAttr3} } {
38 puts ${aResult}
39 puts "aSetAttr1=${aSetAttr1} aGetAttr3=${aGetAttr3}"
40 puts "Get a value of TDataStd_Integer attribute from restoring document: Error"
41 return
42}
43puts "Get a value of TDataStd_Integer attribute from restoring document: OK"