JavaByteCodeInterpreterTests.st
author Stefan Vogel <sv@exept.de>
Tue, 08 Nov 2005 17:49:17 +0100
changeset 2121 7b06266d8249
parent 749 e898eaeff091
child 2152 1cbdfbcc685c
permissions -rw-r--r--
/tmp/cvsyRpZ5v
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:#JavaByteCodeInterpreterTests
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
!JavaByteCodeInterpreterTests 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
!JavaByteCodeInterpreterTests 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
!JavaByteCodeInterpreterTests 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  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
    expResult := 2r10010101.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
                invoke: #'and(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   117
                args: #( 255 149 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   120
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   121
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   122
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   123
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   124
     2    iand
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   125
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   126
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   127
    "Created: / 14-03-2011 / 17:02:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   128
    "Modified: / 16-03-2011 / 21:49:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   130
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   131
testBitShiftLeft
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   132
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   133
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   134
    expResult := 2r101010000.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   135
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   136
                invoke: #'bitShiftLeft(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   137
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   138
                args: #( 21 4 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   139
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   140
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   141
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   142
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   143
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   144
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   145
     2    ishl
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   146
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   147
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   148
    "Created: / 14-03-2011 / 16:56:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   149
    "Modified: / 16-03-2011 / 21:49:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
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
testBitShiftRight
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   153
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   154
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   155
    expResult := 2r11011.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   156
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   157
                invoke: #'bitShiftRight(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   158
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   159
                args: #( 439 4 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   160
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   161
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   162
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   163
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   164
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   165
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   166
     2    ishr
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   167
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   168
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   169
    "Created: / 14-03-2011 / 16:57:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   170
    "Modified: / 16-03-2011 / 21:49:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   171
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   172
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   173
testDec2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   174
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   175
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   176
    expResult := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   177
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   178
                invoke: #'dec2(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   179
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   180
                args: #( 3 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   181
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   182
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   183
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   184
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   185
     0    iinc 0 -1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   186
     3    iinc 0 -1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   187
     6    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   188
     7    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   189
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   190
    "Created: / 14-03-2011 / 16:58:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   191
    "Modified: / 16-03-2011 / 21:49:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
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
testDiv
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   195
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   196
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   197
    expResult := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   198
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   199
                invoke: #'div(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   200
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   201
                args: #( 101 10 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   202
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   203
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   204
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   205
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   206
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   207
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   208
     2    irem
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   209
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   210
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   211
    "Created: / 14-03-2011 / 16:54:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   212
    "Modified: / 16-03-2011 / 21:49:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
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
testDivision
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   216
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   217
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   218
    expResult := 10.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   219
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   220
                invoke: #'division(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   221
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   222
                args: #( 101 10 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   223
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   224
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   225
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   226
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   227
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   228
     1    iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   229
     2    idiv
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   230
     3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   231
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   232
    "Created: / 14-03-2011 / 16:57:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   233
    "Modified: / 16-03-2011 / 21:48:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   234
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   235
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   236
testInc2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   237
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   238
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   239
    expResult := 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   240
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   241
                invoke: #'inc2(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   242
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   243
                args: #( 3 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   244
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   245
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   246
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   247
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   248
     0    iinc 0 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   249
     3    iinc 0 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   250
     6    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   251
     7    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   252
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   253
    "Created: / 14-03-2011 / 16:58:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   254
    "Modified: / 16-03-2011 / 21:48:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   255
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   256
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   257
testInheritedMethodCall
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   258
    | result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   259
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   260
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   261
            [ result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   262
                        invoke: #'foo()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   263
                        class: self loadSimpleInheritingJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   264
                        args: nil. ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   265
        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   266
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   267
"0    ldc1 2 ['foo'] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   268
2    areturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   269
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   270
    "Created: / 14-03-2011 / 16:21:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   271
    "Modified: / 16-03-2011 / 21:47:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   272
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   273
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   274
testJustLoadConstants
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   275
    "/self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   276
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   277
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   278
    [ self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   279
        invoke: #'justUseConstants()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   280
        class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   281
        args: #(). ] value.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   282
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   283
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   284
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   285
     0    lconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   286
     1    lstore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   287
     2    lconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   288
     3    lstore_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   289
     4    fconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   290
     5    fstore 4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   291
     7    fconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   292
     8    fstore 5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   293
     10   fconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   294
     11   fstore 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   295
     13   dconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   296
     14   dstore 7
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   297
     16   dconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   298
     17   dstore 9
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   299
     19   return"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   300
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   301
    "Created: / 14-03-2011 / 17:05:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   302
    "Modified: / 16-03-2011 / 21:48:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   303
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   304
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   305
testMultipy
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   306
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   307
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   308
    expResult := 200.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   309
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   310
                invoke: #'multiply(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   311
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   312
                args: (Array with: 20 with: 10).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   313
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   314
"static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   315
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   316
0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   317
1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   318
2    imul 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   319
3    ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   320
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   321
    "Created: / 06-03-2011 / 14:17:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   322
    "Modified: / 16-03-2011 / 21:50:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   323
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   324
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   325
testNegateInt
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   326
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   327
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   328
    expResult := -56.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   329
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   330
                invoke: #'negateInt(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   331
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   332
                args: #( 55 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   333
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   334
"0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   335
1    iconst_m1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   336
2    ixor 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   337
3    ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   338
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   339
    "Created: / 14-03-2011 / 16:55:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   340
    "Modified: / 16-03-2011 / 21:50:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   341
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   342
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   343
testOr
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   344
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   345
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   346
    expResult := 119.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   347
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   348
                invoke: #'or(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   349
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   350
                args: #( 55 66 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   351
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   352
"0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   353
1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   354
2    ior 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   355
3    ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   356
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   357
    "Created: / 14-03-2011 / 17:02:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   358
    "Modified: / 16-03-2011 / 21:50:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   359
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   360
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   361
testOverridenMethodCall
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   362
    | result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   363
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   364
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   365
            [ result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   366
                        invoke: #'bar()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   367
                        class: self loadSimpleInheritingJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   368
                        args: nil. ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   369
        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   370
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   371
"0    ldc1 2 ['bar'] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   372
2    areturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   373
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   374
    "Modified: / 16-03-2011 / 21:51:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   375
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   376
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   377
testPower
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   378
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   379
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   380
    expResult := 1024.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   381
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   382
                invoke: #'power(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   383
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   384
                args: (Array with: 2 with: 10).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   385
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   386
"0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   387
1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   388
2    iconst_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   389
3    invokestatic 2 [JavaMethod(stx.libjava.tests.simpleClasses.SimpleMath::int powerAcc (int int int))] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   390
6    ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   391
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   392
    "Created: / 06-03-2011 / 14:18:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   393
    "Modified: / 16-03-2011 / 21:51:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   394
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   395
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   396
testReturnArrayOfLongs
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   397
    | result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   398
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   399
    self shouldnt: 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   400
            [ result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   401
                        invoke: #'giveMeArrayOfLongs()[J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   402
                        class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   403
                        args: #(). ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   404
        raise: Error.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   405
"0    bipush 100
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   406
2    newarray 11 [T_LONG]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   407
4    areturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   408
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   409
    "Created: / 14-03-2011 / 17:08:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   410
    "Modified: / 16-03-2011 / 21:52:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   411
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   412
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   413
testSetterAndGettersDouble
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   414
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   415
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   416
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   417
    expResult := 1234.45.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   418
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   419
        invoke: #'setDoubleVar(D)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   420
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   421
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   422
        args: (Array with: 1234.45).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   423
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   424
                invoke: #'getDoubleVar()D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   425
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   426
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   427
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   428
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   429
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   430
    "setDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   431
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   432
     1    dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   433
     2    putfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   434
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   435
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   436
     getDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   437
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   438
     1    getfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   439
     4    dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   440
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   441
    "Created: / 13-03-2011 / 17:43:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   442
    "Modified: / 16-03-2011 / 21:54:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   443
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   444
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   445
testSetterAndGettersDoubleMaxValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   446
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   447
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   448
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   449
    expResult := 1.79769313486232E+308.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   450
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   451
        invoke: #'setDoubleVar(D)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   452
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   453
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   454
        args: (Array with: 1.79769313486232E+308).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   455
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   456
                invoke: #'getDoubleVar()D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   457
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   458
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   459
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   460
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   461
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   462
    "setDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   463
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   464
     1    dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   465
     2    putfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   466
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   467
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   468
     getDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   469
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   470
     1    getfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   471
     4    dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   472
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   473
    "Created: / 14-03-2011 / 14:06:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   474
    "Modified: / 16-03-2011 / 21:53:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   475
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   476
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   477
testSetterAndGettersDoubleMinValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   478
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   479
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   480
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   481
    expResult := 4.94065645841247E-324.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   482
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   483
        invoke: #'setDoubleVar(D)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   484
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   485
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   486
        args: (Array with: 4.94065645841247E-324).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   487
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   488
                invoke: #'getDoubleVar()D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   489
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   490
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   491
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   492
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   493
    "setDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   494
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   495
     1    dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   496
     2    putfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   497
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   498
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   499
     getDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   500
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   501
     1    getfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   502
     4    dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   503
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   504
    "Created: / 14-03-2011 / 14:06:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   505
    "Modified: / 16-03-2011 / 21:54:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   506
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   507
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   508
testSetterAndGettersDoubleNan
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   509
    | result  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   510
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   511
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   512
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   513
        invoke: #'setDoubleVar(D)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   514
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   515
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   516
        args: (Array with: Float nan).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   517
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   518
                invoke: #'getDoubleVar()D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   519
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   520
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   521
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   522
    self assert: (result isNaN).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   523
    "setDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   524
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   525
     1    dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   526
     2    putfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   527
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   528
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   529
     getDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   530
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   531
     1    getfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   532
     4    dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   533
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   534
    "Created: / 14-03-2011 / 14:07:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   535
    "Modified: / 16-03-2011 / 21:54:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   536
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   537
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   538
testSetterAndGettersDoubleWithInfinityArg
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   539
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   540
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   541
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   542
    expResult := Float infinity.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   543
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   544
        invoke: #'setDoubleVar(D)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   545
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   546
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   547
        args: (Array with: Float infinity).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   548
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   549
                invoke: #'getDoubleVar()D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   550
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   551
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   552
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   553
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   554
    "setDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   555
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   556
     1    dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   557
     2    putfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   558
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   559
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   560
     getDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   561
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   562
     1    getfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   563
     4    dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   564
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   565
    "Created: / 14-03-2011 / 13:52:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   566
    "Modified: / 16-03-2011 / 21:54:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   567
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   568
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   569
testSetterAndGettersDoubleWithNegativeInfinityArg
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   570
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   571
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   572
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   573
    expResult := Float negativeInfinity.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   574
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   575
        invoke: #'setDoubleVar(D)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   576
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   577
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   578
        args: (Array with: Float negativeInfinity).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   579
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   580
                invoke: #'getDoubleVar()D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   581
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   582
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   583
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   584
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   585
    "setDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   586
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   587
     1    dload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   588
     2    putfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   589
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   590
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   591
     getDoubleVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   592
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   593
     1    getfield 3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   594
     4    dreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   595
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   596
    "Created: / 14-03-2011 / 13:53:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   597
    "Modified: / 16-03-2011 / 21:54:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   598
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   599
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   600
testSetterAndGettersInt
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   601
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   602
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   603
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   604
    expResult := 1234.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   605
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   606
        invoke: #'setIntVar(I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   607
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   608
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   609
        args: (Array with: 1234).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   610
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   611
                invoke: #'getIntVar()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   612
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   613
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   614
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   615
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   616
    "setIntVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   617
     0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   618
     1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   619
     2    putfield 2 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'intVar'I offs=1)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   620
     5    return 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   621
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   622
     getIntVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   623
     0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   624
     1    getfield 2 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'intVar'I offs=1)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   625
     4    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   626
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   627
    "Created: / 13-03-2011 / 17:42:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   628
    "Modified: / 16-03-2011 / 21:55:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   629
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   630
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   631
testSetterAndGettersIntMaxValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   632
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   633
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   634
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   635
    expResult := 2147483647.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   636
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   637
        invoke: #'setIntVar(I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   638
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   639
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   640
        args: (Array with: 2147483647).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   641
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   642
                invoke: #'getIntVar()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   643
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   644
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   645
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   646
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   647
    "setIntVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   648
     0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   649
     1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   650
     2    putfield 2 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'intVar'I offs=1)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   651
     5    return 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   652
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   653
     getIntVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   654
     0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   655
     1    getfield 2 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'intVar'I offs=1)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   656
     4    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   657
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   658
    "Created: / 14-03-2011 / 14:02:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   659
    "Modified: / 16-03-2011 / 21:55:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   660
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   661
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   662
testSetterAndGettersIntMinValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   663
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   664
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   665
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   666
    expResult := -2147483648.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   667
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   668
        invoke: #'setIntVar(I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   669
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   670
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   671
        args: (Array with: -2147483648).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   672
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   673
                invoke: #'getIntVar()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   674
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   675
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   676
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   677
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   678
    "setIntVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   679
     0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   680
     1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   681
     2    putfield 2 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'intVar'I offs=1)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   682
     5    return 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   683
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   684
     getIntVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   685
     0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   686
     1    getfield 2 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'intVar'I offs=1)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   687
     4    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   688
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   689
    "Created: / 14-03-2011 / 14:01:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   690
    "Modified: / 16-03-2011 / 21:55:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   691
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   692
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   693
testSetterAndGettersLong
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   694
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   695
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   696
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   697
    expResult := 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   698
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   699
        invoke: #'setLongVar(J)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   700
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   701
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   702
        args: (Array 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   703
                with: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   704
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   705
                invoke: #'getLongVar()J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   706
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   707
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   708
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   709
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   710
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   711
    "setLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   712
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   713
     1    lload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   714
     2    putfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   715
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   716
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   717
     getLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   718
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   719
     1    getfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   720
     4    lreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   721
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   722
    "Created: / 14-03-2011 / 13:36:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   723
    "Modified: / 16-03-2011 / 21:56:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   724
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   725
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   726
testSetterAndGettersLongMaxValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   727
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   728
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   729
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   730
    expResult := 9223372036854775807.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   731
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   732
        invoke: #'setLongVar(J)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   733
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   734
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   735
        args: (Array with: 9223372036854775807).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   736
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   737
                invoke: #'getLongVar()J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   738
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   739
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   740
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   741
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   742
    "setLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   743
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   744
     1    lload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   745
     2    putfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   746
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   747
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   748
     getLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   749
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   750
     1    getfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   751
     4    lreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   752
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   753
    "Created: / 14-03-2011 / 14:04:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   754
    "Modified: / 16-03-2011 / 21:56:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   755
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   756
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   757
testSetterAndGettersLongMinValue
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   758
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   759
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   760
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   761
    expResult := -9223372036854775808.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   762
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   763
        invoke: #'setLongVar(J)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   764
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   765
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   766
        args: (Array with: -9223372036854775808).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   767
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   768
                invoke: #'getLongVar()J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   769
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   770
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   771
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   772
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   773
    "setLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   774
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   775
     1    lload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   776
     2    putfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   777
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   778
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   779
     getLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   780
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   781
     1    getfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   782
     4    lreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   783
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   784
    "Created: / 14-03-2011 / 14:04:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   785
    "Modified: / 16-03-2011 / 21:56:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   786
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   787
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   788
testSetterAndGettersLongWithIntArg
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   789
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   790
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   791
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   792
    expResult := 12.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   793
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   794
        invoke: #'setLongVar(J)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   795
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   796
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   797
        args: (Array with: 12).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   798
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   799
                invoke: #'getLongVar()J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   800
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   801
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   802
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   803
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   804
    "setLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   805
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   806
     1    lload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   807
     2    putfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   808
     5    return
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   809
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   810
     getLongVar:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   811
     0    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   812
     1    getfield 4 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'longVar'J offs=3)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   813
     4    lreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   814
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   815
    "Created: / 14-03-2011 / 13:49:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   816
    "Modified: / 16-03-2011 / 21:56:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   817
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   818
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   819
testSetterAndGettersString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   820
    | result  expResult  crate |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   821
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   822
    crate := self loadCrateJavaClass new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   823
    expResult := 'hello world'.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   824
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   825
        invoke: #'setStringVar(Ljava/lang/String;)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   826
        class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   827
        receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   828
        args: (Array with: 'hello world').
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   829
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   830
                invoke: #'getStringVar()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   831
                class: crate class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   832
                receiver: crate
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   833
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   834
    self assert: (expResult = result).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   835
"setString:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   836
0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   837
1    aload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   838
2    putfield 5 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'stringVar'Ljava/lang/String; offs=4)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   839
5    return 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   840
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   841
getString:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   842
0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   843
1    getfield 5 [JavaFieldRef (stx.libjava.tests.simpleClasses.Crate 'stringVar'Ljava/lang/String; offs=4)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   844
4    areturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   845
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   846
    "Created: / 14-03-2011 / 13:45:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   847
    "Modified: / 16-03-2011 / 21:57:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
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
testSimpleAdd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   851
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   852
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   853
    expResult := 2002.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   854
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   855
                invoke: #'add2To2000Expect2002()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   856
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   857
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   858
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   859
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   860
"static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   861
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   862
0    iconst_2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   863
1    istore_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   864
2    sipush 2000
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   865
5    istore_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   866
6    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   867
7    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   868
8    iadd 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   869
9    istore_2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   870
10   iload_2 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   871
11   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   872
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   873
    "Created: / 06-03-2011 / 14:18:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   874
    "Modified: / 16-03-2011 / 21:57:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   875
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   876
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   877
testSimpleAdd2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   878
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   879
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   880
    expResult := 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   881
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   882
                invoke: #'addMinus5ToArg(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   883
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   884
                args: (Array with: 10).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   885
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   886
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   887
    "static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   888
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   889
     0    iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   890
     1    bipush -5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   891
     3    iadd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   892
     4    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   893
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   894
    "Created: / 06-03-2011 / 14:18:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   895
    "Modified: / 16-03-2011 / 21:59:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   896
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   897
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   898
testStackCreation
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   899
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   900
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   901
    expResult := 7.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   902
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   903
                invoke: #'isYourStackCreatedCorrectly()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   904
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   905
                args: #().
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   906
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   907
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   908
    "0    iconst_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   909
     1    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   910
     2    iconst_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   911
     3    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   912
     4    iconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   913
     5    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   914
     6    iconst_3
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   915
     7    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   916
     8    iconst_4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   917
     9    istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   918
     10   iconst_5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   919
     11   istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   920
     12   bipush 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   921
     14   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   922
     15   bipush 7
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   923
     17   istore_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   924
     18   bipush 8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   925
     20   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   926
     21   bipush 9
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   927
     23   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   928
     24   iload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   929
     25   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   930
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   931
    "Created: / 14-03-2011 / 17:03:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   932
    "Modified: / 16-03-2011 / 21:59:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   933
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   934
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   935
testSumArray
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   936
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   937
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   938
    expResult := 15.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   939
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   940
                invoke: #'sumArray([I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   941
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   942
                args: #( #(1 2 3 4 5) ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   943
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   944
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   945
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   946
     Decompiled source:
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   947
     Static method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   948
     0    iconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   949
     1    istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   950
     2    iconst_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   951
     3    istore_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   952
     4    iload_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   953
     5    aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   954
     6    arraylength
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   955
     7    if_icmpge 15 [22]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   956
     10   iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   957
     11   aload_0
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   958
     12   iload_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   959
     13   iaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   960
     14   iadd
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   961
     15   istore_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   962
     16   iinc 2 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   963
     19   goto -15 [4]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   964
     22   iload_1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   965
     23   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   966
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   967
    "Created: / 14-03-2011 / 17:06:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   968
    "Modified: / 16-03-2011 / 21:58:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   969
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   970
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   971
testSumArrayOfDoubles
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   972
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   973
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   974
    expResult := 16.5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   975
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   976
                invoke: #'sumArrayOfDoubles([D)D'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   977
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   978
                args: #( #(1.1 2.2 3.3 4.4 5.5) ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   979
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   980
"0    dconst_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   981
1    dstore_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   982
2    iconst_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   983
3    istore_3 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   984
4    iload_3 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   985
5    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   986
6    arraylength 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   987
7    if_icmpge 15 [22]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   988
10   dload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   989
11   aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   990
12   iload_3 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   991
13   daload 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   992
14   dadd 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   993
15   dstore_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   994
16   iinc 3 1
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   995
19   goto -15 [4]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   996
22   dload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   997
23   dreturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   998
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   999
    "Created: / 14-03-2011 / 17:07:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1000
    "Modified: / 16-03-2011 / 21:59:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1001
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1002
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1003
testUnsignedBitShiftLeft
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1004
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1005
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1006
    expResult := 1234 bitShift: 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1007
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1008
                invoke: #'unsignedBitShiftRight(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1009
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1010
                args: #( 1234 5 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1011
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1012
"0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1013
1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1014
2    iushr 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1015
3    ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1016
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1017
    "Created: / 14-03-2011 / 17:01:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1018
    "Modified: / 16-03-2011 / 21:59:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1019
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1020
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1021
testXor
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1022
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1023
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1024
    expResult := 1234 bitXor: 5.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1025
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1026
                invoke: #'xor(II)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1027
                class: self loadSimpleMathJavaClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1028
                args: #( 1234 5 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1029
    self assertTrue: expResult = result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1030
"0    iload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1031
1    iload_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1032
2    ixor 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1033
3    ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1034
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1035
    "Modified: / 06-03-2011 / 15:11:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1036
    "Created: / 14-03-2011 / 17:02:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1037
    "Modified: / 16-03-2011 / 21:59:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1038
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1039
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1040
!JavaByteCodeInterpreterTests methodsFor:'tests-helpers'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1041
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1042
invoke: methodName class: aClass receiver: receiver args: args 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1043
    | method  result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1044
    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1045
    method := aClass lookupMethodFor: methodName.    
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1046
    result := JavaByteCodeInterpreter new 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1047
                interpret: method
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1048
                receiver: receiver
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1049
                arguments: args.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1050
    ^ result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1051
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1052
    "Created: / 10-03-2011 / 23:30:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1053
    "Modified: / 17-03-2011 / 17:32:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1054
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1055
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1056
!JavaByteCodeInterpreterTests methodsFor:'tests2'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1057
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1058
testGetBoolean
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1059
    | result  expResult  inst |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1060
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1061
    inst := self loadSimpleClassWithManyReferences new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1062
    expResult := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1063
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1064
                invoke: #'getBoolean()Z'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1065
                class: inst class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1066
                receiver: inst
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1067
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1068
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1069
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1070
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1071
    "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1072
     Deassembling getBoolean
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1073
     1:      ALOAD_0     (42)  ARGS: []                  STACK: [.. -> FIELD 0: stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1074
     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
  1075
     5:      BIPUSH      (16)  ARGS: [9]                 STACK: [.. -> value]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1076
     7:      AALOAD      (50)  ARGS: []                  STACK: [arrayRef, index -> value]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1077
     8:      CHECKCAST   (192) ARGS: [java.lang.Boolean] STACK: [objectRef -> objectRef]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1078
     11:     INVVIRT     (182) ARGS: [JavaMethodRef (java.lang.Boolean 'booleanValue'()Z)] STACK: [objectRef, [arg1, arg2, ...]  -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1079
     14:     IRETURN     (172) ARGS: []                  STACK: [value -> EMPTY]"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1080
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1081
    "Created: / 14-03-2011 / 21:36:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1082
    "Modified: / 21-03-2011 / 17:45:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1083
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1084
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1085
testGetByte
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1086
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1087
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1088
    expResult := 11.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1089
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1090
                invoke: #'getByte()B'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1091
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1092
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1093
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1094
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1095
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1096
"0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1097
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
  1098
4    bipush 7
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1099
6    aaload 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1100
7    checkcast 17 [java.lang.Byte] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1101
10   invokevirtual 31 [JavaMethodRef (java.lang.Byte 'byteValue'()B)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1102
13   ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1103
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1104
    "Created: / 14-03-2011 / 21:34:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1105
    "Modified: / 16-03-2011 / 22:04:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1106
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1107
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1108
testGetChar
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1109
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1110
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1111
    expResult := 97.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1112
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1113
                invoke: #'getChar()C'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1114
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1115
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1116
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1117
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1118
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1119
"0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1120
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
  1121
4    iconst_3 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1122
5    aaload 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1123
6    checkcast 25 [java.lang.Character] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1124
9    invokevirtual 26 [JavaMethodRef (java.lang.Character 'charValue'()C)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1125
12   ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1126
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1127
    "Created: / 14-03-2011 / 21:31:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1128
    "Modified: / 21-03-2011 / 17:45:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1129
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1130
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1131
testGetDateArray
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1132
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1133
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1134
    "again  - you're comparing java array with st array - watch out"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1135
  "/  expResult := #( nil nil nil ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1136
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1137
                invoke: #'getDateArray()[Ljava/util/Date;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1138
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1139
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1140
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1141
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1142
"/    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1143
"0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1144
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
  1145
4    bipush 8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1146
6    aaload 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1147
7    checkcast 32 [UnresolvedClass([Ljava.util.Date;)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1148
10   checkcast 32 [UnresolvedClass([Ljava.util.Date;)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1149
13   areturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1150
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1151
    "Created: / 14-03-2011 / 21:35:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1152
    "Modified: / 21-03-2011 / 17:59:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1153
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1154
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1155
testGetDouble
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1156
    | result |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1157
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1158
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1159
                invoke: #'getDouble()Ljava/lang/Double;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1160
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1161
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1162
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1163
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1164
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1165
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1166
     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
  1167
     4    iconst_2
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1168
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1169
     6    checkcast 24 [java.lang.Double]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1170
     9    areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1171
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1172
    "Created: / 14-03-2011 / 21:30:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1173
    "Modified: / 22-03-2011 / 17:10:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1174
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1175
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1176
testGetInt
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1177
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1178
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1179
    expResult := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1180
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1181
                invoke: #'getInt()I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1182
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1183
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1184
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1185
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1186
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1187
"0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1188
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
  1189
4    iconst_1 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1190
5    aaload 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1191
6    checkcast 13 [java.lang.Integer] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1192
9    invokevirtual 23 [JavaMethodRef (java.lang.Integer 'intValue'()I)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1193
12   ireturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1194
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1195
    "Created: / 14-03-2011 / 21:30:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1196
    "Modified: / 16-03-2011 / 22:05:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1197
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1198
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1199
testGetIntArray
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1200
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1201
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1202
    "again  - you're comparing java array with st array - watch out"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1203
    expResult := #( nil nil nil nil nil ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1204
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1205
                invoke: #'getIntArray()[I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1206
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1207
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1208
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1209
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1210
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1211
        invoke: #'setIntArray([I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1212
        class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1213
        receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1214
        args: result.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1215
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1216
    "/self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1217
    "0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1218
     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
  1219
     4    iconst_5
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1220
     5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1221
     6    checkcast 29 [JavaBuiltInClassPointerRef(class:IntegerArray ; name&type: '[I')]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1222
     9    checkcast 29 [JavaBuiltInClassPointerRef(class:IntegerArray ; name&type: '[I')]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1223
     12   areturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1224
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1225
    "Created: / 14-03-2011 / 21:33:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1226
    "Modified: / 21-03-2011 / 18:53:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1227
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1228
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1229
testGetLong
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1230
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1231
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1232
    expResult := 10.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1233
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1234
                invoke: #'getLong()J'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1235
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1236
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1237
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1238
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1239
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1240
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1241
"0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1242
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
  1243
4    iconst_4
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1244
5    aaload
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1245
6    checkcast 27 [java.lang.Long]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1246
9    invokevirtual 28 [JavaMethodRef (java.lang.Long 'longValue'()J)]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1247
     12   lreturn"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1248
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1249
    "Created: / 14-03-2011 / 21:32:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1250
    "Modified: / 16-03-2011 / 22:05:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1251
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1252
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1253
testGetShort
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1254
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1255
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1256
    expResult := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1257
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1258
                invoke: #'getShort()S'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1259
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1260
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1261
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1262
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1263
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1264
"0    aload_0 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1265
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
  1266
4    bipush 6
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1267
6    aaload 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1268
7    checkcast 14 [java.lang.Short] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1269
10   invokevirtual 30 [JavaMethodRef (java.lang.Short 'shortValue'()S)] 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1270
13   ireturn "
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1271
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1272
    "Created: / 14-03-2011 / 21:33:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1273
    "Modified: / 16-03-2011 / 22:06:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1274
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1275
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1276
testGetString
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1277
|result|
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1278
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1279
                invoke: #'getString()Ljava/lang/String;'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1280
                class: self loadSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1281
                receiver: self loadSimpleClassWithManyReferences new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1282
                args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1283
        self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1284
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1285
    "Modified: / 28-03-2011 / 22:40:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1286
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1287
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1288
testInitSimpleClassWithManyReferences
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1289
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1290
    | c |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1291
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1292
        invoke: #'<init>()V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1293
        class: (c := self loadSimpleClassWithManyReferences)
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1294
        receiver: c new 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1295
        args: nil.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1296
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1297
    "Created: / 28-03-2011 / 22:39:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1298
    "Modified: / 01-04-2011 / 14:54:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1299
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1300
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1301
testLookupSwitch
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1302
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1303
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1304
    expResult := -1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1305
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1306
                invoke: #'switchInt(I)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1307
                class: self loadSwitchExamplesClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1308
                receiver: self loadSwitchExamplesClass new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1309
                args: #(-1000).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1310
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1311
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1312
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1313
    "Created: / 21-03-2011 / 13:51:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1314
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1315
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1316
testSetBoolean
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1317
    | inst |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1318
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1319
    inst := self loadSimpleClassWithManyReferences new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1320
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1321
        invoke: #'setBoolean(I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1322
        class: inst class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1323
        receiver: inst
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1324
        args: #( 5 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1325
    self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1326
        invoke: #'setBoolean(I)V'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1327
        class: inst class
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1328
        receiver: inst
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1329
        args: #( 4 ).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1330
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1331
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1332
1:      ILOAD_1     (27)  ARGS: []                  STACK: [.. -> FIELD 1: 'Arg 1']
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1333
2:      ICONST_2    (5)   ARGS: []                  STACK: [.. -> 2]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1334
3:      IREM        (112) ARGS: []                  STACK: [value, value -> result]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1335
4:      IFNE        (154) ARGS: [JMP to: 20]        STACK: [value -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1336
7:      ALOAD_0     (42)  ARGS: []                  STACK: [.. -> FIELD 0: stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1337
8:      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
  1338
11:     BIPUSH      (16)  ARGS: [9]                 STACK: [.. -> value]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1339
13:     GETSTATIC   (178) ARGS: [JavaFieldRef (java.lang.Boolean 'TRUE'Ljava/lang/Boolean; offs=29)] STACK: [.. -> objectRef]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1340
16:     AASTORE     (83)  ARGS: []                  STACK: [arrayRef, index, value -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1341
17:     GOTO        (167) ARGS: [JMP to: 31]        STACK: [.. -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1342
20:     ALOAD_0     (42)  ARGS: []                  STACK: [.. -> FIELD 0: stx.libjava.tests.simpleClasses.SimpleClassWithManyReferences]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1343
21:     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
  1344
24:     BIPUSH      (16)  ARGS: [9]                 STACK: [.. -> value]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1345
26:     ICONST_0    (3)   ARGS: []                  STACK: [.. -> 0]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1346
27:     INVSTATIC   (184) ARGS: [JavaMethodRef (java.lang.Boolean 'valueOf'(Z)Ljava/lang/Boolean;)] STACK: [[arg1, arg2, ...]  -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1347
30:     AASTORE     (83)  ARGS: []                  STACK: [arrayRef, index, value -> ..]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1348
31:     RETURN      (177) ARGS: []                  STACK: [.. -> EMPTY]"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1349
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1350
    "Created: / 21-03-2011 / 18:53:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1351
    "Modified: / 22-03-2011 / 12:18:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1352
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1353
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1354
testTableSwitch
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1355
    | result  expResult |
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1356
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1357
    expResult := 1.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1358
    result := self 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1359
                invoke: #'switchChar(C)I'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1360
                class: self loadSwitchExamplesClass
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1361
                receiver: self loadSwitchExamplesClass new
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1362
                args: #($b).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1363
    self assertFalse: (result isNil).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1364
    self assertTrue: (result = expResult).
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1365
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1366
    "Created: / 21-03-2011 / 13:51:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1367
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1368
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1369
!JavaByteCodeInterpreterTests class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1370
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1371
version_SVN
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1372
    ^ '$Id$'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
  1373
! !