[squeak-dev] The Trunk: Kernel-nice.537.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Dec 29 15:09:20 UTC 2010
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.537.mcz
==================== Summary ====================
Name: Kernel-nice.537
Author: nice
Time: 29 December 2010, 4:08:14.914 pm
UUID: e06ac3d0-0ae3-433e-9530-8663459c4a15
Ancestors: Kernel-nice.536
Add a few spaces in order to avoid Transcript warnings about @- ambiguity when recompiling.
=============== Diff against Kernel-nice.536 ===============
Item was changed:
----- Method: MethodFinder>>testFromTuple: (in category 'initialize') -----
testFromTuple: nth
"verify that the methods allowed don't crash the system. Try N of each of the fundamental types. up to 4 of each kind."
| objects nonRepeating even other aa cnt |
objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four')
(x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3)
).
objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}.
{Point class. SmallInteger class. Association class. Array class}.
"{ 4 blocks }."
{Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}.
{'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}.
{Dictionary new. Dictionary new. Dictionary new. Dictionary new}.
{#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection.
#($a 3 d) asOrderedCollection. #() asOrderedCollection}.
+ {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}.
+ {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}.
- {3->true. 5.6->$a. #x->2. 'abcd'->false}.
- {9 at 3 extent: 5 at 4. 0 at 0 extent: 45 at 9. -3 at -7 extent: 2 at 2. 4 at 4 extent: 16 at 16}.
{Color red. Color blue. Color black. Color gray}}.
self test2: objects.
"rec+0, rec+1, rec+2, rec+3 need to be tested. "
cnt := 0.
nth to: 4 do: [:take |
nonRepeating := OrderedCollection new.
objects do: [:each |
nonRepeating addAll: (each copyFrom: 1 to: take)].
"all combinations of take, from nonRepeating"
even := true.
nonRepeating combinations: take atATimeDo: [:tuple |
even ifTrue: [other := tuple clone]
ifFalse: [self load: (aa := Array with: tuple with: 1 with: other with: 7).
+ (cnt := cnt + 1) \\ 50 = 0 ifTrue: [
- (cnt := cnt+1) \\ 50 = 0 ifTrue: [
Transcript cr; show: aa first printString].
self search: true.
self test2: aa.
self test2: nonRepeating.
"self test2: objects"].
even := even not].
].!
Item was changed:
----- Method: MethodFinder>>testRandom (in category 'initialize') -----
testRandom
"verify that the methods allowed don't crash the system. Pick 3 or 4 from a mixed list of the fundamental types."
| objects other aa cnt take tuple fName sss |
objects := #((1 4 17 42) ($a $b $c $d) ('one' 'two' 'three' 'four')
(x + rect: new) ((a b 1 4) (c 1 5) ($a 3 d) ()) (4.5 0.0 3.2 100.3)
).
objects := objects, {{true. false. true. false}. {Point. SmallInteger. Association. Array}.
{Point class. SmallInteger class. Association class. Array class}.
"{ 4 blocks }."
{Date today. '1 Jan 1950' asDate. '25 Aug 1987' asDate. '1 Jan 2000' asDate}.
{'15:16' asTime. '1:56' asTime. '4:01' asTime. '6:23' asTime}.
{Dictionary new. Dictionary new. Dictionary new. Dictionary new}.
{#(a b 1 4) asOrderedCollection. #(c 1 5) asOrderedCollection.
#($a 3 d) asOrderedCollection. #() asOrderedCollection}.
+ {3 -> true. 5.6 -> $a. #x -> 2. 'abcd' -> false}.
+ {9 @ 3 extent: 5 @ 4. 0 @ 0 extent: 45 @ 9. -3 @ -7 extent: 2 @ 2. 4 @ 4 extent: 16 @ 16}.
- {3->true. 5.6->$a. #x->2. 'abcd'->false}.
- {9 at 3 extent: 5 at 4. 0 at 0 extent: 45 at 9. -3 at -7 extent: 2 at 2. 4 at 4 extent: 16 at 16}.
{Color red. Color blue. Color black. Color gray}}.
self test2: objects.
"rec+0, rec+1, rec+2, rec+3 need to be tested. "
fName := (FileDirectory default fileNamesMatching: '*.ran') first.
sss := fName splitInteger first.
(Collection classPool at: #RandomForPicking) seed: sss.
cnt := 0.
[take := #(3 4) atRandom.
tuple := (1 to: take) collect: [:ind | (objects atRandom) atRandom].
other := (1 to: take) collect: [:ind | (objects atRandom) atRandom].
self load: (aa := Array with: tuple with: 1 with: other with: 7).
+ ((cnt := cnt + 1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [
- ((cnt := cnt+1) \\ 10 = 0) " | (cnt > Skip)" ifTrue: [
Transcript cr; show: cnt printString; tab; tab; show: aa first printString].
cnt > (Smalltalk at: #StopHere) ifTrue: [self halt]. "stop just before crash"
cnt > (Smalltalk at: #Skip) ifTrue: ["skip this many at start"
self search: true.
self test2: aa first. self test2: (aa at: 3).
"self test2: objects"
].
true] whileTrue.
!
More information about the Squeak-dev
mailing list
|