File: C2

package info (click to toggle)
oce 0.17.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 297,992 kB
  • ctags: 203,291
  • sloc: cpp: 1,176,369; ansic: 67,206; sh: 11,647; tcl: 6,890; cs: 5,221; python: 2,867; java: 1,522; makefile: 338; xml: 292; perl: 37
file content (82 lines) | stat: -rw-r--r-- 2,109 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#INTERFACE CAF
puts "================"
puts "OCC6493"
puts "================"
puts ""
######################################################
# No binary persistence for TDataStd_ExtStringArray attribute
######################################################

# Basic attributes
#
# Testing attribute: TDataStd_ExtStringArray
#
# Testing command:   SetExtStringArray
# Testing command:   GetExtStringArray
#

# ANALOG: puts "caf001-M3"
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 "TDataStd"
set aSetAttr12 "ExtStringArray"
set aLabel 0:2
set isDelta 0
SetExtStringArray Doc ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}

# Close/Open the transaction
NewCommand Doc

# Save the document
set aFile ${imagedir}/OCC6493-[file tail [info script]].cbf
file delete ${aFile}
catch {SaveAs Doc ${aFile}}
if { ![file exists ${aFile}] } {
	puts "There is not ${aFile} file; SaveAs command: Error"
	puts "OCC6493: 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_ExtStringArray attribute from restoring document: Error"
set IsDone [catch {set aGetAttr3 [GetExtStringArray DDoc ${aLabel}]} aResult]
if { ${IsDone} != 0 } {
	puts ${aMessage3}
	puts "OCC6493: ERROR (case 2)"
}
set aLen3 [llength ${aGetAttr3}]
if { ${aLen3} != [expr ${aTo1} - ${aFrom1} + 1] } {
	puts "aLen3=${aLen3}"
	puts ${aMessage3}
	puts "OCC6493: ERROR (case 3)"
}
set aGetAttr41 [lindex ${aGetAttr3} 0]
if { ${aSetAttr11} != ${aGetAttr41} } {
	puts "aGetAttr41=${aGetAttr41}"
	puts ${aMessage3}
	puts "OCC6493: ERROR (case 4)"
}
set aGetAttr42 [lindex ${aGetAttr3} 1]
if { ${aSetAttr12} != ${aGetAttr42} } {
	puts "aGetAttr42=${aGetAttr42}"
	puts ${aMessage3}
	puts "OCC6493: ERROR (case 5)"
} else {
	puts "Get a value of TDataStd_ExtStringArray attribute from restoring document: OK"
	puts "OCC6493: OK"
}