RegressionTests__MemoryTest.st
author Claus Gittinger <cg@exept.de>
Mon, 24 Sep 2018 21:18:18 +0200
changeset 2012 b5fd457e110a
parent 1984 e4e870c69bf6
child 2071 a9413374d9ff
permissions -rw-r--r--
initial checkin class: RegressionTests::XPathTests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1984
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
     1
"{ Encoding: utf8 }"
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
     2
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
     3
"{ Package: 'stx:goodies/regression' }"
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
     4
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
     5
"{ NameSpace: RegressionTests }"
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
     6
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
     7
TestCase subclass:#MemoryTest
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
     8
	instanceVariableNames:''
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
     9
	classVariableNames:''
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    10
	poolDictionaries:''
1159
7f386090c1c4 category changes
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    11
	category:'tests-Regression-RuntimeSystem'
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    12
!
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    13
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    14
!MemoryTest class methodsFor:'documentation'!
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    15
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    16
documentation
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    17
"
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    18
    documentation to be added.
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    19
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    20
    [author:]
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
    21
	Michael Beyl (mb@bart)
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    22
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    23
    [instance variables:]
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    24
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    25
    [class variables:]
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    26
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    27
    [see also:]
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    28
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    29
"
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    30
!
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    31
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    32
history
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    33
    "Created: / 14.10.2003 / 17:53:03 / mb"
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    34
! !
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    35
1663
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    36
!MemoryTest methodsFor:'initialize / release'!
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    37
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    38
setUp
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    39
    "common setup - invoked before testing."
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    40
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    41
    (Smalltalk classNamed:'stx_goodies_xml_vw') isNil ifTrue:[
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    42
        (Smalltalk loadPackage:'stx:goodies/xml/vw') ifFalse:[
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    43
            self error:'stx:goodies/xml/vw cannot be loaded'.
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    44
        ].
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    45
    ].
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    46
    (Smalltalk classNamed:'stx_goodies_xml_vw') load.
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    47
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    48
    "Created: / 31-07-2017 / 15:12:57 / mawalch"
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    49
! !
17100e1e5ddb #BUGFIX by mawalch
mawalch
parents: 1447
diff changeset
    50
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    51
!MemoryTest methodsFor:'tests'!
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    52
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    53
test1
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
    54
    "cg: whoever wrote this test:
1984
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    55
         please add some comment on what is actually tested"
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    56
    
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    57
    |x y z|
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    58
1984
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    59
    1 to:10 do:[:rep | 
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    60
        x := XML::Element tag:'x'.
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    61
        ObjectMemory garbageCollect.
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    62
        x attributes:(Array with:(XML::Attribute name:'a' value:'1')
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    63
                    with:(XML::Attribute name:'a' value:'1')).
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    64
        1 to:500 do:[:i | 
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    65
            x addNode:(y := XML::Element tag:'y').
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    66
            y attributes:(Array with:(XML::Attribute name:'a' value:'1')
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    67
                        with:(XML::Attribute name:'a' value:'1')).
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    68
            1 to:1000 do:[:j | 
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    69
                y addNode:(z := XML::Element tag:'y').
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    70
                z attributes:(Array with:(XML::Attribute name:'a' value:'1')
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    71
                            with:(XML::Attribute name:'a' value:'1')).
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    72
            ]
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    73
        ].
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    74
        ObjectMemory garbageCollect.
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    75
        x 
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    76
            nodesDo:[:el | 
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    77
                (el isKindOf:XML::Element) ifTrue:[
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    78
                    (el attributeNamed:'a') 
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    79
                        value:((el valueOfAttribute:'a' ifAbsent:[]) asNumber * (10/3)) asString
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    80
                ]
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    81
            ].
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    82
    ]
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    83
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    84
    "
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    85
     self run:#test1
1984
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    86
     self new test1"
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    87
e4e870c69bf6 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1663
diff changeset
    88
    "Modified: / 03-07-2018 / 11:20:36 / Claus Gittinger"
216
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    89
! !
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    90
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    91
!MemoryTest class methodsFor:'documentation'!
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    92
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    93
version
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    94
    ^ '$Header$'
8db71b19b8a0 initial checkin
Michael Beyl <mb@exept.de>
parents:
diff changeset
    95
! !
1159
7f386090c1c4 category changes
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    96