0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / bugs / caf / bug31770_1
CommitLineData
74fdb82c 1puts "==========="
2puts "0031770: To add tests of Abort command to 31748"
3puts "==========="
4
5NewDocument D
6UndoLimit D 10
7
8# number of labels of objects in the document
9set labs 100000
10# number of sub-labels of each object
11set sublabs 10
12
13NewCommand D
14
15# store at each object-label sub-labels with two attributes at each
16set creation_time [lindex [time {
17 for {set i 1} {$i <= $labs} {incr i} {
18 set lab [Label D 0:1:${i}]
19 SetName D ${lab} Object$i
20 for {set ii 1} {$ii <= $sublabs} {incr ii} {
21 set sublab [Label D ${lab}:$ii]
22 SetInteger D ${sublab} 10
23 SetReal D ${sublab} 12.3
24 }
25 }
26}] 0]
27
28set commit_time [lindex [time {
29 CommitCommand D
30}] 0]
31
32# modify only one object one attribute
33NewCommand D
34set one_modif_time [lindex [time {
35 SetInteger D 0:1:[expr $labs/2]:[expr $sublabs/2] 20
36}] 0]
37
38set one_abort_time [lindex [time {
39 AbortCommand D
40}] 0]
41
42puts "Tree creation time $creation_time mcs"
43puts "Creation commit time $commit_time mcs"
44puts "One attribute modification time $one_modif_time mcs"
45puts "Abort of single modification time $one_abort_time mcs"
46
47if {$creation_time > $commit_time} {
48 set max_creation $creation_time
49} else {
50 set max_creation $commit_time
51}
52
53# Check that creation time (or commit) is at least 1000 times slower than abort of one modification (normally 4000).
54# Before the optimization it was only 150 times slower.
55if { [expr $max_creation/1000.] < $one_abort_time } {
56 puts "Error : one modification time abort is too big relatively to the whole document creation or commit"
57}