author | Claus Gittinger <cg@exept.de> |
Thu, 09 Jun 2016 12:32:55 +0200 | |
changeset 1436 | 6d0ae1c7a22b |
parent 1252 | 5bc6d5729453 |
child 1447 | 2351db93aa5b |
child 1499 | 26a16a04219b |
permissions | -rw-r--r-- |
216 | 1 |
"{ Package: 'exept:regression' }" |
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:] |
|
19 |
Michael Beyl (mb@bart) |
|
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 |
|
1252
5bc6d5729453
class: RegressionTests::MemoryTest
Claus Gittinger <cg@exept.de>
parents:
1159
diff
changeset
|
37 |
"cg: whoever wrote this test: |
5bc6d5729453
class: RegressionTests::MemoryTest
Claus Gittinger <cg@exept.de>
parents:
1159
diff
changeset
|
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 | |
|
52 |
y addNode: (z := XML::Element tag: 'y'). |
|
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') |
|
59 |
value: ((el valueOfAttribute:'a' ifAbsent:[]) asNumber * 10 / 3 ) asString] |
|
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 |