1984
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
1447
|
3 |
"{ Package: 'stx:goodies/regression' }"
|
216
|
4 |
|
|
5 |
"{ NameSpace: RegressionTests }"
|
|
6 |
|
|
7 |
TestCase subclass:#MemoryTest
|
|
8 |
instanceVariableNames:''
|
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
1159
|
11 |
category:'tests-Regression-RuntimeSystem'
|
216
|
12 |
!
|
|
13 |
|
|
14 |
!MemoryTest class methodsFor:'documentation'!
|
|
15 |
|
|
16 |
documentation
|
|
17 |
"
|
|
18 |
documentation to be added.
|
|
19 |
|
|
20 |
[author:]
|
1447
|
21 |
Michael Beyl (mb@bart)
|
216
|
22 |
|
|
23 |
[instance variables:]
|
|
24 |
|
|
25 |
[class variables:]
|
|
26 |
|
|
27 |
[see also:]
|
|
28 |
|
|
29 |
"
|
|
30 |
!
|
|
31 |
|
|
32 |
history
|
|
33 |
"Created: / 14.10.2003 / 17:53:03 / mb"
|
|
34 |
! !
|
|
35 |
|
1663
|
36 |
!MemoryTest methodsFor:'initialize / release'!
|
|
37 |
|
|
38 |
setUp
|
|
39 |
"common setup - invoked before testing."
|
|
40 |
|
|
41 |
(Smalltalk classNamed:'stx_goodies_xml_vw') isNil ifTrue:[
|
|
42 |
(Smalltalk loadPackage:'stx:goodies/xml/vw') ifFalse:[
|
|
43 |
self error:'stx:goodies/xml/vw cannot be loaded'.
|
|
44 |
].
|
|
45 |
].
|
|
46 |
(Smalltalk classNamed:'stx_goodies_xml_vw') load.
|
|
47 |
|
|
48 |
"Created: / 31-07-2017 / 15:12:57 / mawalch"
|
|
49 |
! !
|
|
50 |
|
216
|
51 |
!MemoryTest methodsFor:'tests'!
|
|
52 |
|
|
53 |
test1
|
1447
|
54 |
"cg: whoever wrote this test:
|
1984
|
55 |
please add some comment on what is actually tested"
|
|
56 |
|
2071
|
57 |
|x y z n1 n2|
|
216
|
58 |
|
2071
|
59 |
n1 := 10.
|
|
60 |
n2 := 500.
|
|
61 |
"/ allocates n1*n2*1000 (5mio) nodes with n1*n2*2000 (10mio) attributes...
|
|
62 |
|
|
63 |
n2 := 50.
|
1984
|
64 |
1 to:10 do:[:rep |
|
|
65 |
x := XML::Element tag:'x'.
|
|
66 |
ObjectMemory garbageCollect.
|
|
67 |
x attributes:(Array with:(XML::Attribute name:'a' value:'1')
|
|
68 |
with:(XML::Attribute name:'a' value:'1')).
|
|
69 |
1 to:500 do:[:i |
|
|
70 |
x addNode:(y := XML::Element tag:'y').
|
|
71 |
y attributes:(Array with:(XML::Attribute name:'a' value:'1')
|
|
72 |
with:(XML::Attribute name:'a' value:'1')).
|
|
73 |
1 to:1000 do:[:j |
|
|
74 |
y addNode:(z := XML::Element tag:'y').
|
|
75 |
z attributes:(Array with:(XML::Attribute name:'a' value:'1')
|
|
76 |
with:(XML::Attribute name:'a' value:'1')).
|
|
77 |
]
|
|
78 |
].
|
|
79 |
ObjectMemory garbageCollect.
|
|
80 |
x
|
|
81 |
nodesDo:[:el |
|
|
82 |
(el isKindOf:XML::Element) ifTrue:[
|
|
83 |
(el attributeNamed:'a')
|
|
84 |
value:((el valueOfAttribute:'a' ifAbsent:[]) asNumber * (10/3)) asString
|
|
85 |
]
|
|
86 |
].
|
216
|
87 |
]
|
|
88 |
|
|
89 |
"
|
|
90 |
self run:#test1
|
1984
|
91 |
self new test1"
|
|
92 |
|
2071
|
93 |
"Modified: / 19-12-2018 / 17:05:45 / Claus Gittinger"
|
216
|
94 |
! !
|
|
95 |
|
|
96 |
!MemoryTest class methodsFor:'documentation'!
|
|
97 |
|
|
98 |
version
|
|
99 |
^ '$Header$'
|
2072
|
100 |
!
|
|
101 |
|
|
102 |
version_CVS
|
|
103 |
^ '$Header$'
|
216
|
104 |
! !
|
1159
|
105 |
|