<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Georgia">Well, </font>testThatByteArrayLongAtDoesPreserveSignAndDoesNotSignalAnError<br>
<br>
since the original bug was that<br>
<br>
(ByteArray new: 4) longAt: 1 put: -1 bigEndian: true<br>
<br>
resulted in a walkback. Although I do wonder if we are not crossing
over into the realm of too much information.<br>
<br>
Cheers,<br>
Bob<br>
<br>
<div class="moz-cite-prefix">On 11/5/13 6:33 AM, Nicolas Cellier
wrote:<br>
</div>
<blockquote
cite="mid:CAKnRiT4f7J5+WwTWed67uxsUNYML6gQY5a5Wan342HMiCJ5cpA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div> | ba value |<br>
ba := ByteArray new: 4.<br>
value := -1.<br>
ba longAt: 1 put: value bigEndian: true.<br>
self assert: (ba longAt: 1 bigEndian: true) = (ba longAt:
1 bigEndian: false).<br>
<br>
Thanks Bob, that makes sense<br>
but intention can't be revealed without this context, so the
code is not good enough.<br>
<br>
</div>
At least, it should be named something like
testThatByteArrayLongAtDoesPreserveSign.<br>
<br>
<br>
<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2013/11/5 Bob Arning <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:arning315@comcast.net"
target="_blank">arning315@comcast.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font face="Georgia">Just
a guess, but I think the test was written to show that a
particular bug had been fixed. Endian wasn't an issue
here - negative numbers were.<br>
<br>
<a moz-do-not-send="true"
href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2003-August/063928.html"
target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2003-August/063928.html</a><br>
<br>
Cheers,<br>
Bob<br>
<br>
</font>
<div>
<div class="h5">
<div>On 11/5/13 3:24 AM, Frank Shearar wrote:<br>
</div>
<blockquote type="cite">
<div>Do I understand correctly that this test just
shows that you can use a ByteArray to store ints
in a endian aware way? If so, why did Andreas use
-1, which wouldn't show an endian reversal?<br>
<br>
frank</div>
<div><br>
On 04 Nov 2013, at 22:04, Nicolas Cellier <<a
moz-do-not-send="true"
href="mailto:nicolas.cellier.aka.nice@gmail.com"
target="_blank">nicolas.cellier.aka.nice@gmail.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Beside the form, isn't -1 a
palindrome? (if you reverse bit/bytes you
still get -1, so it's a poor value)<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2013/11/4 Frank
Shearar <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:frank.shearar@gmail.com"
target="_blank">frank.shearar@gmail.com</a>></span><br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">I really hate
just having the lines under test just
lying around like this:<br>
<br>
testByteArrayLongAt<br>
| ba value |<br>
<div> ba := ByteArray new: 4.<br>
</div>
value := -1.<br>
ba longAt: 1 put: value bigEndian:
true.<br>
<div> self assert: (ba longAt: 1
bigEndian: true) = value.<br>
</div>
ba longAt: 1 put: value bigEndian:
false.<br>
<div> self assert: (ba longAt: 1
bigEndian: false) = value.<br>
<br>
</div>
I mean, it'd get the job done. Any better
ideas?<br>
<br>
frank<br>
<br>
On 4 November 2013 21:51, Nicolas Cellier<br>
<div>
<div><<a moz-do-not-send="true"
href="mailto:nicolas.cellier.aka.nice@gmail.com"
target="_blank">nicolas.cellier.aka.nice@gmail.com</a>>
wrote:<br>
> It does not cost to ask ;)<br>
> If you're in the mood and if our
server is too, go for it...<br>
><br>
><br>
> 2013/11/4 Frank Shearar <<a
moz-do-not-send="true"
href="mailto:frank.shearar@gmail.com"
target="_blank">frank.shearar@gmail.com</a>><br>
>><br>
>> Are you hinting that I should
now fix the things post move? :)<br>
>><br>
>> frank<br>
>><br>
>> On 4 November 2013 21:15,
Nicolas Cellier<br>
>> <<a moz-do-not-send="true"
href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>>
wrote:<br>
>> > Sure! I said while at it
;)<br>
>> ><br>
>> ><br>
>> > 2013/11/4 Frank Shearar
<<a moz-do-not-send="true"
href="mailto:frank.shearar@gmail.com"
target="_blank">frank.shearar@gmail.com</a>><br>
>> >><br>
>> >> Yes.
#shouldnt:raise: is evil when you
catch Error.<br>
>> >><br>
>> >> I deliberately
didn't do that here so that reviewers
could see that I<br>
>> >> moved methods, not
added some random new test.<br>
>> >><br>
>> >> frank<br>
>> >><br>
>> >> On 4 November 2013
20:56, Nicolas Cellier<br>
>> >> <<a
moz-do-not-send="true"
href="mailto:nicolas.cellier.aka.nice@gmail.com"
target="_blank">nicolas.cellier.aka.nice@gmail.com</a>>
wrote:<br>
>> >> > While at it,
there were a discussion in Pharo about
shouldnt: []<br>
>> >> > raise:<br>
>> >> > Error, and it's
generally considered a poor test<br>
>> >> > - practically
nothing should raise Error, unless in
the few cases<br>
>> >> > when<br>
>> >> > you<br>
>> >> > create a block
that should:raise:<br>
>> >> > so
should:raise: is usefull, but
shouldnt:raise: is generally<br>
>> >> > useless<br>
>> >> > (unless maybe
if you are testing an Error inhibition
mechanism with<br>
>> >> > a<br>
>> >> > block that
shouldNormally:raise: Error)<br>
>> >> > - if ever, it
effectively raises an Error, you have
no information<br>
>> >> > why<br>
>> >> > I fully agree
with this.<br>
>> >> ><br>
>> >> ><br>
>> >> > 2013/11/4 <<a
moz-do-not-send="true"
href="mailto:commits@source.squeak.org"
target="_blank">commits@source.squeak.org</a>><br>
>> >> ><br>
>> >> >> Frank
Shearar uploaded a new version of
CollectionsTests to project<br>
>> >> >> The<br>
>> >> >> Trunk:<br>
>> >> >> <a
moz-do-not-send="true"
href="http://source.squeak.org/trunk/CollectionsTests-fbs.207.mcz"
target="_blank">http://source.squeak.org/trunk/CollectionsTests-fbs.207.mcz</a><br>
>> >> >><br>
>> >> >>
==================== Summary
====================<br>
>> >> >><br>
>> >> >> Name:
CollectionsTests-fbs.207<br>
>> >> >> Author: fbs<br>
>> >> >> Time: 4
November 2013, 6:31:01.83 pm<br>
>> >> >> UUID:
4057d67b-5969-8b41-85d1-43fd39da4bb1<br>
>> >> >> Ancestors:
CollectionsTests-cmm.206<br>
>> >> >><br>
>> >> >> Move
collection tests where they belong.<br>
>> >> >><br>
>> >> >>
=============== Diff against
CollectionsTests-cmm.206<br>
>> >> >>
===============<br>
>> >> >><br>
>> >> >> Item was
added:<br>
>> >> >> + -----
Method:
ByteArrayTest>>testByteArrayLongAt
(in category 'as<br>
>> >> >> yet<br>
>> >> >>
unclassified') -----<br>
>> >> >> +
testByteArrayLongAt<br>
>> >> >> + |
ba value |<br>
>> >> >> + ba
:= ByteArray new: 4.<br>
>> >> >> +
value := -1.<br>
>> >> >> +
self shouldnt:[ba longAt: 1 put: value
bigEndian: true]<br>
>> >> >> raise:<br>
>> >> >> Error.<br>
>> >> >> +
self assert: (ba longAt: 1 bigEndian:
true) = value.<br>
>> >> >> +
self shouldnt:[ba longAt: 1 put: value
bigEndian: false]<br>
>> >> >> raise:<br>
>> >> >> Error.<br>
>> >> >> +
self assert: (ba longAt: 1 bigEndian:
false) = value.!<br>
>> >> >><br>
>> >> >> Item was
added:<br>
>> >> >> + -----
Method:
DictionaryTest>>testIntegrityOfDictionaries
(in<br>
>> >> >> category<br>
>> >> >> 'integrity
tests') -----<br>
>> >> >> +
testIntegrityOfDictionaries<br>
>> >> >> + #(<br>
>> >> >> +
Dictionary<br>
>> >> >> +
IdentityDictionary<br>
>> >> >> +
SystemDictionary<br>
>> >> >> +
LiteralDictionary<br>
>> >> >> +
PluggableDictionary<br>
>> >> >> +
WeakValueDictionary) do: [
:dictionaryClassName |<br>
>> >> >> +
Smalltalk at:
dictionaryClassName ifPresent:<br>
>> >> >> [<br>
>> >> >>
:dictionaryClass |<br>
>> >> >> +
dictionaryClass
allInstancesDo: [<br>
>> >> >> :dictionary
|<br>
>> >> >> +
dictionary
keysAndValuesDo:<br>
>> >> >> [<br>
>> >> >> :key<br>
>> >> >> :value |<br>
>> >> >> +
self assert:<br>
>> >> >> (dictionary<br>
>> >> >> at: key) ==
value ].<br>
>> >> >> +
dictionary
array<br>
>> >> >>
doWithIndex: [<br>
>> >> >>
:association :index |<br>
>> >> >> +
association ifNotNil: [<br>
>> >> >> +
self assert:<br>
>> >> >> (dictionary<br>
>> >> >> scanFor:
association key) = index ] ] ] ] ]!<br>
>> >> >><br>
>> >> >> Item was
added:<br>
>> >> >> + -----
Method:
DictionaryTest>>testMethodDictionaries
(in category<br>
>> >> >> 'integrity
tests') -----<br>
>> >> >> +
testMethodDictionaries<br>
>> >> >> +
MethodDictionary allInstancesDo: [
:dictionary |<br>
>> >> >> +
dictionary keysAndValuesDo: [ :key
:value |<br>
>> >> >> +
self assert: (dictionary
at: key) == value<br>
>> >> >> ].<br>
>> >> >> +
1 to: dictionary basicSize do: [
:index |<br>
>> >> >> +
(dictionary basicAt:
index)<br>
>> >> >> +
ifNil: [ self
assert: (dictionary<br>
>> >> >> array<br>
>> >> >> at: index)
isNil ]<br>
>> >> >> +
ifNotNil: [ :key |<br>
>> >> >> +
self
assert: (dictionary<br>
>> >> >> scanFor:<br>
>> >> >> key) =
index ] ] ]!<br>
>> >> >><br>
>> >> >> Item was
added:<br>
>> >> >> + -----
Method:
HashedCollectionTest>>testCapacity
(in category<br>
>> >> >> 'test -<br>
>> >> >> integrity')
-----<br>
>> >> >> +
testCapacity<br>
>> >> >> +<br>
>> >> >> + |
inconsistentCollections |<br>
>> >> >> +
inconsistentCollections :=
HashedCollection allSubInstances<br>
>> >> >> reject: [
:each |<br>
>> >> >> +
each class == MethodDictionary
"MethodDictionary is<br>
>> >> >> the<br>
>> >> >> only
HashedCollection which doesn't have
prime array size"<br>
>> >> >> +
ifTrue: [ each capacity
isPowerOfTwo ]<br>
>> >> >> +
ifFalse: [ each capacity
isPrime ] ].<br>
>> >> >> +
self assert: inconsistentCollections
isEmpty!<br>
>> >> >><br>
>> >> >> Item was
added:<br>
>> >> >> + -----
Method:
ReadWriteStreamTest>>testReadWriteStreamNextNBug
(in<br>
>> >> >> category
'tests') -----<br>
>> >> >> +
testReadWriteStreamNextNBug<br>
>> >> >> + |
aStream |<br>
>> >> >> +
aStream := ReadWriteStream on: String
new.<br>
>> >> >> +
aStream nextPutAll: 'Hello World'.<br>
>> >> >> +
self shouldnt:[aStream next: 5] raise:
Error.!<br>
>> >> >><br>
>> >> >><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>><br>
><br>
><br>
><br>
><br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span></span><br>
</div>
</blockquote>
<br>
<fieldset></fieldset>
<br>
</blockquote>
<br>
</div>
</div>
</div>
<br>
<br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>