<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Thank you, finally! :-)</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Montag, 12. April 2021 20:30:55<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: KernelTests-eem.396.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Eliot Miranda uploaded a new version of KernelTests to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/KernelTests-eem.396.mcz">http://source.squeak.org/trunk/KernelTests-eem.396.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: KernelTests-eem.396<br>
Author: eem<br>
Time: 12 April 2021, 11:30:53.654392 am<br>
UUID: 642cd275-3ce5-4cfb-a34f-1bb29d140e94<br>
Ancestors: KernelTests-codefrau.395<br>
<br>
Rename MethodContextTest to ContextTest<br>
<br>
=============== Diff against KernelTests-codefrau.395 ===============<br>
<br>
Item was added:<br>
+ TestCase subclass: #ContextTest<br>
+        instanceVariableNames: 'aCompiledMethod aReceiver aSender aContext'<br>
+        classVariableNames: ''<br>
+        poolDictionaries: ''<br>
+        category: 'KernelTests-Methods'!<br>
+ <br>
+ !ContextTest commentStamp: 'ct 1/27/2020 13:03' prior: 0!<br>
+ I am an SUnit Test of Context. See also BlockClosureTest.<br>
+ See pages 430-437 of A. Goldberg and D. Robson's Smalltalk-80 The Language (aka the purple book), which deal with Contexts. My fixtures are from their example. To see how blocks are implemented in this version of Squeak see
<a href="http://www.mirandabanda.org/cogblog/2008/06/07/closures-part-i/">http://www.mirandabanda.org/cogblog/2008/06/07/closures-part-i/</a> and
<a href="http://www.mirandabanda.org/cogblog/2008/07/22/closures-part-ii-the-bytecodes/">
http://www.mirandabanda.org/cogblog/2008/07/22/closures-part-ii-the-bytecodes/</a>.  (The Squeak V3 byte codes are not quite the same as Smalltalk-80, and the SistaV1 byetcodes are quite different.)<br>
+ My fixtures are:<br>
+ aReceiver                     - just some arbitrary object, "Rectangle origin: 100@100 corner: 200@200"<br>
+ aSender                       - just some arbitrary object, thisContext<br>
+ aCompiledMethod       - just some arbitrary method, "Rectangle rightCenter".<br>
+ aContext                      - just some arbitray context ...  <br>
+ <br>
+ !<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>privRestartTest (in category 'private') -----<br>
+ privRestartTest<br>
+        "This tests may loop endlessly if incorrect, so call it from another method testing it does not time out"<br>
+        |a firstTimeThrough |<br>
+        firstTimeThrough := true.<br>
+        a := 10.<br>
+        <br>
+        self assert: 30 equals: [|b| <br>
+                self assert: 10 = a .<br>
+                self assert: nil == b.<br>
+                b := a + 20. <br>
+                firstTimeThrough ifTrue: [<br>
+                        firstTimeThrough := false.<br>
+                        thisContext restart.].<br>
+                b] value<br>
+ !<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>setUp (in category 'running') -----<br>
+ setUp<br>
+        super setUp.<br>
+        aCompiledMethod := Rectangle methodDict at: #rightCenter.<br>
+        aReceiver := 100@100 corner: 200@200.<br>
+        aSender := thisContext.<br>
+        aContext := Context sender: aSender receiver: aReceiver method: aCompiledMethod arguments: #(). !<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testActivateReturnValue (in category 'tests') -----<br>
+ testActivateReturnValue<br>
+        self assert:  (aSender activateReturn: aContext value: #()) isContext.<br>
+        self assert:  ((aSender activateReturn: aContext value: #()) receiver = aContext).!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testCopyStack (in category 'tests') -----<br>
+ testCopyStack<br>
+        self assert: aContext copyStack printString = aContext printString.!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testCopyTo (in category 'tests') -----<br>
+ testCopyTo<br>
+ <br>
+        | context depth targetSender |<br>
+        context := thisContext.<br>
+        depth := 1.<br>
+        targetSender := context.<br>
+        [ (targetSender := targetSender sender) isNil ] whileFalse: [<br>
+                | original copy |<br>
+                original := context.<br>
+                copy := context copyTo: targetSender.<br>
+                1 to: depth do: [ :index |<br>
+                        index = 1 ifFalse: [ <br>
+                                "Since we're copying thisContext, the pc and stackPtr may be different for the current frame."<br>
+                                self<br>
+                                        assert: original pc equals: copy pc;<br>
+                                        assert: original stackPtr equals: copy stackPtr ].<br>
+                        self<br>
+                                deny: original == copy;<br>
+                                assert: original method equals: copy method;<br>
+                                assert: original closure equals: copy closure;<br>
+                                assert: original receiver equals: copy receiver.<br>
+                        original := original sender.<br>
+                        copy := copy sender ].<br>
+                self<br>
+                        assert: copy isNil;<br>
+                        assert: original == targetSender.<br>
+                depth := depth + 1 ]!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testFindContextSuchThat (in category 'tests') -----<br>
+ testFindContextSuchThat<br>
+        self assert: (aContext findContextSuchThat: [:each| true]) printString = aContext printString.<br>
+        self assert: (aContext hasContext: aContext). !<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testMethodContext (in category 'tests') -----<br>
+ testMethodContext<br>
+        self assert: aContext home notNil.<br>
+        self assert: aContext receiver notNil.<br>
+        self assert: aContext method isCompiledMethod.!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testMethodIsBottomContext (in category 'tests') -----<br>
+ testMethodIsBottomContext<br>
+        self assert: aContext bottomContext = aSender.<br>
+        self assert: aContext secondFromBottom = aContext.!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testPrimitive100 (in category 'tests') -----<br>
+ testPrimitive100<br>
+ <br>
+        {<br>
+                {#isNil. {}. Object}. "valid 0-arg message"<br>
+                {#=. {true}. UndefinedObject}. "valid unary message"<br>
+                {#ifNil:ifNotNil:. {[2]. [:x | x]}. Object}. "valid binary message"<br>
+                {}. "missing selector"<br>
+                {#isNil}. "missing arguments"<br>
+                {#isNil. 'not an array'}. "invalid arguments"<br>
+                {#isNil. {}}. "missing lookupClass"<br>
+                {#isNil. {'excess arg'}. Object}. "too many arguments"<br>
+                {#=. {}. UndefinedObject}. "missing argument"<br>
+                {#isNil. {}. Boolean}. "lookupClass not in inheritance chain"<br>
+        } do: [:args |<br>
+                self<br>
+                        assert: (Context runSimulated: [nil tryPrimitive: 100 withArgs: args])<br>
+                        equals: (nil tryPrimitive: 100 withArgs: args)].!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testPrimitive83 (in category 'tests') -----<br>
+ testPrimitive83<br>
+ <br>
+        {<br>
+                {#isNil}. "valid 0-arg message"<br>
+                {#=. true}. "valid unary message"<br>
+                {#ifNil:ifNotNil:. [2]. [:x | x]}. "valid binary message"<br>
+                {}. "missing selector"<br>
+                {#isNil. 'excess arg'}. "too many arguments"<br>
+                {#=}. "missing argument"<br>
+        } do: [:args |<br>
+                self<br>
+                        assert: (Context runSimulated: [nil tryPrimitive: 83 withArgs: args])<br>
+                        equals: (nil tryPrimitive: 83 withArgs: args)].!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testPrimitive84 (in category 'tests') -----<br>
+ testPrimitive84<br>
+ <br>
+        {<br>
+                {#isNil. {}}. "valid 0-arg message"<br>
+                {#=. {true}}. "valid unary message"<br>
+                {#ifNil:ifNotNil:. {[2]. [:x | x]}}. "valid binary message"<br>
+                {}. "missing selector"<br>
+                {#isNil}. "missing arguments"<br>
+                {#isNil. 'not an array'}. "invalid arguments"<br>
+                {#isNil. {'excess arg'}}. "too many arguments"<br>
+                {#=. {}}. "missing argument"<br>
+        } do: [:args |<br>
+                self<br>
+                        assert: (Context runSimulated: [nil tryPrimitive: 84 withArgs: args])<br>
+                        equals: (nil tryPrimitive: 84 withArgs: args)].!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testRestart (in category 'tests') -----<br>
+ testRestart<br>
+        self should: [self privRestartTest] notTakeMoreThan: 0.1 second!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testReturn (in category 'tests') -----<br>
+ testReturn<br>
+        "Why am I overriding setUp? Because sender must be thisContext, i.e, testReturn, not setUp."<br>
+        aContext := Context sender: thisContext receiver: aReceiver method: aCompiledMethod arguments: #().
<br>
+        self assert: (aContext return: 5) = 5!<br>
<br>
Item was added:<br>
+ ----- Method: ContextTest>>testSetUp (in category 'tests') -----<br>
+ testSetUp<br>
+        "Note: In addition to verifying that the setUp worked the way it was expected to, testSetUp is used to illustrate the meaning of the simple access methods, methods that are not normally otherwise 'tested'"<br>
+        self assert: aContext isContext.<br>
+        self deny: aContext isExecutingBlock.<br>
+        self deny: aContext isClosure.<br>
+        self deny: aContext isDead.<br>
+        "self assert: aMethodContext home = aReceiver."<br>
+        "self assert: aMethodContext blockHome = aReceiver."<br>
+        self assert: aContext receiver = aReceiver.<br>
+        self assert: aContext method isCompiledMethod.<br>
+        self assert: aContext method = aCompiledMethod.<br>
+        self assert: aContext methodNode selector = #rightCenter.<br>
+        self assert: (aContext methodNodeFormattedAndDecorated: true) selector = #rightCenter.<br>
+        self assert: aContext client printString = 'ContextTest>>#testSetUp'.<br>
+ !<br>
<br>
Item was removed:<br>
- TestCase subclass: #MethodContextTest<br>
-        instanceVariableNames: 'aCompiledMethod aReceiver aMethodContext aSender'<br>
-        classVariableNames: ''<br>
-        poolDictionaries: ''<br>
-        category: 'KernelTests-Methods'!<br>
- <br>
- !MethodContextTest commentStamp: 'eem 3/30/2017 17:42' prior: 0!<br>
- I am an SUnit Test of Context. See also BlockClosureTest.<br>
- See pages 430-437 of A. Goldberg and D. Robson's Smalltalk-80 The Language (aka the purple book), which deal with Contexts. My fixtures are from their example. To see how blocks are implemented in this version of Squeak see
<a href="http://www.mirandabanda.org/cogblog/2008/06/07/closures-part-i/">http://www.mirandabanda.org/cogblog/2008/06/07/closures-part-i/</a> and
<a href="http://www.mirandabanda.org/cogblog/2008/07/22/closures-part-ii-the-bytecodes/">
http://www.mirandabanda.org/cogblog/2008/07/22/closures-part-ii-the-bytecodes/</a>.  (The Squeak V3 byte codes are not quite the same as Smalltalk-80, and the SistaV1 byetcodes are quite different.)<br>
- My fixtures are:<br>
- aReceiver         - just some arbitrary object, "Rectangle origin: 100@100 corner: 200@200"<br>
- aSender           - just some arbitrary object, thisContext<br>
- aCompiledMethod - just some arbitrary method, "Rectangle rightCenter".<br>
- aMethodContext   - just some arbitray context ...  <br>
- <br>
- !<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>privRestartTest (in category 'private') -----<br>
- privRestartTest<br>
-        "This tests may loop endlessly if incorrect, so call it from another method testing it does not time out"<br>
-        |a firstTimeThrough |<br>
-        firstTimeThrough := true.<br>
-        a := 10.<br>
-        <br>
-        self assert: 30 equals: [|b| <br>
-                self assert: 10 = a .<br>
-                self assert: nil == b.<br>
-                b := a + 20. <br>
-                firstTimeThrough ifTrue: [<br>
-                        firstTimeThrough := false.<br>
-                        thisContext restart.].<br>
-                b] value<br>
- !<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>setUp (in category 'running') -----<br>
- setUp<br>
-        super setUp.<br>
-        aCompiledMethod := Rectangle methodDict at: #rightCenter.<br>
-        aReceiver := 100@100 corner: 200@200.<br>
-        aSender := thisContext.<br>
-        aMethodContext := Context sender: aSender receiver: aReceiver method: aCompiledMethod arguments: #(). !<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testActivateReturnValue (in category 'tests') -----<br>
- testActivateReturnValue<br>
-        self assert:  (aSender activateReturn: aMethodContext value: #()) isContext.<br>
-        self assert:  ((aSender activateReturn: aMethodContext value: #()) receiver = aMethodContext).!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testCopyStack (in category 'tests') -----<br>
- testCopyStack<br>
-        self assert: aMethodContext copyStack printString = aMethodContext printString.!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testCopyTo (in category 'tests') -----<br>
- testCopyTo<br>
- <br>
-        | context depth targetSender |<br>
-        context := thisContext.<br>
-        depth := 1.<br>
-        targetSender := context.<br>
-        [ (targetSender := targetSender sender) isNil ] whileFalse: [<br>
-                | original copy |<br>
-                original := context.<br>
-                copy := context copyTo: targetSender.<br>
-                1 to: depth do: [ :index |<br>
-                        index = 1 ifFalse: [ <br>
-                                "Since we're copying thisContext, the pc and stackPtr may be different for the current frame."<br>
-                                self<br>
-                                        assert: original pc equals: copy pc;<br>
-                                        assert: original stackPtr equals: copy stackPtr ].<br>
-                        self<br>
-                                deny: original == copy;<br>
-                                assert: original method equals: copy method;<br>
-                                assert: original closure equals: copy closure;<br>
-                                assert: original receiver equals: copy receiver.<br>
-                        original := original sender.<br>
-                        copy := copy sender ].<br>
-                self<br>
-                        assert: copy isNil;<br>
-                        assert: original == targetSender.<br>
-                depth := depth + 1 ]!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testFindContextSuchThat (in category 'tests') -----<br>
- testFindContextSuchThat<br>
-        self assert: (aMethodContext findContextSuchThat: [:each| true]) printString = aMethodContext printString.<br>
-        self assert: (aMethodContext hasContext: aMethodContext). !<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testMethodContext (in category 'tests') -----<br>
- testMethodContext<br>
-        self assert: aMethodContext home notNil.<br>
-        self assert: aMethodContext receiver notNil.<br>
-        self assert: aMethodContext method isCompiledMethod.!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testMethodIsBottomContext (in category 'tests') -----<br>
- testMethodIsBottomContext<br>
-        self assert: aMethodContext bottomContext = aSender.<br>
-        self assert: aMethodContext secondFromBottom = aMethodContext.!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testRestart (in category 'tests') -----<br>
- testRestart<br>
-        self should: [self privRestartTest] notTakeMoreThan: 0.1 second!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testReturn (in category 'tests') -----<br>
- testReturn<br>
-        "Why am I overriding setUp? Because sender must be thisContext, i.e, testReturn, not setUp."<br>
-        aMethodContext := Context sender: thisContext receiver: aReceiver method: aCompiledMethod arguments: #().
<br>
-        self assert: (aMethodContext return: 5) = 5!<br>
<br>
Item was removed:<br>
- ----- Method: MethodContextTest>>testSetUp (in category 'tests') -----<br>
- testSetUp<br>
-        "Note: In addition to verifying that the setUp worked the way it was expected to, testSetUp is used to illustrate the meaning of the simple access methods, methods that are not normally otherwise 'tested'"<br>
-        self assert: aMethodContext isContext.<br>
-        self deny: aMethodContext isExecutingBlock.<br>
-        self deny: aMethodContext isClosure.<br>
-        self deny: aMethodContext isDead.<br>
-        "self assert: aMethodContext home = aReceiver."<br>
-        "self assert: aMethodContext blockHome = aReceiver."<br>
-        self assert: aMethodContext receiver = aReceiver.<br>
-        self assert: aMethodContext method isCompiledMethod.<br>
-        self assert: aMethodContext method = aCompiledMethod.<br>
-        self assert: aMethodContext methodNode selector = #rightCenter.<br>
-        self assert: (aMethodContext methodNodeFormattedAndDecorated: true) selector = #rightCenter.<br>
-        self assert: aMethodContext client printString = 'MethodContextTest>>#testSetUp'.<br>
- !<br>
<br>
<br>
</div>
</span></font>
</body>
</html>