0028446: Could not retrieve just kept document with Integer attribute
[occt.git] / tests / caf / basic / E7
CommitLineData
69f1a899 1#INTERFACE CAF
2# Basic attributes
3#
4# Testing attribute: User defined (additional GUID) TDataStd_Name
5#
6# Testing command: SetName
7# Testing command: GetName
8#
9
10puts "caf001-E6"
11
12# Add an attribute to a data framework
13set aSetAttr1 "New Attribute_1"
14set aSetAttr2 "New Attribute_2"
15set aGuid2 "12e94562-6dbc-11d4-b9c8-0060b0ee281b"
16set aLabel 0:2
17SetName D ${aLabel} ${aSetAttr1}
18SetName D ${aLabel} ${aSetAttr2} ${aGuid2}
19
20# Close/Open the transaction
21NewCommand D
22
23# Save the document
24set aFile ${imagedir}/caf001-E7.cbf
25file delete ${aFile}
26SaveAs D ${aFile}
27if { ![file exists ${aFile}] } {
28 puts "There is not ${aFile} file; SaveAs command: Error"
29 return
30}
31#catch {exec chmod 777 ${aFile}}
32
33# Restore the document
34Close D
35Open ${aFile} DD
36
37# Get a value of the attribute #1
38set IsDone [catch {set aGetAttr3 [GetName DD ${aLabel}]} aResult]
39if { ${IsDone} != 0 ||
40 ${aSetAttr1}!=${aGetAttr3} } {
41 puts ${aResult}
42 puts "aSetAttr1=${aSetAttr1} aGetAttr3=${aGetAttr3}"
43 puts "Get a value of the first TDataStd_Name attribute from restoring document: Error"
44 return
45}
46
47# Get a value of the attribute #2
48set IsDone [catch {set aGetAttr4 [GetName DD ${aLabel} ${aGuid2}]} aResult]
49if { ${IsDone} != 0 ||
50 ${aSetAttr2}!=${aGetAttr4} } {
51 puts ${aResult}
52 puts "aSetAttr2=${aSetAttr2} aGetAttr4=${aGetAttr4}"
53 puts "Get a value of the second TDataStd_Name attribute from restoring document: Error"
54 return
55}
56
57puts "Get a value of user defined TDataStd_Name attributes from restoring document: OK"