RegressionTests__BehaviorLookupObjectTests.st
author Jan Vrany <jan.vrany@labware.com>
Mon, 08 Mar 2021 11:25:35 +0000
branchjv
changeset 2594 e5f39c0a5bd6
parent 1974 f2eaf05205d6
permissions -rwxr-xr-x
Improve UTF8 read/write tests in `ChangeSetTests`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1974
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     1
"
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     2
 COPYRIGHT (c) Claus Gittinger / eXept Software AG
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     3
 COPYRIGHT (c) 2016 Jan Vrany
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     4
              All Rights Reserved
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     5
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     6
 This software is furnished under a license and may be used
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     7
 only in accordance with the terms of that license and with the
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
     9
 be provided or otherwise made available to, or used by, any
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    10
 other person.  No title to or ownership of the software is
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    11
 hereby transferred.
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    12
"
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
    13
"{ Package: 'stx:goodies/regression' }"
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
"{ NameSpace: RegressionTests }"
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
TestCase subclass:#BehaviorLookupObjectTests
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	instanceVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	classVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	poolDictionaries:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	category:'tests-Regression'
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
Object subclass:#BadLookupClass
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
	instanceVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	classVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
	poolDictionaries:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	privateIn:BehaviorLookupObjectTests
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
Object subclass:#ClassWithSpecialLookup
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
	instanceVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
	classVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
	poolDictionaries:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
	privateIn:BehaviorLookupObjectTests
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
Object subclass:#LookupClass
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
	instanceVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
	classVariableNames:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
	poolDictionaries:''
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
	privateIn:BehaviorLookupObjectTests
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    45
Object subclass:#NilReturningLookupClass
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    46
	instanceVariableNames:''
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    47
	classVariableNames:''
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    48
	poolDictionaries:''
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    49
	privateIn:BehaviorLookupObjectTests
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    50
!
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
    51
1974
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    52
!BehaviorLookupObjectTests class methodsFor:'documentation'!
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    53
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    54
copyright
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    55
"
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    56
 COPYRIGHT (c) Claus Gittinger / eXept Software AG
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    57
 COPYRIGHT (c) 2016 Jan Vrany
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    58
              All Rights Reserved
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    59
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    60
 This software is furnished under a license and may be used
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    61
 only in accordance with the terms of that license and with the
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    62
 inclusion of the above copyright notice.   This software may not
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    63
 be provided or otherwise made available to, or used by, any
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    64
 other person.  No title to or ownership of the software is
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    65
 hereby transferred.
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    66
"
f2eaf05205d6 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1504
diff changeset
    67
! !
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!BehaviorLookupObjectTests methodsFor:'helpers'!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
1504
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    71
callConstant98765
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    72
    ^ self returnConstant98765
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    73
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    74
    "Created: / 11-07-2016 / 06:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    75
    "Modified: / 11-07-2016 / 08:49:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    76
!
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    77
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    78
returnConstant12345
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    79
    ^ 12345
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    80
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    81
    "Created: / 11-07-2016 / 08:48:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    82
!
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
    83
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
returnConstant98765
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    ^ 98765
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
! !
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
!BehaviorLookupObjectTests methodsFor:'tests'!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
testLookupObject_01a
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    self should:[ ClassWithSpecialLookup new x ] raise:MessageNotUnderstood.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "/ at some time during the development, it crashed the second time,
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "/ due to a badly updated inlineCache
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    self should:[ ClassWithSpecialLookup new x ] raise:MessageNotUnderstood.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
testLookupObject_01b
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    |firstException rslt|
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    firstException := true.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    "/ catch it, and proceed without a method (leads to another dnu)...
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    MessageNotUnderstood handle:[:ex |
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
        firstException ifTrue:[
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
            firstException := false.    
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
            self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   110
            self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   111
            self assert:(ex suspendedContext sender sender sender selector == #x).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   112
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   113
            "/ Remove the lookup object (the original test has been written
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   114
            "/ for implementation that flushes the lookup object)
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   115
            ClassWithSpecialLookup setLookupObject:nil.
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   116
            ObjectMemory flushInlineCaches. 
560
cf65fb8e9c54 changed:
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   117
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
            "/ here, we return a method...
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
            ex proceedWith:nil.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
        ].
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
        self assert:(ex suspendedContext sender selector == #x).
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
        ex proceedWith:12345.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    ] do:[
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
        ObjectMemory flushInlineCaches.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
        rslt := ClassWithSpecialLookup new x
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    ].
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    self assert:(rslt = 12345).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   131
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   132
    "Modified: / 11-07-2016 / 06:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
testLookupObject_01c
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    |rslt|
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    "/ catch it, and proceed with a method...
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    MessageNotUnderstood handle:[:ex |
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   141
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   142
        self assert:(ex suspendedContext sender sender sender selector  == #x).
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
        "/ here, we return a method...
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    ] do:[
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
        ObjectMemory flushInlineCaches.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
        rslt := ClassWithSpecialLookup new x
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    ].
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    self assert:(rslt = 98765).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   152
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   153
    "Modified: / 10-07-2016 / 00:31:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
testLookupObject_02
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "/ check lookupObject with 2.. arguments
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   158
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    self should:[ ClassWithSpecialLookup new x:1234 ] raise:MessageNotUnderstood.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   161
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    self should:[ ClassWithSpecialLookup new a1:1 a2:2] raise:MessageNotUnderstood.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   164
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   165
    self should:[ ClassWithSpecialLookup new a1:1 a2:2 a3:3] raise:MessageNotUnderstood.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   166
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   167
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   168
    self should:[ ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4] raise:MessageNotUnderstood.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   169
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   170
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   171
    self should:[ ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5] raise:MessageNotUnderstood.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   172
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   173
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   174
    self should:[ ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6] raise:MessageNotUnderstood.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   175
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   176
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   177
    self should:[ ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7] raise:MessageNotUnderstood.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   178
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   179
    ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   180
    self should:[ ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8] raise:MessageNotUnderstood.
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
testLookupObject_02c
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    |rslt|
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
    "/ catch it, and proceed with a method...
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   187
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   188
    "/ 1 arg...
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    MessageNotUnderstood handle:[:ex |
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   191
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   192
        self assert:(ex suspendedContext sender sender sender selector == #x:).
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
        "/ here, we return a method...
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    ] do:[
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
        ObjectMemory flushInlineCaches.
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
        rslt := ClassWithSpecialLookup new x:1234
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    ].
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   200
    self assert:(rslt = 98765).
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   202
    "/ 2 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   203
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   204
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   205
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   206
        self assert:(ex suspendedContext sender sender sender selector == #a:b:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   207
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   208
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   209
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   210
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   211
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   212
        rslt := ClassWithSpecialLookup new a:1 b:2
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   213
    ].
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    self assert:(rslt = 98765).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   215
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   216
    "/ 3 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   217
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   218
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   219
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   220
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   221
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   222
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   223
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   224
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   225
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   226
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   227
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   228
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   229
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   230
    "/ 4 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   231
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   232
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   233
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   234
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   235
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   236
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   237
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   238
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   239
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   240
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   241
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   242
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   243
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   244
    "/ 5 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   245
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   246
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   247
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   248
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   249
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   250
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   251
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   252
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   253
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   254
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   255
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   256
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   257
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   258
    "/ 6 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   259
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   260
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   261
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   262
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   263
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   264
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   265
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   266
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   267
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   268
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   269
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   270
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   271
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   272
    "/ 7 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   273
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   274
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   275
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   276
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   277
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   278
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   279
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   280
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   281
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   282
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   283
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   284
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   285
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   286
    "/ 8 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   287
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   288
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   289
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   290
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   291
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   292
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   293
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   294
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   295
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   296
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   297
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   298
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   299
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   300
    "/ 9 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   301
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   302
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   303
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   304
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   305
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   306
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   307
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   308
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   309
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   310
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   311
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   312
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   313
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   314
    "/ 10 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   315
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   316
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   317
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   318
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:j:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   319
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   320
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   321
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   322
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   323
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   324
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9 j:10
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   325
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   326
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   327
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   328
    "/ 11 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   329
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   330
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   331
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   332
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:j:k:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   333
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   334
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   335
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   336
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   337
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   338
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9 j:10 k:11
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   339
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   340
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   341
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   342
    "/ 12 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   343
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   344
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   345
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   346
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:j:k:l:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   347
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   348
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   349
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   350
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   351
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   352
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9 j:10 k:11 l:12
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   353
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   354
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   355
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   356
    "/ 13 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   357
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   358
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   359
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   360
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:j:k:l:m:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   361
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   362
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   363
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   364
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   365
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   366
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9 j:10 k:11 l:12 m:13
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   367
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   368
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   369
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   370
    "/ 14 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   371
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   372
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   373
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   374
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:j:k:l:m:n:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   375
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   376
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   377
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   378
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   379
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   380
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9 j:10 k:11 l:12 m:13 n:14
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   381
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   382
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   383
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   384
    "/ 15 args...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   385
    MessageNotUnderstood handle:[:ex |
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   386
        self assert:(ex suspendedContext selector == #doesNotUnderstand:).
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   387
        self assert:(ex suspendedContext sender selector == #lookupMethodForSelector:directedTo:for:withArguments:from:ilc:).
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   388
        self assert:(ex suspendedContext sender sender sender selector == #a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:).
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   389
        "/ here, we return a method...
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   390
        ex proceedWith:(self class compiledMethodAt:#returnConstant98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   391
    ] do:[
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   392
        ClassWithSpecialLookup setLookupObject:BadLookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   393
        ObjectMemory flushInlineCaches.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   394
        rslt := ClassWithSpecialLookup new a:1 b:2 c:3 d:4 e:5 f:6 g:7 h:8 i:9 j:10 k:11 l:12 m:13 n:14 o:15
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   395
    ].
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   396
    self assert:(rslt = 98765).
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   397
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   398
    "Modified: / 10-07-2016 / 00:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   399
!
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   400
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   401
testLookupObject_03
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   402
    "/ check good lookupObject with 0.. arguments
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   403
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   404
    self assert:( ClassWithSpecialLookup new x ) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   405
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   406
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   407
    self assert:( ClassWithSpecialLookup new x:1234 ) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   408
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   409
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   410
    self should:( ClassWithSpecialLookup new a1:1 a2:2) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   411
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   412
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   413
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   414
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   415
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   416
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   417
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   418
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   419
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   420
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   421
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   422
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   423
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   424
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   425
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   426
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   427
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   428
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   429
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   430
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   431
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   432
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   433
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   434
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9 a10:10) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   435
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   436
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   437
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9 a10:10 a11:11) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   438
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   439
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   440
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9 a10:10 a11:11 a12:12) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   441
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   442
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   443
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9 a10:10 a11:11 a12:12 a13:13) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   444
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   445
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   446
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9 a10:10 a11:11 a12:12 a13:13 a14:14) = 12345.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   447
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   448
    ClassWithSpecialLookup setLookupObject:LookupClass.
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   449
    self should:( ClassWithSpecialLookup new a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8 a9:9 a10:10 a11:11 a12:12 a13:13 a14:14 a15:15) = 12345.
1504
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   450
!
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   451
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   452
testLookupObject_04
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   453
    | x |
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   454
    self assert: self callConstant98765 == 98765.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   455
    [ 
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   456
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   457
        (self class compiledMethodAt: #callConstant98765) setLookupObject: LookupClass.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   458
        ObjectMemory flushCaches.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   459
        ObjectMemory debugBreakPoint3.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   460
        x := self callConstant98765.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   461
        self assert: x == 12345.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   462
    ] ensure:[ 
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   463
        (self class compiledMethodAt: #callConstant98765) setLookupObject: nil.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   464
        ObjectMemory flushCaches.
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   465
    ].
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   466
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   467
    "Created: / 11-07-2016 / 06:25:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6bda790dc68a Issue #73: Added test for caller-specified lookup object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1503
diff changeset
   468
    "Modified: / 11-07-2016 / 08:49:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   469
! !
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   470
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   471
!BehaviorLookupObjectTests::LookupClass class methodsFor:'lookup'!
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   472
560
cf65fb8e9c54 changed:
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   473
lookupMethodForSelector:aSelector directedTo:searchClass for:aReceiver withArguments:argArrayOrNil from:sendingContext
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   474
    ^ self compiledMethodAt:#returnConstant12345
996
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   475
!
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   476
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   477
lookupMethodForSelector:aSelector directedTo:searchClass for:aReceiver withArguments:argArrayOrNil from:sendingContext ilc: ilc
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   478
    ^ self compiledMethodAt:#returnConstant12345
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   479
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   480
    "Created: / 04-09-2013 / 19:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   481
! !
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   482
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   483
!BehaviorLookupObjectTests::LookupClass methodsFor:'trap methods'!
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   484
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   485
returnConstant12345
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   486
    ^ 12345
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   487
! !
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   488
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   489
!BehaviorLookupObjectTests::NilReturningLookupClass class methodsFor:'lookup'!
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   490
560
cf65fb8e9c54 changed:
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   491
lookupMethodForSelector:aSelector directedTo:searchClass for:aReceiver withArguments:argArrayOrNil from:sendingContext
559
92ef051a8990 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   492
    ^ nil
996
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   493
!
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   494
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   495
lookupMethodForSelector:aSelector directedTo:searchClass for:aReceiver withArguments:argArrayOrNil from:sendingContext ilc: ilc
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   496
    ^ nil
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   497
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   498
    "Created: / 04-09-2013 / 19:26:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
! !
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
!BehaviorLookupObjectTests class methodsFor:'documentation'!
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
version_CVS
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
    ^ '$Header$'
1503
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   505
!
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   506
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   507
version_HG
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   508
1551e9fd9a91 Issue #73: Added (and fixed) BehaviorLookupObjectTests to standard test suite.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   509
    ^ '$Changeset: <not expanded> $'
558
42dd167a9462 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
! !
996
b2247dd458ed class: RegressionTests::BehaviorLookupObjectTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 561
diff changeset
   511