1447
|
1 |
"{ Package: 'stx:goodies/regression' }"
|
216
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#MemoryTest
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
1159
|
9 |
category:'tests-Regression-RuntimeSystem'
|
216
|
10 |
!
|
|
11 |
|
|
12 |
!MemoryTest class methodsFor:'documentation'!
|
|
13 |
|
|
14 |
documentation
|
|
15 |
"
|
|
16 |
documentation to be added.
|
|
17 |
|
|
18 |
[author:]
|
1447
|
19 |
Michael Beyl (mb@bart)
|
216
|
20 |
|
|
21 |
[instance variables:]
|
|
22 |
|
|
23 |
[class variables:]
|
|
24 |
|
|
25 |
[see also:]
|
|
26 |
|
|
27 |
"
|
|
28 |
!
|
|
29 |
|
|
30 |
history
|
|
31 |
"Created: / 14.10.2003 / 17:53:03 / mb"
|
|
32 |
! !
|
|
33 |
|
|
34 |
!MemoryTest methodsFor:'tests'!
|
|
35 |
|
|
36 |
test1
|
1447
|
37 |
"cg: whoever wrote this test:
|
|
38 |
please add some comment on what is actually tested"
|
216
|
39 |
|
|
40 |
|x y z|
|
|
41 |
1 to: 100 do: [:rep|
|
|
42 |
x := XML::Element tag:'x'.
|
|
43 |
ObjectMemory garbageCollect.
|
|
44 |
|
|
45 |
x attributes: (Array with: (XML::Attribute name: 'a' value: '1')
|
|
46 |
with: (XML::Attribute name: 'a' value: '1')).
|
|
47 |
1 to: 500 do: [:i |
|
|
48 |
x addNode: (y := XML::Element tag: 'y').
|
|
49 |
y attributes: (Array with: (XML::Attribute name: 'a' value: '1')
|
|
50 |
with: (XML::Attribute name: 'a' value: '1')).
|
|
51 |
1 to: 1000 do: [:j |
|
1447
|
52 |
y addNode: (z := XML::Element tag: 'y').
|
216
|
53 |
z attributes: (Array with: (XML::Attribute name: 'a' value: '1')
|
|
54 |
with: (XML::Attribute name: 'a' value: '1')).]].
|
|
55 |
ObjectMemory garbageCollect.
|
|
56 |
x nodesDo: [:el |
|
|
57 |
(el isKindOf: XML::Element)
|
|
58 |
ifTrue: [(el attributeNamed:'a')
|
1447
|
59 |
value: ((el valueOfAttribute:'a' ifAbsent:[]) asNumber * 10 / 3 ) asString]
|
216
|
60 |
].
|
|
61 |
]
|
|
62 |
|
|
63 |
"
|
|
64 |
self run:#test1
|
|
65 |
self new test1
|
|
66 |
"
|
|
67 |
! !
|
|
68 |
|
|
69 |
!MemoryTest class methodsFor:'documentation'!
|
|
70 |
|
|
71 |
version
|
|
72 |
^ '$Header$'
|
|
73 |
! !
|
1159
|
74 |
|