2 puts "0031839: Application Framework - Add ability to partially load OCAF document"
5 # This test checks partial opening of the document with integer and real attributes
6 # and then partial appending (reading into the same document).
11 # number of labels of objects in the document
13 # number of sub-labels of each object
18 # store at each object-label sub-labels with two attributes at each
19 set creation_time [lindex [time {
20 for {set i 1} {$i <= $labs} {incr i} {
21 set lab [Label D0 0:1:${i}]
22 SetName D0 ${lab} Object$i
23 for {set ii 1} {$ii <= $sublabs} {incr ii} {
24 set sublab [Label D0 ${lab}:$ii]
25 SetInteger D0 ${sublab} 10
26 SetReal D0 ${sublab} 12.3
31 set commit_time [lindex [time {
36 puts "Tree creation time $creation_time mcs"
37 puts "Creation commit time $commit_time mcs"
39 set docname ${imagedir}/doc_${casename}.cbf
43 set open_time [lindex [time {
47 puts "Full document open time $open_time mcs"
49 set attributes [Attributes D1 0:1:1:1]
50 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] < 0} {
51 puts "Error: full document is opened incorrectly"
56 set open_noint_time [lindex [time {
57 Open ${docname} D2 -skipTDataStd_Integer
60 puts "Document without integers open time $open_noint_time mcs"
62 set attributes [Attributes D2 0:1:1:1]
63 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] >= 0} {
64 puts "Error: document open without integers contains wrong attributes"
67 set open_oneint_time [lindex [time {
68 Open ${docname} D2 -append -read0:1:1:1
71 puts "Read of one integer time $open_oneint_time mcs"
73 set attributes [Attributes D2 0:1:1:1]
74 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] < 0} {
75 puts "Error: document open with one integer contains wrong attributes"
78 set attributes [Attributes D2 0:1:1:10]
79 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] >= 0} {
80 puts "Error: document open with one integer contains wrong attributes at label 10"
83 set open_nineint_time [lindex [time {
84 Open ${docname} D2 -append -read0:1:1
86 puts "Read of nine integer time $open_nineint_time mcs"
88 set attributes [Attributes D2 0:1:1:10]
89 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] < 0} {
90 puts "Error: document open with nine integer contains wrong attributes at label 10"
93 set attributes [Attributes D2 0:1:1:5]
94 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] < 0} {
95 puts "Error: document open with nine integer contains wrong attributes at label 5"
98 set attributes [Attributes D2 0:1:2:5]
99 if {[lsearch $attributes TDataStd_Real] < 0 || [lsearch $attributes TDataStd_Integer] >= 0} {
100 puts "Error: document open with nine integer contains wrong attributes at the second object"
103 SetInteger D2 0:1:1:5 21
104 SetReal D2 0:1:1:7 32.1
106 set open_overwrite_time [lindex [time {
107 Open ${docname} D2 -overwrite -read0:1:1
109 puts "Overwrite of ten integers time $open_overwrite_time mcs"
112 set value [GetInteger D2 0:1:1:5]
114 puts "Error: integer is overwritten incorrectly"
117 set value [GetReal D2 0:1:1:7]
118 if {$value != 12.3} {
119 puts "Error: real is overwritten incorrectly"
122 SetInteger D2 0:1:1:5 21
123 SetReal D2 0:1:1:7 32.1
125 set open_append_time [lindex [time {
126 Open ${docname} D2 -append -read0:1:1
128 puts "Append of ten integers time $open_overwrite_time mcs"
131 set value [GetInteger D2 0:1:1:5]
133 puts "Error: integer is overwritten by append"
136 set value [GetReal D2 0:1:1:7]
137 if {$value != 32.1} {
138 puts "Error: real is overwritten by append"