0027691: Remove dchrono from all test cases and move its to perf group
[occt.git] / tests / bugs / caf / bug26229_1
CommitLineData
4ff92abe 1puts "================"
2puts "OCC26229"
3puts "================"
4puts ""
5###################################################################################################
6# Add the possibility in OCAF to open/save a document from/to a stream object (BinOcaf format)
7###################################################################################################
8
9pload DCAF
10
11NewDocument D BinOcaf
12
13# Add an attribute to a data framework
14set aSetAttr1 100
15set aLabel 0:2
16SetInteger D ${aLabel} ${aSetAttr1}
17
18# Close/Open the transaction
19NewCommand D
20
21# Save the document
22set aFile ${imagedir}/${casename}.cbf
23file delete ${aFile}
24SaveAs D ${aFile} -stream
25if { ![file exists ${aFile}] } {
26 puts "Error: there is not ${aFile} file; SaveAs command"
27 return
28}
29
30
31# Restore the document
32Close D
33Open ${aFile} DD -stream
34
35# Get a value of the attribute
36set IsDone [catch {set aGetAttr3 [GetInteger DD ${aLabel}]} aResult]
37if { ${IsDone} != 0 ||
38 ${aSetAttr1}!=${aGetAttr3} } {
39 puts ${aResult}
40 puts "aSetAttr1=${aSetAttr1} aGetAttr3=${aGetAttr3}"
41 puts "Error: get a value of TDataStd_Integer attribute from Streamed restoring document"
42} else {
43 puts "Get a value of TDataStd_Integer attribute from Streamed restoring document: OK"
44}