40093367 |
1 | #INTERFACE CAF |
2 | puts "================" |
3 | puts "OCC1228" |
4 | puts "================" |
5 | puts "" |
6 | |
7 | # Basic attributes |
8 | # |
9 | # Testing attribute: TDataStd_Comment |
10 | # |
11 | # Testing command: SetComment |
12 | # Testing command: GetComment |
13 | # |
14 | |
15 | # ANALOG: puts "caf001-F3" |
16 | |
17 | # Create a new document and set UndoLimit |
18 | NewDocument Doc BinOcaf |
19 | UndoLimit Doc 100 |
20 | |
21 | # Open a transaction |
22 | NewCommand Doc |
23 | |
24 | # Add an attribute to a data framework |
25 | set aSetAttr1 "New Attribute" |
26 | set aLabel 0:2 |
27 | Label Doc ${aLabel} |
28 | SetComment Doc ${aLabel} ${aSetAttr1} |
29 | |
30 | # Close/Open the transaction |
31 | NewCommand Doc |
32 | |
33 | # Save the document |
8418c617 |
34 | set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf |
40093367 |
35 | file delete ${aFile} |
36 | catch {SaveAs Doc ${aFile}} |
37 | if { ![file exists ${aFile}] } { |
38 | puts "There is not ${aFile} file; SaveAs command: Error" |
39 | } |
40 | #catch {exec chmod 777 ${aFile}} |
41 | |
42 | # Restore the document |
43 | Close Doc |
44 | catch {Open ${aFile} DDoc} |
45 | |
46 | # Get a value of the attribute |
47 | set aGetAttr3 "" |
48 | set IsDone [catch {set aGetAttr3 [GetComment DDoc ${aLabel}]} aResult] |
49 | if { ${IsDone} != 0 || |
50 | ${aSetAttr1}!=${aGetAttr3} } { |
51 | puts ${aResult} |
52 | puts "aSetAttr1=${aSetAttr1} aGetAttr3=${aGetAttr3}" |
53 | puts "Get a value of TDataStd_Comment attribute from restoring document: Error" |
54 | puts "OCC1228: ERROR (case 2)" |
55 | } else { |
56 | puts "Get a value of TDataStd_Comment attribute from restoring document: OK" |
57 | puts "OCC1228: OK" |
58 | } |