The Trunk: Tests-nice.40.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tests-nice.40.mcz

commits-2
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.40.mcz

==================== Summary ====================

Name: Tests-nice.40
Author: nice
Time: 27 December 2009, 3:40:02 am
UUID: 4555ad47-eece-4589-81ab-11cffb4c8462
Ancestors: Tests-ul.39

Cosmetic: move or remove a few temps inside closures

=============== Diff against Tests-ul.39 ===============

Item was changed:
  ----- Method: PCCByCompilation>>methodsWithDisabledCall (in category 'ui querying') -----
  methodsWithDisabledCall
  "Answer a SortedCollection of all the methods that contain, in source  
  code, the substring indicating a disabled prim."
  "The alternative implementation  
  ^ SystemNavigation new allMethodsWithSourceString: self disabledPrimStartString
  matchCase: true  
  also searches in class comments."
+ | list string |
- | list classCount string |
  string := self disabledPrimStartString.
  list := Set new.
  'Searching all method source code...'
  displayProgressAt: Sensor cursorPoint
  from: 0
  to: Smalltalk classNames size * 2 "classes with their metaclasses"
+ during: [:bar | | classCount |
- during: [:bar |
  classCount := 0.
  SystemNavigation default
  allBehaviorsDo: [:class |
  bar value: (classCount := classCount + 1).
  class
  selectorsDo: [:sel |
  | src |
  "higher priority to avoid source file accessing  
  errors"
+ src := [class sourceCodeAt: sel]
- [src := class sourceCodeAt: sel]
  valueAt: self higherPriority.
  (src
  findString: string
  startingAt: 1
  caseSensitive: true) > 0
  ifTrue: [sel isDoIt ifFalse: [
  list add: (MethodReference new setStandardClass: class methodSymbol: sel)]]]]].
  ^ list asSortedCollection!

Item was changed:
  ----- Method: PCCByCompilation>>privateDisableCallIn: (in category 'private user interface') -----
  privateDisableCallIn: aMethodRef
  "Disables enabled or failed external prim call by recompiling method
  with prim call commented out, will be called by superclass."
  | src newMethodSource |
  "higher priority to avoid source file accessing errors"
+ src := [aMethodRef sourceString]
- [src := aMethodRef sourceString]
  valueAt: self higherPriority.
  newMethodSource := self enabled2DisabledPrimMethodString: src.
  "higher priority to avoid source file accessing errors"
  [aMethodRef actualClass
  compile: newMethodSource
  classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
  notifying: nil]
  valueAt: self higherPriority!

Item was changed:
  ----- Method: PCCByCompilation>>privateEnableCallIn: (in category 'private user interface') -----
  privateEnableCallIn: aMethodRef
  "Enables disabled external prim call by recompiling method with prim  
  call taken from disabling comment, will be called by superclass."
  | src newMethodSource |
  "higher priority to avoid source file accessing errors"
+ src := [aMethodRef sourceString]
- [src := aMethodRef sourceString]
  valueAt: self higherPriority.
  newMethodSource := self disabled2EnabledPrimMethodString: src.
  "higher priority to avoid source file accessing errors"
  [aMethodRef actualClass
  compile: newMethodSource
  classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
  notifying: nil]
  valueAt: self higherPriority!

Item was changed:
  ----- Method: PCCByCompilation>>existsDisabledCallIn: (in category 'ui testing') -----
  existsDisabledCallIn: aMethodRef
  | src |
  ^ (self existsCompiledCallIn: aMethodRef) not
  and: ["higher priority to avoid source file accessing errors"
+ src := [aMethodRef sourceString]
- [src := aMethodRef sourceString]
  valueAt: self higherPriority.
  self methodSourceContainsDisabledCall: src]!

Item was changed:
  ----- Method: TestValueWithinFix>>testValueWithinNonLocalReturnFixReal (in category 'tests') -----
  testValueWithinNonLocalReturnFixReal
  "self run: #testValueWithinNonLocalReturnFixReal"
  "The real test for the fix is just as obscure as the original problem"
+ | startTime |
- | startTime deltaTime |
  self valueWithinNonLocalReturn.
  startTime := Time millisecondClockValue.
+ [[] repeat] valueWithin: 100 milliSeconds onTimeout:[ | deltaTime |
- [[] repeat] valueWithin: 100 milliSeconds onTimeout:[
  "This *should* timeout after 100 msecs but the pending process from
  the previous invokation will signal timeout after 20 msecs already
  which will in turn cut this invokation short."
  deltaTime := Time millisecondClockValue - startTime.
  self deny: deltaTime < 90.
  ].
  !