JavaByteCodeDisassemblerTests.st
author Claus Gittinger <cg@exept.de>
Thu, 24 Nov 2011 12:54:24 +0100
changeset 2290 cd61fd0b66ac
parent 2152 1cbdfbcc685c
child 2353 fa7400d022a0
permissions -rw-r--r--
fixed: #version_SVN ($ to ยง)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    17
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    19
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
JavaByteCodeProcessorTests subclass:#JavaByteCodeDisassemblerTests
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Tests'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    49
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    50
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    51
!JavaByteCodeDisassemblerTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
 license:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
 obtaining a copy of this software and associated documentation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
 files (the 'Software'), to deal in the Software without
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
 restriction, including without limitation the rights to use,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
 copies of the Software, and to permit persons to whom the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
 Software is furnished to do so, subject to the following
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
 conditions:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
 The above copyright notice and this permission notice shall be
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
 included in all copies or substantial portions of the Software.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
     of one of the above copright owners.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
!JavaByteCodeDisassemblerTests class methodsFor:'resources'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
resources
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
    ^ Array with: JavaInitializedResource with: JavaTestsResource.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
    "Created: / 15-03-2011 / 17:29:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
    "Modified: / 16-03-2011 / 14:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   107
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
!JavaByteCodeDisassemblerTests methodsFor:'tests'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
testAnd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    | result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
            [ result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
                invoke: #'and(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
                args: #( 255 149 )]raise: Error. 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
     2    iand
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
    "Created: / 14-03-2011 / 17:02:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
    "Modified: / 20-03-2011 / 21:49:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
testBitShiftLeft
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
    |  |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
     self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
            [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
                invoke: #'bitShiftLeft(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
                args: #( 21 4 )]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
     2    ishl
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
    "Created: / 14-03-2011 / 16:56:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
    "Modified: / 20-03-2011 / 21:50:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
testBitShiftRight
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   150
    |  |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   151
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   152
     self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
                invoke: #'bitShiftRight(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
                args: #( 439 4 )]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
     2    ishr
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
    "Created: / 14-03-2011 / 16:57:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
    "Modified: / 20-03-2011 / 21:50:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
testDec2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
    [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
        invoke: #'dec2(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
        class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
        args: #( 3 ). ] raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
     0    iinc 0 -1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
     3    iinc 0 -1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
     6    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
     7    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
    "Created: / 14-03-2011 / 16:58:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
    "Modified: / 20-03-2011 / 22:59:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
testDiv
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   192
    |  |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   193
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   194
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
            [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
                invoke: #'div(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
                args: #( 101 10 ) ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
     2    irem
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
    "Created: / 14-03-2011 / 16:54:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
    "Modified: / 20-03-2011 / 21:51:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
testDivision
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   213
    |  |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   214
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   215
   self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
            [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
                invoke: #'division(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
                args: #( 101 10 ) ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
     2    idiv
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
    "Created: / 14-03-2011 / 16:57:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
    "Modified: / 20-03-2011 / 21:51:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
testInc2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
    |  |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
            [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
                invoke: #'inc2(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
                args: #( 3 ) ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
     0    iinc 0 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
     3    iinc 0 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
     6    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
     7    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
    "Created: / 14-03-2011 / 16:58:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
    "Modified: / 20-03-2011 / 21:51:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
testInheritedMethodCall
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
    self shouldnt:  [ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
        invoke: #'foo()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
        class: self loadSimpleInheritingJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
        args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
    ]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
    "0    ldc1 2 ['foo'] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
     2    areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
    "Created: / 14-03-2011 / 16:21:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
    "Modified: / 20-03-2011 / 23:01:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
testJustLoadConstants
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
    self shouldnt:  [ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
        invoke: #'justUseConstants()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
        class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
        args: #().
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
    ]        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
     0    lconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
     1    lstore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
     2    lconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
     3    lstore_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
     4    fconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
     5    fstore 4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
     7    fconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
     8    fstore 5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
     10   fconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
     11   fstore 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
     13   dconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
     14   dstore 7
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
     16   dconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
     17   dstore 9
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   293
     19   return"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   295
    "Created: / 14-03-2011 / 17:05:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
    "Modified: / 20-03-2011 / 23:02:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
testLookupSwitch
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
        self shouldnt:            [ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
        invoke: #'switchInt(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   304
        class: self loadSwitchExamplesClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
        receiver: self loadSwitchExamplesClass new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
        args: #( -1000 )
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
     ]        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
    "Created: / 21-03-2011 / 13:51:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   311
    "Modified: / 21-03-2011 / 15:12:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   312
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   313
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   314
testMultipy
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   315
   self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   316
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
                invoke: #'multiply(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
                args: (Array with: 20 with: 10)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   321
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   322
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   323
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   324
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   325
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   326
     2    imul
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   327
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   328
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   329
    "Created: / 06-03-2011 / 14:17:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   330
    "Modified: / 20-03-2011 / 21:53:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   331
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   332
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   333
testNegateInt
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   334
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   335
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   336
                invoke: #'negateInt(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   337
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   338
                args: #( 55 )]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   339
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   340
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   341
    "0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   342
     1    iconst_m1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   343
     2    ixor
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   344
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   345
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   346
    "Created: / 14-03-2011 / 16:55:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   347
    "Modified: / 20-03-2011 / 21:53:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   348
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   349
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   350
testOr
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   351
    |  |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   352
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   353
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   354
            [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   355
                invoke: #'or(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   356
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   357
                args: #( 55 66 )]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   358
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   359
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   360
    "0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   361
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   362
     2    ior
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   363
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   364
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   365
    "Created: / 14-03-2011 / 17:02:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   366
    "Modified: / 20-03-2011 / 21:53:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   367
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   368
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   369
testOverridenMethodCall
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   370
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   371
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   372
                        invoke: #'bar()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   373
                        class: self loadSimpleInheritingJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   374
                        args: nil.]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   375
                                raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   376
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   377
    "0    ldc1 2 ['bar'] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   378
     2    areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   379
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   380
    "Modified: / 20-03-2011 / 21:53:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   381
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   382
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   383
testPower
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   384
     self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   385
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   386
                invoke: #'power(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   387
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   388
                args: (Array with: 2 with: 10)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   389
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   390
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   391
    "0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   392
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   393
     2    iconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   394
     3    invokestatic 2 [JavaMethod(stx.libjava.tests.simpleClasses.SimpleMath::int powerAcc (int int int))]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   395
     6    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   396
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   397
    "Created: / 06-03-2011 / 14:18:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   398
    "Modified: / 20-03-2011 / 21:54:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   399
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   400
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   401
testReturnArrayOfLongs
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   402
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   403
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   404
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   405
            [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   406
                        invoke: #'giveMeArrayOfLongs()[J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   407
                        class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   408
                        args: #(). ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   409
        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   410
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   411
    "0    bipush 100
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   412
     2    newarray 11 [T_LONG]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   413
     4    areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   414
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   415
    "Created: / 14-03-2011 / 17:08:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   416
    "Modified: / 20-03-2011 / 21:54:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   417
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   418
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   419
testSimpleAdd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   420
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   421
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   422
                invoke: #'add2To2000Expect2002()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   423
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   424
                args: nil ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   425
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   426
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   427
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   428
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   429
     0    iconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   430
     1    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   431
     2    sipush 2000
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   432
     5    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   433
     6    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   434
     7    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   435
     8    iadd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   436
     9    istore_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   437
     10   iload_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   438
     11   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   439
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   440
    "Created: / 06-03-2011 / 14:18:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   441
    "Modified: / 20-03-2011 / 21:55:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   442
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   443
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   444
testSimpleAdd2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   445
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   446
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   447
                invoke: #'addMinus5ToArg(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   448
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   449
                args: (Array with: 10) ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   450
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   451
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   452
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   453
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   454
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   455
     1    bipush -5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   456
     3    iadd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   457
     4    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   458
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   459
    "Created: / 06-03-2011 / 14:18:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   460
    "Modified: / 20-03-2011 / 21:55:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   461
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   462
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   463
testStackCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   464
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   465
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   466
                invoke: #'isYourStackCreatedCorrectly()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   467
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   468
                args: #()]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   469
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   470
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   471
    "0    iconst_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   472
     1    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   473
     2    iconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   474
     3    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   475
     4    iconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   476
     5    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   477
     6    iconst_3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   478
     7    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   479
     8    iconst_4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   480
     9    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   481
     10   iconst_5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   482
     11   istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   483
     12   bipush 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   484
     14   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   485
     15   bipush 7
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   486
     17   istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   487
     18   bipush 8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   488
     20   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   489
     21   bipush 9
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   490
     23   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   491
     24   iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   492
     25   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   493
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   494
    "Created: / 14-03-2011 / 17:03:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   495
    "Modified: / 20-03-2011 / 21:55:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   496
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   497
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   498
testSumArray
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   499
    self shouldnt:   [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   500
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   501
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   502
        invoke: #'sumArray([I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   503
        class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   504
        args: #( #(1 2 3 4 5) )
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   505
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   506
    ]        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   507
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   508
     Decompiled source:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   509
     Static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   510
     0    iconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   511
     1    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   512
     2    iconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   513
     3    istore_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   514
     4    iload_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   515
     5    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   516
     6    arraylength
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   517
     7    if_icmpge 15 [22]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   518
     10   iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   519
     11   aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   520
     12   iload_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   521
     13   iaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   522
     14   iadd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   523
     15   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   524
     16   iinc 2 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   525
     19   goto -15 [4]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   526
     22   iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   527
     23   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   528
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   529
    "Created: / 14-03-2011 / 17:06:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   530
    "Modified: / 20-03-2011 / 23:05:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   531
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   532
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   533
testSumArrayOfDoubles
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   534
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   535
             [self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   536
                invoke: #'sumArrayOfDoubles([D)D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   537
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   538
                args: #( #(1.1 2.2 3.3 4.4 5.5) ) ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   539
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   540
    "0    dconst_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   541
     1    dstore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   542
     2    iconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   543
     3    istore_3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   544
     4    iload_3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   545
     5    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   546
     6    arraylength
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   547
     7    if_icmpge 15 [22]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   548
     10   dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   549
     11   aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   550
     12   iload_3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   551
     13   daload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   552
     14   dadd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   553
     15   dstore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   554
     16   iinc 3 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   555
     19   goto -15 [4]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   556
     22   dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   557
     23   dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   558
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   559
    "Created: / 14-03-2011 / 17:07:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   560
    "Modified: / 20-03-2011 / 21:55:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   561
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   562
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   563
testTableSwitch
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   564
         self shouldnt:             [ 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   565
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   566
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   567
        invoke: #'switchChar(C)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   568
        class: self loadSwitchExamplesClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   569
        receiver: self loadSwitchExamplesClass new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   570
        args: #( $b ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   571
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   572
    ]        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   573
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   574
    "Created: / 21-03-2011 / 13:51:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   575
    "Modified: / 21-03-2011 / 15:02:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   576
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   577
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   578
testUnsignedBitShiftLeft
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   579
   self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   580
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   581
                invoke: #'unsignedBitShiftRight(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   582
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   583
                args: #( 1234 5 ) ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   584
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   585
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   586
    "0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   587
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   588
     2    iushr
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   589
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   590
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   591
    "Created: / 14-03-2011 / 17:01:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   592
    "Modified: / 20-03-2011 / 21:56:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   593
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   594
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   595
testXor
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   596
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   597
             [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   598
                invoke: #'xor(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   599
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   600
                args: #( 1234 5 )]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   601
                        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   602
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   603
    "0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   604
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   605
     2    ixor
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   606
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   607
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   608
    "Modified: / 06-03-2011 / 15:11:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   609
    "Created: / 14-03-2011 / 17:02:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   610
    "Modified: / 20-03-2011 / 21:56:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   611
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   612
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   613
!JavaByteCodeDisassemblerTests methodsFor:'tests - manual'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   614
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   615
diassembleAll
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   616
    | fails |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   617
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   618
    fails := OrderedCollection new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   619
    JavaMethod allSubInstances do: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   620
            [:method | 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   621
            method isNative 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   622
                ifFalse: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   623
                    [ [ JavaByteCodeDisassembler new diassemble: method to: String new writeStream ] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   624
                        on: Error
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   625
                        do: [ fails add: method ] ] ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   626
    fails size ~~ 0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   627
        ifTrue: [ self error: 'Some java methods failed to disassemble' ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   628
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   629
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   630
        JavaByteCodeDisassemblerTests new diassembleAll"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   631
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   632
    "Created: / 21-03-2011 / 21:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   633
    "Modified: / 22-03-2011 / 21:05:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   634
    "Modified: / 23-03-2011 / 16:54:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   635
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   636
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   637
!JavaByteCodeDisassemblerTests methodsFor:'tests-helpers'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   638
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   639
invoke:methodName class:aClass receiver:receiver args:args 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   640
    |method result|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   641
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   642
    method := aClass lookupMethodFor:methodName.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   643
    result := JavaByteCodeDisassembler diassemble:method.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   644
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   645
    "Created: / 10-03-2011 / 23:30:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   646
    "Modified: / 20-03-2011 / 17:42:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   647
    "Modified: / 22-03-2011 / 21:05:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   648
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   649
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   650
!JavaByteCodeDisassemblerTests methodsFor:'tests2'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   651
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   652
testGetBoolean
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   653
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   654
            self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   655
                invoke: #'getBoolean()Z'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   656
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   657
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   658
                args: nil. 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   659
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   660
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   661
     Deassembling getBoolean
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   662
     1:      ALOAD_0     (42)  ARGS: []                  STACK: [.. -> FIELD 0: stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   663
     2:      GETFIELD    (180) ARGS: [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)] STACK: [objectRef -> objectRef]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   664
     5:      BIPUSH      (16)  ARGS: [9]                 STACK: [.. -> value]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   665
     7:      AALOAD      (50)  ARGS: []                  STACK: [arrayRef, index -> value]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   666
     8:      CHECKCAST   (192) ARGS: [java.lang.Boolean] STACK: [objectRef -> objectRef]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   667
     11:     INVVIRT     (182) ARGS: [JavaMethodRef (java.lang.Boolean 'booleanValue'()Z)] STACK: [objectRef, [arg1, arg2, ...]  -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   668
     14:     IRETURN     (172) ARGS: []                  STACK: [value -> EMPTY]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   669
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   670
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   671
    "Created: / 14-03-2011 / 21:36:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   672
    "Modified: / 22-03-2011 / 16:06:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   673
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   674
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   675
testGetByte
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   676
    self shouldnt:[  self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   677
                invoke: #'getByte()B'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   678
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   679
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   680
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   681
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   682
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   683
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   684
     4    bipush 7
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   685
     6    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   686
     7    checkcast 17 [java.lang.Byte]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   687
     10   invokevirtual 31 [JavaMethodRef (java.lang.Byte 'byteValue'()B)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   688
     13   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   689
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   690
    "Created: / 14-03-2011 / 21:34:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   691
    "Modified: / 21-03-2011 / 15:38:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   692
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   693
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   694
testGetChar
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   695
   self shouldnt:[   self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   696
                invoke: #'getChar()C'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   697
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   698
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   699
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   700
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   701
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   702
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   703
     4    iconst_3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   704
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   705
     6    checkcast 25 [java.lang.Character]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   706
     9    invokevirtual 26 [JavaMethodRef (java.lang.Character 'charValue'()C)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   707
     12   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   708
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   709
    "Created: / 14-03-2011 / 21:31:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   710
    "Modified: / 21-03-2011 / 15:39:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   711
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   712
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   713
testGetDateArray
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   714
   self shouldnt:[   self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   715
                invoke: #'getDateArray()[Ljava/util/Date;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   716
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   717
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   718
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   719
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   720
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   721
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   722
     4    bipush 8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   723
     6    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   724
     7    checkcast 32 [UnresolvedClass([Ljava.util.Date;)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   725
     10   checkcast 32 [UnresolvedClass([Ljava.util.Date;)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   726
     13   areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   727
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   728
    "Created: / 14-03-2011 / 21:35:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   729
    "Modified: / 21-03-2011 / 15:39:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   730
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   731
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   732
testGetDouble
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   733
   self shouldnt:[     self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   734
                invoke: #'getDouble()Ljava/lang/Double;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   735
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   736
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   737
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   738
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   739
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   740
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   741
     4    iconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   742
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   743
     6    checkcast 24 [java.lang.Double]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   744
     9    areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   745
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   746
    "Created: / 14-03-2011 / 21:30:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   747
    "Modified: / 21-03-2011 / 15:39:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   748
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   750
testGetInt
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   751
  self shouldnt:[     self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   752
                invoke: #'getInt()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   753
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   754
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   755
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   756
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   757
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   758
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   759
     4    iconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   760
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   761
     6    checkcast 13 [java.lang.Integer]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   762
     9    invokevirtual 23 [JavaMethodRef (java.lang.Integer 'intValue'()I)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   763
     12   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   764
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   765
    "Created: / 14-03-2011 / 21:30:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   766
    "Modified: / 21-03-2011 / 15:39:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   767
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   768
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   769
testGetIntArray
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   770
self shouldnt:[    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   771
                invoke: #'getIntArray()[I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   772
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   773
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   774
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   775
    ]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   776
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   777
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   778
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   779
     4    iconst_5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   780
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   781
     6    checkcast 29 [JavaBuiltInClassPointerRef(class:IntegerArray ; name&type: '[I')]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   782
     9    checkcast 29 [JavaBuiltInClassPointerRef(class:IntegerArray ; name&type: '[I')]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   783
     12   areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   784
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   785
    "Created: / 14-03-2011 / 21:33:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   786
    "Modified: / 21-03-2011 / 15:40:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   787
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   788
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   789
testGetLong
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   790
  self shouldnt:[   self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   791
                invoke: #'getLong()J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   792
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   793
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   794
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   795
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   796
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   797
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   798
     4    iconst_4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   799
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   800
     6    checkcast 27 [java.lang.Long]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   801
     9    invokevirtual 28 [JavaMethodRef (java.lang.Long 'longValue'()J)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   802
         12   lreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   803
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   804
    "Created: / 14-03-2011 / 21:32:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   805
    "Modified: / 21-03-2011 / 15:40:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   806
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   807
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   808
testGetShort
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   809
  self shouldnt:[     self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   810
                invoke: #'getShort()S'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   811
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   812
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   813
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   814
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   815
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   816
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   817
     4    bipush 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   818
     6    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   819
     7    checkcast 14 [java.lang.Short]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   820
     10   invokevirtual 30 [JavaMethodRef (java.lang.Short 'shortValue'()S)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   821
     13   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   822
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   823
    "Created: / 14-03-2011 / 21:33:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   824
    "Modified: / 21-03-2011 / 15:40:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   825
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   826
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   827
testGetString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   828
 self shouldnt:[    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   829
                invoke: #'getString()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   830
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   831
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   832
                args: nil]       raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   833
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   834
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   835
     1    getfield 3 [JavaFieldRef (stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences 'values'[Ljava/lang/Object; offs=1)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   836
     4    iconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   837
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   838
     6    checkcast 22 [java.lang.String]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   839
     9    areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   840
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   841
    "Created: / 14-03-2011 / 21:27:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   842
    "Modified: / 21-03-2011 / 15:40:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   843
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   844
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   845
testMultiBytePrintString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   846
|badClass|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   847
badClass := Java classForName: 'java.nio.charset.CharsetDecoder'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   848
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   849
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   850
self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   851
                invoke: #'<init>(Ljava/nio/charset/Charset;FF)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   852
                class: badClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   853
                args: #( 21 4 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   854
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   855
    "Created: / 23-03-2011 / 16:58:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   856
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   857
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   858
testSetBoolean
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   859
       self shouldnt:         [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   860
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   861
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   862
        invoke: #'setBoolean(I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   863
        class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   864
        receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   865
        args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   866
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   867
    ]        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   868
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   869
    "Created: / 22-03-2011 / 12:17:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   870
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   871
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   872
!JavaByteCodeDisassemblerTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   873
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   874
version_SVN
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   875
    ^ '$Id: JavaByteCodeDisassemblerTests.st,v 1.1 2011-08-18 19:06:53 vrany Exp $'
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   876
! !