File: C3

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 (74 lines) | stat: -rw-r--r-- 1,619 bytes parent folder | download | duplicates (6)
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
#INTERFACE CAF
# Basic attributes
#
# Testing attribute: TDataStd_RealArray
#
# Testing command:   SetRealArray
# Testing command:   GetRealArray
#

puts "caf001-C3"
set QA_DUP 0

# 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
SetRealArray D ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12}

# Close/Open the transaction
NewCommand D

# Save the document
set aFile ${imagedir}/caf001-C3.std
file delete ${aFile}
SaveAs D ${aFile}
if { ![file exists ${aFile}] } {
	puts "There is not ${aFile} file; SaveAs command: Error"
	return
}
#catch {exec chmod 777 ${aFile}}

# Restore the document
Close D
Open ${aFile} DD

# Get a value of the attribute
set IsGood 1
set aMessage3 "Get a value of TDataStd_RealArray attribute from restoring document: Error"
set IsDone [catch {set aGetAttr3 [GetRealArray DD ${aLabel}]} aResult]
if { ${IsDone} != 0 } {
   set IsGood 0
	puts ${aMessage3}
###	return
}
set aLen3 [llength ${aGetAttr3}]
if { ${aLen3} != [expr ${aTo1} - ${aFrom1} + 1] } {
   set IsGood 0
	puts "aLen3=${aLen3}"
	puts ${aMessage3}
###	return
}
set aGetAttr41 [lindex ${aGetAttr3} 0]
if { ${aSetAttr11} != ${aGetAttr41} } {
   set IsGood 0
	puts "aGetAttr41=${aGetAttr41}"
	puts ${aMessage3}
###	return
}
set aGetAttr42 [lindex ${aGetAttr3} 1]
if { ${aSetAttr12} != ${aGetAttr42} } {
   set IsGood 0
	puts "aGetAttr42=${aGetAttr42}"
	puts ${aMessage3}
###	return
}

if { ${IsGood} == 0} {
  puts "Get a value of TDataStd_RealArray attribute: Error"
} else {
  puts "Get a value of TDataStd_RealArray attribute: OK"
}