<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="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 id="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">
<p>Sorry for the missing explanation. The test now assures that it is possible to add a new item to the copied OrderedDictionary, without any error occurring.</p>
<p><br>
</p>
<p>In the current Trunk, this test fails because #copyFrom:to: does not reserve space for at least one nil item in order. This leads to an error when growing up the OrderedDictionary, because temporarily while running #atNewIndex:put:, tally is greater than
 order size.</p>
<p>As the class comment in HashedCollection states for array, that "<span>there is always at least one nil", I think the same invariant should go for order in OrderedDictionary? Also, in OrderedDictionary >> #initialize: and OrderedDictionary >> #growTo:, the
 same "+ 1" is used for computing the order size.</span></p>
<p><span><br>
</span></p>
<p><span>I was not aware of #goodPrimes, but why should it be erroneous? They're all primes :)</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="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 Taeumel, Marcel<br>
<b>Gesendet:</b> Freitag, 27. September 2019 16:28:36<br>
<b>An:</b> Alan Grimes via Squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: CollectionsTests-ct.321.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size:10pt; font-family:Arial; color:#000000">
I think you find a bug regarding the recent change in HashedCollection class >> #goodPrimes. Yet, what does this test do? A comment would be nice. :-) Same for Collections-ct.857 regarding that "array+1".
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid; border-width:1px; margin-top:20px; margin-left:0px; padding-left:10px">
<p style="color:#AAAAAA; margin-top:10px">Am 27.09.2019 16:15:30 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of CollectionsTests was added to project The Inbox:<br>
http://source.squeak.org/inbox/CollectionsTests-ct.321.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: CollectionsTests-ct.321<br>
Author: ct<br>
Time: 27 September 2019, 4:15:21.022642 pm<br>
UUID: 6638fd69-d57a-7e43-a99c-2d99b52a0b36<br>
Ancestors: CollectionsTests-jr.320<br>
<br>
Extend OrderedDictionaryTest >> #testCopyFromTo to reveal a bug<br>
<br>
=============== Diff against CollectionsTests-jr.320 ===============<br>
<br>
Item was changed:<br>
----- Method: OrderedDictionaryTest>>testCopyFromTo (in category 'tests - copying') -----<br>
testCopyFromTo<br>
<br>
+ | copy |<br>
1 to: 10 do: [:index |<br>
sut at: index put: nil].<br>
<br>
+ copy := sut copyFrom: 3 to: 5.<br>
+ self assert: (3 to: 5) asArray equals: copy keys.<br>
+ copy at: 3 put: #foo.<br>
+ self assert: (sut at: 3) isNil.<br>
+ <br>
+ copy at: 11 put: #ba.<br>
+ self assert: #ba equals: (copy at: 11).!<br>
- (sut copyFrom: 3 to: 5) in: [:copy |<br>
- self assert: (3 to: 5) asArray equals: copy keys.<br>
- copy at: 3 put: #foo.<br>
- self assert: (sut at: 3) isNil.].!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>