0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / caf / basic / Y1
1 #INTERFACE CAF
2 # Persistence functionality
3 #
4 # Testing feature: Saving empty labels (BinOcaf format)
5 #
6 # Testing command:   SaveAs, Open
7 #
8
9 puts "caf001-Y1"
10 set QA_DUP 0
11
12 set Lab1 [Label D 0:1:1]
13 set Lab2 [Label D 0:1:2]
14 set Lab3 [Label D 0:1:3]
15 ## set List1 {0:1:1 0:1:2 0:1:3}
16 ## set List2 {0:1:2}
17
18 set aFile1 ${imagedir}/caf001-y1-1.cbf
19 set aFile2 ${imagedir}/caf001-y1-2.cbf
20
21 #1. Open a new Document in BinOcaf format
22 # NewDocument D BinOcaf
23
24 #2. Put integer attribute at the label Lab2
25 SetInteger D $Lab2 321
26 SetReal D $Lab2 871.33
27
28 #3. Save the Document with flag saveEmptyLabels = 1 
29 catch {SaveAs D ${aFile1} 1}
30 if { ![file exists ${aFile1}] } {
31         puts "There is not ${aFile} file; SaveAs command: Error writing binary file"
32         puts "Save ERROR"
33         return
34 }
35
36 #4. Save the Document with flag saveEmptyLabels = 0 
37 catch {SaveAs D ${aFile2} 0}
38 if { ![file exists ${aFile2}] } {
39         puts "There is not ${aFile} file; SaveAs command: Error writing binary file"
40         puts "Save ERROR"
41         return
42 }
43
44 #5. Open the just saved binary files
45 Close D
46 catch {Open ${aFile1} D1}
47 catch {Open ${aFile2} D2}
48
49
50 #5. Get list of child labels of main label (0:1)
51 set List1 [Children D1 0:1]
52 set List2 [Children D2 0:1]
53
54 #6. Check length of the list of labels in aFile1 (to be len == 3)
55 set len1 [llength ${List1}]
56 if {$len1 != 3} {
57   puts "ERROR: Incorrect number of saved labels in cbf file, n = $len1"
58   return
59 }
60
61 #7. Check length of the list of labels in aFile2 (to be len == 1)
62 set len2 [llength ${List2}]
63 if {$len2 != 1} {
64   puts "ERROR: Incorrect number of saved labels in cbf file, n = $len2"
65   return
66 }
67
68 file delete ${aFile1}
69 file delete ${aFile2}
70 Close D1
71 Close D2
72
73 puts "Saving empty labels: OK"
74
75
76
77
78