0024223: Review of unstable test cases
[occt.git] / tests / xml / data / ocaf / A7
1 set aTestName "caf001-G3"
2 puts ${aTestName}
3
4 set aTokList { :,}
5
6 # Add an attribute to a data framework
7 set aSetX1 10
8 set aSetY1 20
9 set aSetZ1 30
10 point aPoint1 ${aSetX1} ${aSetY1} ${aSetZ1}
11
12 set aDumpPoint1 [dump aPoint1]
13
14 regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} ${aDumpPoint1} full X_Point1 Y_Point1 Z_Point1
15
16 set aLabel 0:2
17 SetPoint D ${aLabel} aPoint1
18
19 # Close/Open the transaction
20 NewCommand D
21
22 # Save the document
23 set aFile $WorkDirectory/${aTestName}.${FileSuffix}
24
25 SaveToFile D $aFile
26
27 # Restore the document
28 Close D
29 Open ${aFile} DD
30
31 # Get a value of the attribute
32 set IsDone [catch {set aGetAttr3 [GetPoint DD ${aLabel}]} aResult]
33 if { ${IsDone} != 0 } {
34         puts "Error : Get a value of TDataStd_Point attribute from restoring document"
35 } else {
36     GetPoint DD ${aLabel} aPoint5
37
38     set aDumpPoint5 [dump aPoint5]
39     regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} ${aDumpPoint5} full X_Point5 Y_Point5 Z_Point5
40
41     if { ${X_Point1} != ${X_Point5} || 
42      ${Y_Point1} != ${Y_Point5} || 
43      ${Z_Point1} != ${Z_Point5} } {
44         puts "X_Point1=${X_Point1} X_Point5=${X_Point5}"
45         puts "Y_Point1=${Y_Point1} Y_Point5=${Y_Point5}"
46         puts "Z_Point1=${Z_Point1} Z_Point5=${Z_Point5}"
47         puts "Error : Get a value of TDataStd_Point attribute from restoring document"
48     }
49 }